public function initFileContents() { $staticsHostUrl = kernel::get_app_statics_host_url(); $fileDir = $staticsHostUrl . '/ectools/statics/scripts/area.json'; $this->areaFileContents = json_decode(file_get_contents($fileDir), true); $this->__setKvArea(); }
function __construct($app_id) { $this->app_id = $app_id; $this->app_dir = APP_DIR . '/' . $app_id; $this->public_app_dir = PUBLIC_DIR . '/app/' . $app_id; $this->res_url = kernel::get_app_statics_host_url() . '/' . $app_id . '/statics'; $this->res_full_url = kernel::get_app_statics_host_url() . '/' . $app_id . '/statics'; $this->lang_url = kernel::get_app_statics_host_url() . '/' . $app_id . '/lang'; $this->lang_full_url = kernel::get_app_statics_host_url() . '/' . $app_id . '/lang'; $this->widgets_url = kernel::get_app_statics_host_url() . '/' . $app_id . '/widgets'; $this->widgets_full_url = kernel::get_app_statics_host_url() . '/' . $app_id . '/widgets'; $this->res_dir = PUBLIC_DIR . '/app/' . $app_id . '/statics'; $this->widgets_dir = PUBLIC_DIR . '/app/' . $app_id . '/widgets'; $this->lang_dir = PUBLIC_DIR . '/app/' . $app_id . '/lang'; //$this->lang_resource = lang::get_res($app_id); //todo: 得到语言包资源文件结构 $this->_lang_resource = null; }
public function add_widgets_page_extend() { $theme = $this->_request->get_get('theme'); $type = $this->_request->get_get('type'); $catalog = $this->_request->get_post('catalog'); $this->pagedata['theme'] = $theme; $this->pagedata['widgetsLib'] = kernel::single('site_theme_widget')->get_libs_extend($theme, $catalog); $app_base_url = kernel::get_app_statics_host_url(); $theme_url = kernel::get_themes_host_url() . '/' . $theme; $themesFileObj = app::get('site')->model('themes_file'); // $widgetsFileObj=app::get('site')->model('widgets_file'); $storager = kernel::single('base_storager'); if ($this->pagedata['widgetsLib']['list']) { foreach ((array) $this->pagedata['widgetsLib']['list'] as $key => $widgets) { if ($widgets['theme']) { $rs = $themesFileObj->getList('content', array('fileuri' => $widgets['theme'] . ':' . 'widgets/' . $widgets['name'] . '/images/icon.jpg')); if ($rs[0]['content']) { $ident = $storager->parse($rs[0]['content']); $src = $ident['url']; ecae_kvstore_write('test', $src); $this->pagedata['widgetsLib']['list'][$key]['img'] = $src; } else { if (file_exists(THEME_DIR . '/' . $theme . '/widgets/' . $widgets['name'] . '/images/icon.jpg')) { $this->pagedata['widgetsLib']['list'][$key]['img'] = $theme_url . '/widgets/' . $widgets['name'] . '/images/icon.jpg'; } else { $this->pagedata['widgetsLib']['list'][$key]['img'] = $this->app->res_url . '/images/widgets/icon.jpg'; } } $rs = $themesFileObj->getList('content', array('fileuri' => $widgets['theme'] . ':' . 'widgets/' . $widgets['name'] . '/images/widget.jpg')); if ($rs[0]['content']) { $ident = $storager->parse($rs[0]['content']); $src = $ident['url']; $this->pagedata['widgetsLib']['list'][$key]['bimg'] = $src; } else { if (file_exists(THEME_DIR . '/' . $theme . '/widgets/' . $widgets['name'] . '/images/preview.jpg')) { $this->pagedata['widgetsLib']['list'][$key]['bimg'] = $theme_url . '/widgets/' . $widgets['name'] . '/images/preview.jpg'; } else { $this->pagedata['widgetsLib']['list'][$key]['bimg'] = $this->app->res_url . '/images/widgets/widget.jpg'; } } } else { //获取系统级挂件信息 if (file_exists(ROOT_DIR . '/app/' . $widgets['app'] . '/widgets/' . $widgets['name'] . '/images/icon.jpg')) { $this->pagedata['widgetsLib']['list'][$key]['img'] = $app_base_url . $widgets['app'] . '/widgets/' . $widgets['name'] . '/images/icon.jpg'; } else { $this->pagedata['widgetsLib']['list'][$key]['img'] = $this->app->res_url . '/images/widgets/icon.jpg'; } if (file_exists(ROOT_DIR . '/app/' . $widgets['app'] . '/widgets/' . $widgets['name'] . '/images/preview.jpg')) { $this->pagedata['widgetsLib']['list'][$key]['bimg'] = $app_base_url . $widgets['app'] . '/widgets/' . $widgets['name'] . '/images/preview.jpg'; } else { $this->pagedata['widgetsLib']['list'][$key]['bimg'] = $this->app->res_url . '/images/widgets/widget.jpg'; } } } } $this->display('admin/theme/widget/add_widgets_page_extend.html'); }
public function add_widgets_page_extend() { $theme = input::get('theme'); $type = input::get('type'); $catalog = input::get('catalog'); $pagedata['theme'] = $theme; $pagedata['widgetsLib'] = kernel::single('site_theme_widget')->get_libs_extend($theme, $catalog); $app_base_url = kernel::get_app_statics_host_url(); $theme_url = kernel::get_themes_host_url() . '/' . $theme; if ($pagedata['widgetsLib']['list']) { foreach ((array) $pagedata['widgetsLib']['list'] as $key => $widgets) { if ($widgets['theme']) { if (file_exists(THEME_DIR . '/' . $theme . '/widgets/' . $widgets['name'] . '/images/icon.jpg')) { $pagedata['widgetsLib']['list'][$key]['img'] = $theme_url . '/widgets/' . $widgets['name'] . '/images/icon.jpg'; } else { $pagedata['widgetsLib']['list'][$key]['img'] = $this->app->res_url . '/images/widgets/icon.jpg'; } if (file_exists(THEME_DIR . '/' . $theme . '/widgets/' . $widgets['name'] . '/images/preview.jpg')) { $pagedata['widgetsLib']['list'][$key]['bimg'] = $theme_url . '/widgets/' . $widgets['name'] . '/images/preview.jpg'; } else { $pagedata['widgetsLib']['list'][$key]['bimg'] = $this->app->res_url . '/images/widgets/widget.jpg'; } } } } return view::make('site/admin/theme/widget/add_widgets_page_extend.html', $pagedata); }