Ejemplo n.º 1
0
    public function getLayoutForm()
    {
        $layoutform = PtsThemePanelHelper::getLayoutSettingByTheme($this->theme_name);
        $params = isset($layoutform['layout']) ? $layoutform['layout'] : array('layout' => array());
        $soption = array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')));
        $inputs = array('theme' => array('type' => 'select', 'label' => $this->l('Set Default Skin'), 'name' => 'theme', 'options' => array('query' => $this->getThemes(), 'id' => 'skin', 'name' => 'skin'), 'default' => 'default', 'desc' => $this->l('select a skin as default, and you can switch skin in') . '<a href="#livethemeconfigurator"> ' . $this->l('Live Theme Configurator Panel') . '</a>'));
        if (PtsThemeSample::isReHookBySkin($this->theme_name, 'default')) {
            $inputs['rehook'] = array('type' => 'switch', 'label' => $this->l('Auto ReHook Wih Actived Skin'), 'name' => 'rehook', 'desc' => $this->l('When changing skin to other skin, all modules will be re-hooked on expected 
					positions of that skin. This doest not save value in configuration'), 'values' => $soption, 'default' => 0);
        }
        $params = empty($params) ? $inputs : array_merge_recursive($inputs, $params);
        return $params;
    }
Ejemplo n.º 2
0
 public function backup()
 {
     $modules = self::getModuleSamples($this->theme);
     //d( $modules );
     if (is_array($modules) && !empty($modules)) {
         foreach ($modules as $module) {
             if (isset($module['name'])) {
                 $string = $this->exportModule($module);
                 PtsThemePanelHelper::writeToCache($this->backup_dir, $module['name'], $string, 'xml');
             }
         }
     }
 }