예제 #1
0
파일: List.php 프로젝트: Sywooch/forums
 public function prepareParams()
 {
     parent::prepareParams();
     if ($this->_params['masterStyle']) {
         foreach ($this->_params['styles'] as &$style) {
             $style['depth']++;
         }
     }
 }
예제 #2
0
 public function prepareParams()
 {
     parent::prepareParams();
     $this->_params['templates'] = array();
     $keys = array('template_id', 'title', 'template', 'link', 'deleteLink');
     foreach ($this->_params['templateData'] as $template) {
         $this->_params['templates'][$template['title']] = XenForo_Application::arrayFilterKeys($template, $keys);
     }
 }
예제 #3
0
 public function prepareParams()
 {
     $widget =& $this->_params['widget'];
     if (!empty($this->_params['conditionalParams'])) {
         $conditionalParams = @json_decode($this->_params['conditionalParams'], true);
         $keyValuePairs = array();
         if (!empty($conditionalParams)) {
             $this->_prepareKeyValuePairs($conditionalParams, $keyValuePairs);
         }
         $explains = array();
         foreach ($keyValuePairs as $pairKey => $pairValue) {
             $explains[] = sprintf('<a href="#" title="{%1$s} == \'%2$s\'" class="Tooltip">%1$s</a>', $pairKey, htmlspecialchars($pairValue));
         }
         $this->_params['conditionalParamsExplain'] = implode(' ', $explains);
         if (!empty($keyValuePairs['$contentTemplate'])) {
             if (empty($widget['widget_id']) and empty($widget['options']['expression']) and empty($widget['options']['conditional'])) {
                 $widget['options']['conditional']['raw'] = sprintf('{$contentTemplate} == \'%s\'', $keyValuePairs['$contentTemplate']);
             }
         }
     }
     if (!empty($widget['class']) && isset($this->_params['renderers'])) {
         $rendererFound = false;
         foreach ($this->_params['renderers'] as &$rendererRef) {
             if ($rendererRef['value'] === $widget['class']) {
                 $rendererFound = true;
                 $rendererRef['selected'] = true;
             }
         }
         if (!$rendererFound) {
             $this->_params['renderers'][] = array('value' => $widget['class'], 'label' => new XenForo_Phrase('wf_unknown_renderer', array('class' => $widget['class'])));
         }
     }
     if (!empty($widget['widget_id']) && $widget['widget_id'] > 0 && !empty($widget['options'][WidgetFramework_DataWriter_Widget::WIDGET_OPTION_ADDON_VERSION_ID])) {
         $this->_prepareWidgetTitlePhrases($widget);
     }
     if (!empty($this->_params['renderers'])) {
         foreach (array_keys($this->_params['renderers']) as $rendererKey) {
             if (!empty($this->_params['renderers'][$rendererKey]['is_hidden']) && empty($this->_params['renderers'][$rendererKey]['selected'])) {
                 // remove hidden renderer if it's not already selected
                 unset($this->_params['renderers'][$rendererKey]);
             }
         }
     }
     parent::prepareParams();
 }