Ejemplo n.º 1
0
 public function initialize()
 {
     $initialized = parent::initialize();
     $this->setDefaultProperties(array('key' => false, 'namespace' => false, 'area' => false));
     $this->dateFormat = $this->modx->getOption('manager_date_format') . ', ' . $this->modx->getOption('manager_time_format');
     return $initialized;
 }
Ejemplo n.º 2
0
 /** {@inheritDoc} */
 public function initialize()
 {
     if (!$this->modx->hasPermission($this->permission)) {
         return $this->modx->lexicon('access_denied');
     }
     return parent::initialize();
 }
Ejemplo n.º 3
0
 public function initialize()
 {
     $this->setDefaultProperties(array('profile' => 0, 'search' => ''));
     $this->canEdit = $this->modx->hasPermission('save');
     $this->canRemove = $this->modx->hasPermission('remove');
     return parent::initialize();
 }
Ejemplo n.º 4
0
 /** {@inheritDoc} */
 public function initialize()
 {
     if (!$this->getProperty('limit')) {
         $this->setProperty('limit', 20);
     }
     return parent::initialize();
 }
Ejemplo n.º 5
0
 /**
  * {@inheritDoc}
  * @return mixed
  */
 public function initialize()
 {
     $this->setDefaultProperties(array('id' => ''));
     $id = $this->getProperty('id');
     $this->setProperty('id', str_replace('n_', '', $id));
     return parent::initialize();
 }
Ejemplo n.º 6
0
 public function initialize()
 {
     if (!$this->getProperty('res')) {
         return 'Empty resource id';
     }
     return parent::initialize();
 }
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $props = $this->getProperties();
     if (empty($props['contexts'])) {
         return $this->modx->lexicon($this->objectType . '_err_ns');
     }
     return parent::initialize();
 }
Ejemplo n.º 8
0
 public function initialize()
 {
     $initialized = parent::initialize();
     $this->setDefaultProperties(array('search' => '', 'exclude' => ''));
     $this->canEdit = $this->modx->hasPermission('edit_context');
     $this->canRemove = $this->modx->hasPermission('delete_context');
     return $initialized;
 }
Ejemplo n.º 9
0
 /**
  * @return bool
  */
 public function initialize()
 {
     $parent = parent::initialize();
     /** @var Tickets $Tickets */
     $Tickets = $this->modx->getService('Tickets');
     $this->_modx23 = $Tickets->systemVersion();
     return $parent;
 }
Ejemplo n.º 10
0
 /**
  * @return bool
  */
 public function initialize()
 {
     $parent = parent::initialize();
     /** @var msDiscount $msDiscount */
     $msDiscount = $this->modx->getService('msDiscount');
     $this->_modx23 = $msDiscount->systemVersion();
     return $parent;
 }
Ejemplo n.º 11
0
 /** {@inheritDoc} */
 public function initialize()
 {
     $this->ms2 = $this->modx->getService('miniShop2');
     if (!$this->modx->hasPermission($this->permission)) {
         return $this->modx->lexicon('access_denied');
     }
     return parent::initialize();
 }
Ejemplo n.º 12
0
 public function initialize()
 {
     $this->editAction = $this->modx->getObject('modAction', array('namespace' => 'core', 'controller' => 'resource/update'));
     if (!$this->getProperty('limit')) {
         $this->setProperty('limit', 20);
     }
     return parent::initialize();
 }
Ejemplo n.º 13
0
 public function initialize()
 {
     $this->setDefaultProperties(array('album' => false));
     if (!$this->getProperty('album', false)) {
         return false;
     }
     return parent::initialize();
 }
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $props = $this->getProperties();
     if (empty($props['ids'])) {
         return $this->modx->lexicon($this->objectType . '_err_ns');
     }
     $this->setProperty('ids', json_decode($props['ids']), true);
     return parent::initialize();
 }
Ejemplo n.º 15
0
 public function initialize()
 {
     $this->setDefaultProperties(array('limit' => 10, 'target' => 0, 'principal_class' => 'modUserGroup', 'principal' => 0));
     $this->classKey = $this->getProperty('type');
     if (!$this->classKey) {
         return $this->modx->lexicon('access_type_err_ns');
     }
     return parent::initialize();
 }
Ejemplo n.º 16
0
 /** {@inheritDoc} */
 public function initialize()
 {
     if (!$this->modx->hasPermission($this->permission)) {
         return $this->modx->lexicon('access_denied');
     }
     $clientObject = $this->modx->newObject('MlmSystemClient');
     $this->statusBlocked = $clientObject->getStatusBlocked();
     return parent::initialize();
 }
Ejemplo n.º 17
0
 public function initialize()
 {
     $initialized = parent::initialize();
     $this->setDefaultProperties(array('usergroup' => 0, 'resourceGroup' => false, 'policy' => false));
     $usergroup = $this->getProperty('usergroup', false);
     if (!empty($usergroup)) {
         $this->userGroup = $this->modx->getObject('modUserGroup', $usergroup);
     }
     return $initialized;
 }
Ejemplo n.º 18
0
 public function initialize()
 {
     $initialized = parent::initialize();
     $this->setDefaultProperties(array('addNone' => false));
     if ($this->getProperty('sort') == 'rolename_link') {
         $this->setProperty('sort', 'name');
     }
     $this->canRemove = $this->modx->hasPermission('delete_role');
     return $initialized;
 }
Ejemplo n.º 19
0
 /**
  * @return bool
  */
 public function initialize()
 {
     $parent = parent::initialize();
     /** @var Tickets $Tickets */
     $Tickets = $this->modx->getService('Tickets');
     $this->_modx23 = $Tickets->systemVersion();
     if ($this->getProperty('sort') == 'stars') {
         $dir = $this->getProperty('dir', 'DESC');
         $this->setProperty('sort', "stars_tickets {$dir}, stars_comments");
     }
     return $parent;
 }
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $vers = $this->modx->getVersionData();
     $ver_comp = version_compare($vers['full_version'], '2.3.0');
     if ($ver_comp >= 0) {
         $this->editAction = 'resource/update';
     } else {
         $editAction = $this->modx->getObject('modAction', array('namespace' => 'core', 'controller' => 'resource/update'));
         $this->editAction = $editAction->get('id');
     }
     return parent::initialize();
 }
Ejemplo n.º 21
0
 public function initialize()
 {
     $initialized = parent::initialize();
     $this->setDefaultProperties(array('usergroup' => false, 'query' => ''));
     if ($this->getProperty('sort') == 'username_link') {
         $this->setProperty('sort', 'username');
     }
     if ($this->getProperty('sort') == 'id') {
         $this->setProperty('sort', 'modUser.id');
     }
     return $initialized;
 }
Ejemplo n.º 22
0
 public function initialize()
 {
     $this->setDefaultProperties(array('start' => 0, 'limit' => 20, 'sort' => $this->defaultSortField . ':' . $this->defaultSortDirection, 'combo' => false, 'query' => ''));
     $selection = intval($this->getProperty('selection', 0));
     if ($selection > 0) {
         $selection = $this->modx->getObject('modResource', $selection);
         if ($selection && $selection->class_key == 'SelectionContainer') {
             $this->selection = $selection;
             $this->collectionTemplate = $this->modx->collections->getCollectionsView($this->selection);
         }
     }
     return parent::initialize();
 }
Ejemplo n.º 23
0
 public function initialize()
 {
     switch ($this->getProperty('type')) {
         case 'users':
             $this->linkedKey1 = 'msdUserGroup';
             $this->linkedKey2 = 'modUserGroup';
             break;
         case 'products':
             $this->linkedKey1 = 'msdProductGroup';
             $this->linkedKey2 = 'modResourceGroup';
             break;
     }
     return parent::initialize();
 }
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $this->setDefaultProperties(array('limit' => 10));
     $user = (int) $this->getProperty('user', 0);
     if (!$user) {
         return $this->modx->lexicon($this->objectType . '_err_ns');
     }
     /** @var modUser $user */
     $this->object = $this->modx->getObject('modUser', $user);
     if (!$this->object) {
         return $this->modx->lexicon($this->objectType . '_err_nf');
     }
     return parent::initialize();
 }
Ejemplo n.º 25
0
 /** {@inheritDoc} */
 public function initialize()
 {
     switch ($this->getProperty('class')) {
         case 'modUserGroup':
             $this->objectType = $this->classKey = 'modUserGroup';
             break;
         case 'modResourceGroup':
             $this->objectType = $this->classKey = 'modResourceGroup';
             break;
     }
     if (empty($this->classKey)) {
         return $this->modx->lexicon('mlmsystem_err_class_ns');
     }
     return parent::initialize();
 }
Ejemplo n.º 26
0
 public function initialize()
 {
     $this->editAction = $this->modx->getObject('modAction', array('namespace' => 'core', 'controller' => 'resource/update'));
     $this->defaultSortField = $this->modx->getOption('articles.default_article_sort_field', null, 'createdon');
     if ($this->getParentContainer()) {
         $settings = $this->container->getContainerSettings();
         if ($this->modx->getOption('commentsEnabled', $settings, true)) {
             $quipCorePath = $this->modx->getOption('quip.core_path', null, $this->modx->getOption('core_path', null, MODX_CORE_PATH) . 'components/quip/');
             if ($this->modx->addPackage('quip', $quipCorePath . 'model/')) {
                 $this->commentsEnabled = true;
             }
         }
     }
     return parent::initialize();
 }
Ejemplo n.º 27
0
 public function initialize()
 {
     $initialized = parent::initialize();
     $this->setDefaultProperties(array('combo' => false, 'limit' => false, 'deleted' => 0, 'search' => false, 'family' => false, 'thread' => false));
     $thread = $this->getProperty('thread');
     if (!empty($thread)) {
         $this->thread = $this->modx->getObject('quipThread', $thread);
         if (empty($this->thread)) {
             return $this->modx->lexicon('quip.thread_err_nf');
         }
         if (!$this->thread->checkPolicy('view')) {
             return $this->modx->lexicon('access_denied');
         }
     }
     return $initialized;
 }
Ejemplo n.º 28
0
 public function initialize()
 {
     switch ($this->getProperty('type')) {
         case 'users':
             $this->objectType = $this->classKey = 'modUserGroup';
             $this->linkedKey = 'msdUserGroup';
             break;
         case 'products':
             $this->objectType = $this->classKey = 'modResourceGroup';
             $this->linkedKey = 'msdProductGroup';
             break;
     }
     if (empty($this->classKey)) {
         return 'Wrong type of group';
     }
     return parent::initialize();
 }
Ejemplo n.º 29
0
 public function initialize()
 {
     /** @var msDiscount $msDiscount */
     $msDiscount = $this->modx->getService('msDiscount');
     $this->_modx23 = $msDiscount->systemVersion();
     switch ($this->getProperty('type')) {
         case 'users':
             $this->linkedKey1 = 'msdUserGroup';
             $this->linkedKey2 = 'modUserGroup';
             break;
         case 'products':
             $this->linkedKey1 = 'msdProductGroup';
             $this->linkedKey2 = 'modResourceGroup';
             break;
     }
     return parent::initialize();
 }
Ejemplo n.º 30
0
 public function initialize()
 {
     $this->setDefaultProperties(array('cache' => false, 'cache_lifetime' => 0, xPDO::OPT_CACHE_KEY => "resource", 'cache_prefix' => $this->modx->context->key . '/getdata/', 'current' => false, 'page' => 0, 'getPage' => false, 'getPageParamsSet' => "getPage"));
     $initialized = parent::initialize();
     /*
         Need limits and etc.
     */
     if ($initialized !== true) {
         return $initialized;
     }
     if ($this->getProperty('current')) {
         $this->setProperty('limit', 1);
     }
     if ($page = $this->getProperty('page') and $page > 1 and $limit = $this->getProperty('limit', 0)) {
         $this->setProperty('start', ($page - 1) * $limit);
     }
     return !$this->hasErrors();
 }