Esempio n. 1
0
use Plethora\View;
?>

<?php 
/* @var $oBreadcrumbs View */
/* @var $oSystemMessages View */
/* @var $oContent View */
/* @var $oController Controller */
?>

<div class="main_content container">
    <?php 
echo $oBreadcrumbs->render();
?>
    <?php 
echo Router\LocalActions::generateActions()->render();
?>
    <?php 
echo $oSystemMessages->render();
?>
    <?php 
echo View::factory('base/flash')->render();
?>

    <?php 
if ($oController->getTitle() != '') {
    ?>
        <h1><?php 
    echo $oController->getTitleForH1();
    ?>
</h1>
Esempio n. 2
0
    echo $oController->getTitleForH1();
    ?>
</span>
                <?php 
    /*<small>Control panel</small>*/
    ?>
            </h1>
        <?php 
}
?>
        <?php 
echo $oBreadcrumbs->render();
?>
    </section>

    <section class="content body">
        <?php 
echo \Plethora\Router\LocalActions::generateActions()->render();
?>
        <?php 
echo $oSystemMessages->render();
?>
        <?php 
echo \Plethora\View::factory('base/flash')->render();
?>

        <?php 
echo $oContent->render();
?>
    </section>
</div>
Esempio n. 3
0
<?php

use Plethora\Router\LocalActions;
LocalActions::addLocalAction(__('Reload cache'), 'backend', 'backend')->setConditions(['controller' => 'i18n', 'action' => 'index'])->setParameters(['controller' => 'i18n', 'action' => 'reloadcache'])->setIcon('refresh');
Esempio n. 4
0
 /**
  * Method which can be used to overwrite local actions of list subpage.
  *
  * @access   protected
  * @since    1.0.0-alpha
  * @version  1.0.0-alpha
  */
 protected function alterSortLocalActions()
 {
     $sControllerParam = Router::getParam('controller');
     Router\LocalActions::addLocalAction(__('Add ' . $sControllerParam), 'backend', 'backend')->setConditions(['controller' => $sControllerParam, 'action' => 'sort'])->setParameters(['controller' => $sControllerParam, 'action' => 'add']);
     Router\LocalActions::addLocalAction(__($sControllerParam . ' list'), 'backend', 'backend')->setConditions(['controller' => $sControllerParam, 'action' => 'sort'])->setParameters(['controller' => $sControllerParam, 'action' => 'list']);
 }
Esempio n. 5
0
 /**
  * ACTION - Change user password.
  *
  * @access   public
  * @return   View
  * @since    1.3.0, 2015-01-27
  * @version  1.0.2-dev, 2015-03-02
  */
 public function actionChangePassword()
 {
     if (!Model\User::isLogged()) {
         Router::relocateToRoute('home');
     }
     // get user
     $oUser = Model\User::getLoggedUser();
     /* create form instance */
     $oModelFormConfig = ModelFormConfig::factory()->setFieldsRestriction(['password'])->setMessage(__('Password changed successfully.'));
     $oModelForm = $oUser->form('user_profile', $oModelFormConfig);
     $oForm = $oModelForm->generate();
     // add local actions
     Router\LocalActions::addLocalAction(__('View profile'), 'user_password_change', 'user_profile')->setParameters(['id' => $oUser->getId()]);
     Router\LocalActions::addLocalAction(__('Edit profile'), 'user_password_change', 'user_profile_edit');
     // return profile modification form
     return View::factory('base/form')->bind('oForm', $oForm);
 }
Esempio n. 6
0
<?php

\Plethora\Router\LocalActions::addLocalAction(__('Edit page'), 'page', 'backend')->setParameters(array('controller' => 'pages', 'action' => 'edit'))->setBuilder(function (\Plethora\Router\LocalActions\Action $oAction) {
    $sPageRewrite = (int) \Plethora\Router::getParam('rewrite');
    $aPage = \Plethora\DB::query('SELECT p.id FROM \\Model\\Page p WHERE p.rewrite = :rewrite')->param('rewrite', $sPageRewrite)->single();
    $oAction->setParameter('id', $aPage['id']);
});
\Plethora\Router\LocalActions::addLocalAction(__('Preview'), 'backend', 'page')->setConditions(array('controller' => 'pages', 'action' => 'edit'))->setBuilder(function (\Plethora\Router\LocalActions\Action $oAction) {
    $iNewsID = (int) \Plethora\Router::getParam('id');
    $oPage = \Plethora\DB::find('Model\\Page', $iNewsID);
    /* @var $oPage \Model\Page */
    $oAction->setParameter('rewrite', $oPage->getRewrite());
});
Esempio n. 7
0
 /**
  * Method which can be used to overwrite local actions of list subpage.
  *
  * @access     protected
  * @since      1.1.3-dev, 2015-08-20
  * @version    1.2.0-dev
  */
 protected function alterSortLocalActions()
 {
     $iMenuID = Router::getParam('id');
     $sControllerParam = Router::getParam('controller');
     Router\LocalActions::addLocalAction(__('Add menu.' . $sControllerParam), 'backend', 'backend')->setConditions(['controller' => $sControllerParam, 'action' => 'sort', 'id' => $iMenuID])->setParameters(['controller' => $sControllerParam, 'action' => 'add', 'id' => $iMenuID]);
     Router\LocalActions::addLocalAction(__('menu.' . $sControllerParam . ' list'), 'backend', 'backend')->setIcon('list-alt')->setConditions(['controller' => $sControllerParam, 'action' => 'sort', 'id' => $iMenuID])->setParameters(['controller' => $sControllerParam, 'action' => 'list', 'id' => $iMenuID]);
 }