public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     if (!empty($this->xpdo->lexicon) && $this->xpdo->lexicon instanceof modLexicon) {
         if ($this->get('lexicon') != 'core:dashboards') {
             $this->xpdo->lexicon->load($this->get('lexicon'));
         }
         $array['name_trans'] = $this->xpdo->lexicon->exists($this->get('name')) ? $this->xpdo->lexicon($this->get('name')) : $this->get('name');
         $array['description_trans'] = $this->xpdo->lexicon->exists($this->get('description')) ? $this->xpdo->lexicon($this->get('description')) : $this->get('description');
     }
     return $array;
 }
 /**
  * {inheritdoc}
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $arr = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     // figure out the icon
     $icon = $this->getIcon();
     if (!empty($icon) && is_array($icon)) {
         switch ($icon['type']) {
             case 'custom':
                 $arr['iconcls'] = '';
                 $arr['iconpath'] = $icon['value'];
                 break;
             case 'preset':
             default:
                 $arr['iconcls'] = $icon['value'];
                 $arr['iconpath'] = '';
                 break;
         }
     }
     return $arr;
 }
Exemplo n.º 3
0
 /**
  * Override toArray to provide more values
  *
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $values = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     if ($this->xpdo->context->key != 'mgr' && $this->xpdo->discuss) {
         $values['url'] = $this->getUrl();
     }
     return $values;
 }
Exemplo n.º 4
0
 /**
  * Override toArray to provide more values
  * 
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $values = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     $values[$keyPrefix . 'age'] = $this->get('age');
     $values[$keyPrefix . 'gender_formatted'] = $this->get('gender_formatted');
     $values[$keyPrefix . 'avatarUrl'] = $this->getAvatarUrl();
     $values[$keyPrefix . 'isSelf'] = $this->xpdo->user->get('id') == $this->get('user');
     $values[$keyPrefix . 'canEdit'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'canAccount'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'canMerge'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'name'] = $this->get('name');
     $values[$keyPrefix . 'posts_formatted'] = $this->get('posts_formatted');
     return $values;
 }
Exemplo n.º 5
0
 /**
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     foreach ($array as $k => &$v) {
         if ($k == 'title') {
             $v = strip_tags($v, '<span>');
             $v = preg_replace('@\\[\\[(.[^\\[\\[]*?)\\]\\]@si', '', $v);
             $v = html_entity_decode($v, ENT_COMPAT, 'UTF-8');
         }
     }
     reset($array);
     return $array;
 }
Exemplo n.º 6
0
 /**
  * Always ensure that the title strips any HTML/MODX tags
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     foreach ($array as $k => &$v) {
         if ($k == 'title') {
             $v = $this->xpdo->discuss->stripAllTags($v);
         }
     }
     reset($array);
     return $array;
 }
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     $array['badge'] = $this->getBadge();
     return $array;
 }