コード例 #1
0
ファイル: template.php プロジェクト: boylzj/omguitar
 /**
  * 编辑专题首页模板
  */
 public function init()
 {
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $specialid = isset($_GET['specialid']) && intval($_GET['specialid']) ? intval($_GET['specialid']) : showmessage(L('illegal_action'), HTTP_REFERER);
     if (!$specialid) {
         showmessage(L('illegal_action'), HTTP_REFERER);
     }
     $info = $this->db->get_one(array('id' => $specialid, 'disabled' => '0', 'siteid' => $this->get_siteid()));
     if (!$info['id']) {
         showmessage(L('illegal_parameters'), HTTP_REFERER);
     }
     $id = $specialid;
     if ($info['css']) {
         $css_param = unserialize($info['css']);
     }
     if (!$info['ispage']) {
         $type_db = pc_base::load_model('type_model');
         $types = $type_db->select(array('module' => 'special', 'parentid' => $id), '*', '', '`listorder` ASC, `typeid` ASC');
     }
     extract($info);
     $css = get_css($css_param);
     $template = $info['index_template'] ? $info['index_template'] : 'index';
     pc_base::load_app_func('global', 'template');
     ob_start();
     include template('special', $template);
     $html = ob_get_contents();
     ob_clean();
     $html = visualization($html, 'default', 'test', 'block.html');
     include $this->admin_tpl('template_edit');
 }
コード例 #2
0
ファイル: TemplateController.php プロジェクト: hubs/yuncms
 /**
  * 编辑专题首页模板
  */
 public function init()
 {
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $specialid = isset($_GET['specialid']) && intval($_GET['specialid']) ? intval($_GET['specialid']) : showmessage(L('illegal_action'), HTTP_REFERER);
     if (!$specialid) {
         showmessage(L('illegal_action'), HTTP_REFERER);
     }
     $info = $this->db->where(array('id' => $specialid, 'disabled' => '0'))->find();
     if (!$info['id']) {
         showmessage(L('illegal_parameters'), HTTP_REFERER);
     }
     $id = $specialid;
     if ($info['css']) {
         $css_param = unserialize($info['css']);
     }
     if (!$info['ispage']) {
         $type_db = Loader::model('type_model');
         $types = $type_db->where(array('application' => 'special', 'parentid' => $id))->order('listorder ASC, typeid ASC')->select();
     }
     extract($info);
     $css = get_css($css_param);
     $template = $info['index_template'] ? $info['index_template'] : 'index';
     Loader::helper('template:global');
     ob_start();
     include template('special', $template);
     $html = ob_get_contents();
     ob_clean();
     $html = visualization($html, 'default', 'test', 'block.html');
     include $this->view('template_edit');
 }
コード例 #3
0
ファイル: file.php プロジェクト: shenhua4286/gxw
 public function visualization()
 {
     $dir = isset($_GET['dir']) && trim($_GET['dir']) ? str_replace(array('..\\', '../', './', '.\\'), '', urldecode(trim($_GET['dir']))) : showmessage(L('illegal_operation'), HTTP_REFERER);
     $file = isset($_GET['file']) && trim($_GET['file']) ? trim($_GET['file']) : showmessage(L('illegal_operation'), HTTP_REFERER);
     ob_start();
     //include $this->admin_tpl('base_tool');
     include template($dir, basename($file, '.html'), $this->style);
     $html = ob_get_contents();
     ob_clean();
     pc_base::load_app_func('global');
     $html = visualization($html, $this->style, $dir, $file);
     echo $html;
 }
コード例 #4
0
ファイル: block_admin.php プロジェクト: zhouzhouxs/Progect
 public function public_visualization()
 {
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $catid = isset($_GET['catid']) && intval($_GET['catid']) ? intval($_GET['catid']) : 0;
     $type = isset($_GET['type']) && trim($_GET['type']) ? trim($_GET['type']) : 'list';
     $siteid = $GLOBALS['siteid'] = $this->get_siteid();
     if (!empty($catid)) {
         $CATEGORY = getcache('category_content_' . $siteid, 'commons');
         if (!isset($CATEGORY[$catid])) {
             showmessage(L('notfound'));
         }
         $cat = $CATEGORY[$catid];
         $cat['setting'] = string2array($cat['setting']);
     }
     if ($cat['type'] == 2) {
         showmessage(L('link_visualization_not_exists'));
     }
     $file = '';
     $style = $cat['setting']['template_list'];
     switch ($type) {
         case 'category':
             if ($cat['type'] == 1) {
                 $file = $cat['setting']['page_template'];
             } else {
                 $file = $cat['setting']['category_template'];
             }
             break;
         case 'list':
             if ($cat['type'] == 1) {
                 $file = $cat['setting']['page_template'];
             } else {
                 $file = $cat['setting']['list_template'];
             }
             break;
         case 'show':
             $file = $cat['setting']['show_template'];
             break;
         case 'index':
             $sites = pc_base::load_app_class('sites', 'admin');
             $sites_info = $sites->get_by_id($this->siteid);
             $file = 'index';
             $style = $sites_info['default_style'];
             break;
         case 'page':
             $file = $cat['setting']['page_template'];
             break;
     }
     pc_base::load_app_func('global', 'template');
     ob_start();
     include template('content', $file, $style);
     $html = ob_get_contents();
     ob_clean();
     echo visualization($html, $style, 'content', $file . '.html');
 }
コード例 #5
0
ファイル: file.php プロジェクト: zhouzhouxs/Progect
 public function visualization()
 {
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $dir = isset($_GET['dir']) && trim($_GET['dir']) ? str_replace(array('..\\', '../', './', '.\\'), '', urldecode(trim($_GET['dir']))) : showmessage(L('illegal_operation'), HTTP_REFERER);
     $file = isset($_GET['file']) && trim($_GET['file']) ? trim($_GET['file']) : showmessage(L('illegal_operation'), HTTP_REFERER);
     ob_start();
     include template($dir, basename($file, '.html'), $this->style);
     $html = ob_get_contents();
     ob_clean();
     pc_base::load_app_func('global');
     $html = visualization($html, $this->style, $dir, $file);
     echo $html;
 }
コード例 #6
0
ファイル: AdminController.php プロジェクト: hubs/yuncms
 /**
  * 可视化碎片
  */
 public function public_visualization()
 {
     error_reporting(E_ERROR);
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $catid = isset($_GET['catid']) && intval($_GET['catid']) ? intval($_GET['catid']) : 0;
     $type = isset($_GET['type']) && trim($_GET['type']) ? trim($_GET['type']) : 'list';
     if (!empty($catid)) {
         $CATEGORY = S('common/category_content');
         if (!isset($CATEGORY[$catid])) {
             showmessage(L('notfound'));
         }
         $cat = $CATEGORY[$catid];
         $cat['setting'] = string2array($cat['setting']);
     }
     if ($cat['type'] == 2) {
         showmessage(L('link_visualization_not_exists'));
     }
     $file = '';
     $style = $cat['setting']['template_list'];
     switch ($type) {
         case 'category':
             if ($cat['type'] == 1) {
                 $file = $cat['setting']['page_template'];
             } else {
                 $file = $cat['setting']['category_template'];
             }
             break;
         case 'list':
             if ($cat['type'] == 1) {
                 $file = $cat['setting']['page_template'];
             } else {
                 $file = $cat['setting']['list_template'];
             }
             break;
         case 'show':
             $file = $cat['setting']['show_template'];
             break;
         case 'index':
             $file = 'index';
             $style = C('template', 'name');
             break;
         case 'page':
             $file = $cat['setting']['page_template'];
             break;
     }
     Loader::helper('template:global');
     ob_start();
     include template('content', $file, $style);
     $html = ob_get_contents();
     ob_clean();
     echo visualization($html, $style, 'content', $file . '.html');
 }