Esempio n. 1
0
 public static function getDisplayTypeList()
 {
     if (isset(self::$displaytypelist)) {
         return self::$displaytypelist;
     }
     self::$displaytypelist = array();
     foreach (self::$displaytypes as $key => $value) {
         self::$displaytypelist[$key] = array('id' => $key, 'name' => $value);
     }
     return self::$displaytypelist;
 }
Esempio n. 2
0
    /**
     * handle tree edit
     */
    private function handleConfigGet($retrieveFields = true)
    {
        $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
        $request = Request::getInstance();
        $view = ViewManager::getInstance();
        $view->setType(Calendar::VIEW_CONFIG);
        $key = $this->getKey();
        $fields = array();
        if ($retrieveFields) {
            if ($this->exists($key)) {
                $fields = $this->getDetail($key);
                $fields['history'] = $fields['history'] ? strftime('%Y-%m-%d', $fields['history']) : '';
            } else {
                $fields = array_merge($this->getFields(SqlParser::MOD_INSERT), $this->plugin->getSettings());
            }
        } else {
            $fields = $this->getFields(SqlParser::MOD_UPDATE);
        }
        $template->setVariable('cbo_group', Utils::getHtmlCombo(Calendar::getGroupTypeList(), $fields['group_type']));
        $template->setVariable('cbo_display', Utils::getHtmlCombo(Calendar::getDisplayTypeList(), $fields['display']));
        $template->setVariable('cbo_comment_display', Utils::getHtmlCombo(CalendarComment::getDisplayTypeList(), $fields['comment_display']));
        $this->setFields($fields);
        $template->setVariable($fields);
        $template->setVariable($key);
        // add source code editor
        $theme = $this->director->theme;
        $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/editarea/edit_area/edit_area_full.js"></script>');
        $theme->addJavascript('
editAreaLoader.init({ 	id: "area1", 
							start_highlight: true, 
							allow_toggle: true, 
							allow_resize: true,
							language: "en", 
							syntax: "php", 
							syntax_selection_allow: "css,html,js,php", 
					});
');
        $datefields = array();
        $datefields[] = array('dateField' => 'history', 'triggerElement' => 'history');
        Utils::getDatePicker($this->director->theme, $datefields);
        // add breadcrumb item
        $this->director->theme->handleAdminLinks($template);
        $this->template[$this->director->theme->getConfig()->main_tag] = $template;
    }