/** * List template sets * * @return @e void */ protected function _listTemplateGroups() { //----------------------------------------- // INIT //----------------------------------------- $setID = intval($this->request['setID']); $templateGroups = array(); $css = array(); $setData = array(); //----------------------------------------- // Get template set data //----------------------------------------- $setData = $this->skinFunctions->fetchSkinData($setID); /* is this a vised skin? */ if ($setData['set_by_skin_gen']) { $this->registry->output->silentRedirect($this->settings['base_url'] . '&app=core&module=templates&section=skinsets&do=setEdit&set_id=' . $setID); } //----------------------------------------- // Fetch Template Groups //----------------------------------------- $templateGroups = $this->skinFunctions->fetchTemplates($setID, 'groupNames'); //----------------------------------------- // Get CSS //----------------------------------------- $_css = $this->skinFunctions->fetchCSS($setID); //----------------------------------------- // Fix up positioning //----------------------------------------- foreach ($_css as $_id => $_data) { $_data['css_content'] = null; $css[$_data['css_position'] . '.' . $_data['css_id']] = $_data; } ksort($css, SORT_NUMERIC); //----------------------------------------- // Add in group counts //----------------------------------------- foreach ($templateGroups as $name => $data) { $templateGroups[$name]['_modCount'] = $this->skinFunctions->fetchModifiedTemplateCount($setID, $name); unset($templateGroups[$name]['template_name']); unset($templateGroups[$name]['template_data']); unset($templateGroups[$name]['template_content']); } //----------------------------------------- // Now ensure that skin_global is first //----------------------------------------- $tmp = $templateGroups['skin_global']; unset($templateGroups['skin_global']); $templateGroups = array_merge(array('skin_global' => $tmp), $templateGroups); //----------------------------------------- // Navvy Gation //----------------------------------------- $this->registry->output->extra_nav[] = array($this->settings['base_url'] . 'module=templates&section=skinsets&do=overview', $this->lang->words['te_nav1']); $this->registry->output->extra_nav[] = array($this->settings['base_url'] . 'module=templates&section=templates&do=list&setID=' . $setID, $this->lang->words['te_nav2'] . $setData['set_name']); $this->registry->output->extra_title[] = "Manage Templates in " . $setData['set_name']; //----------------------------------------- // Print it... //----------------------------------------- $this->registry->output->html .= $this->html->templates_listTemplateGroups($templateGroups, $css, $setData); }
/** * Fetch a JSON list of template bits for the template group * * @return @e void */ protected function _getTemplateBitList() { //----------------------------------------- // INIT //----------------------------------------- $setID = intval($this->request['setID']); $templateGroup = IPSText::alphanumericalClean($this->request['templateGroup']); //----------------------------------------- // Checks... //----------------------------------------- if (!$setID or !$templateGroup) { $this->returnJsonError($this->lang->words['ajax_missing_data']); } //----------------------------------------- // Get templates //----------------------------------------- $templates = $this->skinFunctions->fetchTemplates($setID, 'groupTemplatesNoContent', $templateGroup); $this->returnJsonArray(array('templates' => array_values($templates), 'groupData' => array('_modCount' => $this->skinFunctions->fetchModifiedTemplateCount($setID, $templateGroup)))); }
/** * Magic __call methods * Aka too lazy to create a proper function */ public function __call($funcName, $args) { /* Output format stuff.. */ switch ($funcName) { case 'isBoolean': return $this->SEARCH->isBoolean(); break; case 'formatSearchTerm': return $this->SEARCH->formatSearchTerm($args[0]); break; case 'getResultCount': return $this->_count; break; case 'getResultSet': return $this->_results; break; case 'getRawResultSet': return $this->_rawResults; break; case 'fetchTemplates': return $this->FORMAT->fetchTemplates(); break; case 'fetchSortDropDown': return $this->SEARCH->fetchSortDropDown(); break; /* Primarily shortcuts for 'Content I follow' */ /* Primarily shortcuts for 'Content I follow' */ case 'fetchFollowedContentOutput': return $this->FORMAT->parseFollowedContentOutput($args[0], $args[1]); break; } }