public function setup() { if (CMS::vars()->storage_type() == 'orm') { $this->orm_name = 'vars'; } if (CMS::vars()->storage_type() == 'storage') { $this->storage_name = 'vars'; } $this->merge_options(); Templates_HTML::add_scripts_settings(array('adminvars' => $this->js_config)); $this->auth_realm = CMS::$admin_realm; if (isset(CMS::$cfg->vars->use_tinymce)) { $s = trim(CMS::$cfg->vars->use_tinymce); if ($s == '' || $s == '0') { $this->use_tinymce = false; } } $this->use_views_from(CMS::views_path('admin/vars'))->use_views_from(CMS::views_path('admin/vars2')); if (CMS::vars()->storage_type() == 'orm') { $types = WS::env()->orm->vars->types(); $this->form_fields = $types->fields; $types->end(); } if (CMS::vars()->storage_type() == 'storage') { $this->form_fields = $this->storage()->make_entity()->fields(); // var_dump($this->form_fields); } $this->component = WS::env()->adminvars->component; //TODO: configure fields if (empty($this->tree_fields)) { $this->tree_fields = array('title' => array('caption' => 'Комментарий', 'flex' => 1), 'var_description' => array('caption' => 'Тип', 'flex' => 1), 'full_code' => array('caption' => 'Идентификатор', 'width' => 200)); } return parent::setup(); }
public function setup() { $this->auth_realm = CMS::$admin_realm; if (isset(CMS::$cfg->vars->use_tinymce)) { $s = trim(CMS::$cfg->vars->use_tinymce); if ($s == '' || $s == '0') { $this->use_tinymce = false; } } return parent::setup()->use_views_from(CMS::views_path('admin/vars')); }
public function setup() { $this->orm_module = $this->getp('orm_module'); $this->admin_module = $this->getp('admin_module'); $this->schema_module = $this->getp('schema_module'); $this->orm_fields = $this->getp('orm_fields'); $this->admin_fields = $this->getp('admin_fields'); $this->component = $this->getp('component'); $this->component_module = "Component.{$this->component}"; $this->admin_tabs = (bool) $this->getp('admin_tabs', 0); $this->item_name = "{$this->orm_module}.Item"; $this->urls = WS::env()->urls->cmscomponentfactory; $this->auth_realm = CMS::$admin_realm; return parent::setup()->use_views_from(CMS::views_path('admin/factory'))->render_defaults('tables', 'urls', 'table', 'fields', 'key_field'); }
/** * @return string */ static function embedded_admin_menu($style = '') { $menu = CMS::navigation()->admin(); if (!$menu || $menu->count() == 0) { return ''; } ob_start(); if (IO_FS::exists(CMS::app_path('views/embedded-admin-menu.phtml'))) { include CMS::app_path('views/embedded-admin-menu.phtml'); } else { include CMS::views_path('embedded-admin-menu.phtml'); } $contents = ob_get_contents(); ob_end_clean(); return $contents; }
static function draw($e) { $title = 'Exception'; include CMS::views_path('exception.phtml'); }
protected function templates_dir() { return CMS::views_path('admin/stockroom'); }
protected static function configure_paths() { $path_info = IO_FS::Path(__FILE__); self::$libpath = $path_info->dirname; self::$taopath = rtrim(self::$libpath, '/'); self::$taopath = preg_replace('{[a-z0-9_-]+$}i', '', self::$taopath); self::$taopath = rtrim(self::$taopath, '/'); self::$stdfiles_path = self::$taopath . '/files'; self::$views_path = self::$taopath . '/views'; self::check_assets(); if ($m = Core_Regexps::match_with_results('{/([^/]+)$}', rtrim($_SERVER['DOCUMENT_ROOT'], '/'))) { CMS::$www = $m[1]; } }
public function templates_dir() { return CMS::views_path('admin/vars2'); }
public function template($template) { if (!Core_Regexps::match('{\\.phtml$}', $template)) { $template .= '.phtml'; } if ($template[0] == '.' || $template[0] == '/') { return $template; } if ($t = $this->redefined_template($template)) { return $t; } $tpl = CMS::views_path('admin/table2/' . $template); if (is_file($tpl)) { return $tpl; } if ($this->view_exists($template)) { return $this->view_path_for($template); } return $tpl; }