@@ -7,19 +7,19 @@ |
||
| 7 | 7 | |
| 8 | 8 | use Ajax\semantic\html\elements\HtmlIcon; |
| 9 | 9 | |
| 10 | -class HtmlPaginationMenu extends HtmlMenu{ |
|
| 10 | +class HtmlPaginationMenu extends HtmlMenu { |
|
| 11 | 11 | |
| 12 | - public function __construct( $identifier, $items=array() ){ |
|
| 13 | - parent::__construct( $identifier,$items); |
|
| 12 | + public function __construct($identifier, $items=array()) { |
|
| 13 | + parent::__construct($identifier, $items); |
|
| 14 | 14 | } |
| 15 | 15 | /** |
| 16 | 16 | * {@inheritDoc} |
| 17 | 17 | * @see \Ajax\common\html\BaseHtml::compile() |
| 18 | 18 | */ |
| 19 | - public function compile(JsUtils $js=NULL,$view=NULL){ |
|
| 19 | + public function compile(JsUtils $js=NULL, $view=NULL) { |
|
| 20 | 20 | $this->insertItem(new HtmlIcon("", "left chevron")); |
| 21 | 21 | $this->addItem(new HtmlIcon("", "right chevron")); |
| 22 | 22 | $this->asPagination(); |
| 23 | - return parent::compile($js,$view); |
|
| 23 | + return parent::compile($js, $view); |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | \ No newline at end of file |
@@ -56,8 +56,9 @@ |
||
| 56 | 56 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
| 57 | 57 | $items[]=$action; |
| 58 | 58 | foreach ($params as $p){ |
| 59 | - if(\is_object($p)===false) |
|
| 60 | - $items[]=$p; |
|
| 59 | + if(\is_object($p)===false) { |
|
| 60 | + $items[]=$p; |
|
| 61 | + } |
|
| 61 | 62 | } |
| 62 | 63 | } |
| 63 | 64 | return $items; |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Phalcon\Mvc\View; |
| 8 | 8 | use Phalcon\Mvc\Controller; |
| 9 | 9 | |
| 10 | -class JsUtils extends \Ajax\JsUtils implements InjectionAwareInterface{ |
|
| 10 | +class JsUtils extends \Ajax\JsUtils implements InjectionAwareInterface { |
|
| 11 | 11 | protected $_di; |
| 12 | 12 | public function setDi(DiInterface $di) { |
| 13 | 13 | $this->_di=$di; |
@@ -18,49 +18,49 @@ discard block |
||
| 18 | 18 | return $this->_di; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function getUrl($url){ |
|
| 21 | + public function getUrl($url) { |
|
| 22 | 22 | return $this->_di->get("url")->get($url); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function addViewElement($identifier,$content,$view){ |
|
| 25 | + public function addViewElement($identifier, $content, $view) { |
|
| 26 | 26 | $controls=$view->getVar("q"); |
| 27 | - if (isset($controls) === false) { |
|
| 28 | - $controls=array (); |
|
| 27 | + if (isset($controls)===false) { |
|
| 28 | + $controls=array(); |
|
| 29 | 29 | } |
| 30 | 30 | $controls[$identifier]=$content; |
| 31 | 31 | $view->setVar("q", $controls); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public function createScriptVariable($view,$view_var, $output){ |
|
| 35 | - $view->setVar($view_var,$output); |
|
| 34 | + public function createScriptVariable($view, $view_var, $output) { |
|
| 35 | + $view->setVar($view_var, $output); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function forward($initialController,$controller,$action){ |
|
| 39 | - $dispatcher = $initialController->dispatcher; |
|
| 38 | + public function forward($initialController, $controller, $action) { |
|
| 39 | + $dispatcher=$initialController->dispatcher; |
|
| 40 | 40 | $dispatcher->setControllerName($controller); |
| 41 | 41 | $dispatcher->setActionName($action); |
| 42 | 42 | $dispatcher->dispatch(); |
| 43 | - $template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(),$dispatcher->getParams(), function ($view) { |
|
| 43 | + $template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(), $dispatcher->getParams(), function($view) { |
|
| 44 | 44 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
| 45 | 45 | }); |
| 46 | 46 | return $template; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function renderContent($view, $controller, $action, $params=NULL) { |
| 50 | - $template=$view->getRender($controller, $action, $params, function ($view) { |
|
| 50 | + $template=$view->getRender($controller, $action, $params, function($view) { |
|
| 51 | 51 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
| 52 | 52 | }); |
| 53 | 53 | return $template; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function fromDispatcher($dispatcher){ |
|
| 56 | + public function fromDispatcher($dispatcher) { |
|
| 57 | 57 | $params=$dispatcher->getParams(); |
| 58 | 58 | $action=$dispatcher->getActionName(); |
| 59 | 59 | $items=array($dispatcher->getControllerName()); |
| 60 | - if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
|
| 60 | + if (\sizeof($params)>0 || \strtolower($action)!="index") { |
|
| 61 | 61 | $items[]=$action; |
| 62 | - foreach ($params as $p){ |
|
| 63 | - if(\is_object($p)===false) |
|
| 62 | + foreach ($params as $p) { |
|
| 63 | + if (\is_object($p)===false) |
|
| 64 | 64 | $items[]=$p; |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -3,49 +3,49 @@ |
||
| 3 | 3 | namespace Ajax\php\laravel; |
| 4 | 4 | |
| 5 | 5 | |
| 6 | -class JsUtils extends \Ajax\JsUtils{ |
|
| 7 | - public function getUrl($url){ |
|
| 6 | +class JsUtils extends \Ajax\JsUtils { |
|
| 7 | + public function getUrl($url) { |
|
| 8 | 8 | return $url; |
| 9 | 9 | } |
| 10 | - public function addViewElement($identifier,$content,$view){ |
|
| 10 | + public function addViewElement($identifier, $content, $view) { |
|
| 11 | 11 | $controls=$view->__get("q"); |
| 12 | - if (isset($controls) === false) { |
|
| 13 | - $controls=array (); |
|
| 12 | + if (isset($controls)===false) { |
|
| 13 | + $controls=array(); |
|
| 14 | 14 | } |
| 15 | 15 | $controls[$identifier]=$content; |
| 16 | 16 | $view->__set("q", $controls); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - public function createScriptVariable($view,$view_var, $output){ |
|
| 20 | - $view->__set($view_var,$output); |
|
| 19 | + public function createScriptVariable($view, $view_var, $output) { |
|
| 20 | + $view->__set($view_var, $output); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function forward($initialController,$controller,$action){ |
|
| 24 | - $dispatcher = $initialController->dispatcher; |
|
| 23 | + public function forward($initialController, $controller, $action) { |
|
| 24 | + $dispatcher=$initialController->dispatcher; |
|
| 25 | 25 | $dispatcher->setControllerName($controller); |
| 26 | 26 | $dispatcher->setActionName($action); |
| 27 | 27 | $dispatcher->dispatch(); |
| 28 | - $template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(),$dispatcher->getParams(), function ($view) { |
|
| 28 | + $template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(), $dispatcher->getParams(), function($view) { |
|
| 29 | 29 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
| 30 | 30 | }); |
| 31 | 31 | return $template; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function renderContent($view, $controller, $action, $params=NULL) { |
| 35 | - $template=$view->getRender($controller, $action, $params, function ($view) { |
|
| 35 | + $template=$view->getRender($controller, $action, $params, function($view) { |
|
| 36 | 36 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
| 37 | 37 | }); |
| 38 | 38 | return $template; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function fromDispatcher($dispatcher){ |
|
| 41 | + public function fromDispatcher($dispatcher) { |
|
| 42 | 42 | $params=$dispatcher->getParams(); |
| 43 | 43 | $action=$dispatcher->getActionName(); |
| 44 | 44 | $items=array($dispatcher->getControllerName()); |
| 45 | - if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
|
| 45 | + if (\sizeof($params)>0 || \strtolower($action)!="index") { |
|
| 46 | 46 | $items[]=$action; |
| 47 | - foreach ($params as $p){ |
|
| 48 | - if(\is_object($p)===false) |
|
| 47 | + foreach ($params as $p) { |
|
| 48 | + if (\is_object($p)===false) |
|
| 49 | 49 | $items[]=$p; |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -56,8 +56,9 @@ |
||
| 56 | 56 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
| 57 | 57 | $items[]=$action; |
| 58 | 58 | foreach ($params as $p){ |
| 59 | - if(\is_object($p)===false) |
|
| 60 | - $items[]=$p; |
|
| 59 | + if(\is_object($p)===false) { |
|
| 60 | + $items[]=$p; |
|
| 61 | + } |
|
| 61 | 62 | } |
| 62 | 63 | } |
| 63 | 64 | return $items; |