예제 #1
0
 /**
  * Constructs a new scaffold manager
  * @param string $modelName Name of the model to scaffold
  * @param string $nameTranslation Translation key of the manager name
  * @param string $icon Path to the icon of the manager
  * @param boolean $isReadOnly Set to true to make the scaffolding read only
  * @param boolean|array $search Boolean to enable or disable the search functionality, an array of field names to query is also allowed to enable the search
  * @param boolean|array $order Boolean to enable or disable the order functionality, an array of field names to order is also allowed to enable the order
  * @param boolean|array $pagination Boolean to enable or disable the pagination functionality, an array of pagination options is also allowed to enable the pagination
  * @return null
  */
 public function __construct($modelName, $nameTranslation, $icon = null, $isReadOnly = false, $search = true, $order = true, $pagination = true)
 {
     parent::__construct($modelName, $isReadOnly, $search, $order, $pagination);
     $this->name = $this->getTranslator()->translate($nameTranslation);
     $this->icon = $icon;
     $this->translationTitle = $nameTranslation;
 }
예제 #2
0
 /**
  * Constructs a new User controller
  * @return null
  */
 public function __construct()
 {
     $translator = $this->getTranslator();
     $isReadOnly = false;
     $search = array('username', 'email', 'roles.name');
     $order = array($translator->translate(self::TRANSLATION_USERNAME) => array('ASC' => '{username} ASC', 'DESC' => '{username} DESC'), $translator->translate(self::TRANSLATION_EMAIL) => array('ASC' => '{email} ASC, {username} ASC', 'DESC' => '{email} DESC, {username} ASC'), $translator->translate(self::TRANSLATION_ACTIVE) => array('ASC' => '{isActive} DESC, {username} ASC', 'DESC' => '{isActive} ASC, {username} ASC'));
     $pagination = true;
     parent::__construct(UserModel::NAME, $isReadOnly, $search, $order, $pagination);
 }
예제 #3
0
 /**
  * Construct a new log controller
  * @return null
  */
 public function __construct()
 {
     $translator = $this->getTranslator();
     $search = array('action', 'dataModel', 'user');
     $order = array($translator->translate(self::TRANSLATION_DATE_ADDED) => array('ASC' => '{dateAdded} ASC, {id} ASC', 'DESC' => '{dateAdded} DESC, {id} DESC'));
     parent::__construct(LogModel::NAME, true, $search, $order, true);
     $this->orderDirection = 'DESC';
     $this->translationTitle = self::TRANSLATION_TITLE;
 }