@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | class PluginRegister { |
| 4 | 4 | private $requestedPlugins; |
| 5 | 5 | |
| 6 | - public function __construct($requestedPlugins=array()) { |
|
| 6 | + public function __construct($requestedPlugins = array()) { |
|
| 7 | 7 | $this->requestedPlugins = $requestedPlugins; |
| 8 | 8 | $this->pluginOrder = array(); |
| 9 | 9 | foreach ($this->requestedPlugins as $index => $value) { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @param boolean $raw interpret $type values as raw text instead of files |
| 46 | 46 | * @return array |
| 47 | 47 | */ |
| 48 | - private function filterPlugins($type, $raw=false) { |
|
| 48 | + private function filterPlugins($type, $raw = false) { |
|
| 49 | 49 | $plugins = $this->getPlugins(); |
| 50 | 50 | $plugins = $this->sortPlugins($plugins); |
| 51 | 51 | $ret = array(); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | else { |
| 60 | 60 | foreach ($files[$type] as $file) { |
| 61 | - array_push($ret[$name], 'plugins/' . $name . '/' . $file); |
|
| 61 | + array_push($ret[$name], 'plugins/'.$name.'/'.$file); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @param array $names the plugin name strings (foldernames) in an array |
| 90 | 90 | * @return array |
| 91 | 91 | */ |
| 92 | - public function getPluginsJS($names=null) { |
|
| 92 | + public function getPluginsJS($names = null) { |
|
| 93 | 93 | if ($names) { |
| 94 | 94 | $names = array_merge($this->requestedPlugins, $names); |
| 95 | 95 | return $this->filterPluginsByName('js', $names); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @param array $names the plugin name strings (foldernames) in an array |
| 103 | 103 | * @return array |
| 104 | 104 | */ |
| 105 | - public function getPluginsCSS($names=null) { |
|
| 105 | + public function getPluginsCSS($names = null) { |
|
| 106 | 106 | if ($names) { |
| 107 | 107 | $names = array_merge($this->requestedPlugins, $names); |
| 108 | 108 | return $this->filterPluginsByName('css', $names); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @param array $names the plugin name strings (foldernames) in an array |
| 116 | 116 | * @return array |
| 117 | 117 | */ |
| 118 | - public function getPluginsTemplates($names=null) { |
|
| 118 | + public function getPluginsTemplates($names = null) { |
|
| 119 | 119 | if ($names) { |
| 120 | 120 | $names = array_merge($this->requestedPlugins, $names); |
| 121 | 121 | return $this->filterPluginsByName('templates', $names); |
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | * @param array $names the plugin name strings (foldernames) in an array |
| 129 | 129 | * @return array |
| 130 | 130 | */ |
| 131 | - public function getTemplates($names=null) { |
|
| 131 | + public function getTemplates($names = null) { |
|
| 132 | 132 | $templateStrings = array(); |
| 133 | 133 | $plugins = $this->getPluginsTemplates($names); |
| 134 | 134 | foreach ($plugins as $folder => $templates) { |
| 135 | 135 | foreach ($templates as $path) { |
| 136 | 136 | if (file_exists($path)) { |
| 137 | 137 | $filename = explode('/', $path); |
| 138 | - $filename = $filename[sizeof($filename)-1]; |
|
| 139 | - $id = $folder . '-' . substr($filename, 0 , (strrpos($filename, "."))); |
|
| 138 | + $filename = $filename[sizeof($filename) - 1]; |
|
| 139 | + $id = $folder.'-'.substr($filename, 0, (strrpos($filename, "."))); |
|
| 140 | 140 | $templateStrings[$id] = file_get_contents($path); |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @param array $names the plugin name strings (foldernames) in an array |
| 150 | 150 | * @return array |
| 151 | 151 | */ |
| 152 | - public function getPluginCallbacks($names=null) { |
|
| 152 | + public function getPluginCallbacks($names = null) { |
|
| 153 | 153 | if ($names) { |
| 154 | 154 | $names = array_merge($this->requestedPlugins, $names); |
| 155 | 155 | return $this->filterPluginsByName('callback', $names); |