Пример #1
0
 /**
  * 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);
 }
Пример #2
0
 /**
  * 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))));
 }