Esempio n. 1
0
 function refresh()
 {
     $this->in_database = array();
     $type = 0;
     $app_list =& $this->system->loadModel('system/appmgr');
     $local_update = $app_list->getList('local_update');
     $this->_read_dir($type, PLUGIN_DIR);
     if (count($this->in_database[$type]) > 0) {
         $sql = 'delete from sdb_plugins where plugin_id not in(' . implode(',', $this->in_database[$type]) . ') and plugin_base="' . $type . '"';
     } else {
         $sql = 'delete from sdb_plugins where plugin_base="' . $type . '"';
     }
     if ($this->db->exec($sql)) {
         //实现app包本地化更新
         if (count($local_update) > 0) {
             foreach ($local_update as $key => $value) {
                 if ($value['local_update'] === true) {
                     $class_name = 'app_' . $value['plugin_ident'];
                     $class_name = new $class_name();
                     if (!class_exists($class_name)) {
                         require_once PLUGIN_DIR . $value['plugin_path'];
                     }
                     $appmgr = $this->system->loadModel('system/appmgr');
                     if (!class_exists('pageFactory')) {
                         require CORE_INCLUDE_DIR . '/pageFactory.php';
                     }
                     $pagefactory = new pageFactory();
                     if (method_exists($class_name, 'update')) {
                         if (method_exists($class_name, 'disable')) {
                             $class_name->disable();
                         }
                         $pagefactory->clear_all_cache();
                         $appmgr->disable($value['plugin_ident']);
                         $class_name->update();
                         if (method_exists($class_name, 'enable')) {
                             $class_name->enable();
                         }
                         $pagefactory->clear_all_cache();
                         $appmgr->enable($value['plugin_ident']);
                     }
                 }
             }
         }
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
 /**
  * pagefactory
  *
  * @access public
  * @return void
  */
 function shopPage()
 {
     parent::pageFactory();
     $this->setError();
     $this->header .= "<meta name=\"generator\" content=\"ShopEx " . $this->system->_app_version . "\" />\n";
     /*
     $theme_id=$this->system->getConf('system.ui.current_theme');
     $this->header.="<meta name=\"TemplateID\" content=\"".$theme_id."\">";
     $o_theme=$this->system->loadModel('system/template');
     
     $them_info=$o_theme->getThemeInfo($theme_id);
     $this->header.="<meta name=\"TemplateName\" content=\"".$them_info['name']."\">";
     */
     if (constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->system->controller =& $this;
     if (!$this->system->_base_link) {
         if (!$this->system->getConf('system.seo.emuStatic') || $this->system->getConf('system.seo.emuStatic') == 'false') {
             $this->system->_base_link .= APP_ROOT_PHP . '?';
         }
     }
     //review 读setting表
     $this->_env_vars = array('base_url' => $this->system->_base_link);
 }
Esempio n. 3
0
 function admin_ctl_taobao_goods()
 {
     parent::pageFactory();
     $this->system =& $GLOBALS['system'];
     $this->db =& $this->system->database();
     $appmgr = $this->system->loadModel('system/appmgr');
     $tb_api =& $appmgr->load('taobao_goods');
     $this->tb =& $tb_api;
     require 'mdl.taobao.php';
     $this->model = new mdl_taobao();
 }
Esempio n. 4
0
 public function oem_valid()
 {
     $loginToShopEx = $this->to_shopex_certificate("certi.login");
     if ("succ" != $loginToShopEx['res']) {
         return false;
     }
     $autype = $loginToShopEx['info']['service'][VERIFY_APP_ID]['cert_auth']['auth_str'];
     $auth = $loginToShopEx['info']['service'][VERIFY_APP_ID]['cert_auth']['auth_strname'];
     $this->system->setConf("certificate.auth_type", $autype);
     $this->system->setConf("certificate.auth_strname", $auth);
     $loginToShopEx['info']['node_id']($loginToShopEx['info']['node_id']);
     $loginToShopEx['info']['service'][VERIFY_APP_ID]['distribute']['status']("certificate.distribute", "open" == $loginToShopEx['info']['service'][VERIFY_APP_ID]['distribute']['status']);
     $etime = $loginToShopEx['info']['service'][VERIFY_APP_ID]['cert_auth']['service_time']['etime'];
     $btime = $loginToShopEx['info']['service'][VERIFY_APP_ID]['cert_auth']['service_time']['btime'];
     if (!$etime || !$btime) {
         return false;
     }
     $this->system->setConf("oem.service_etime", $etime);
     $this->system->setConf("oem.service_btime", $btime);
     if (!class_exists("pageFactory")) {
         require "pageFactory.php";
     }
     $pageFactory = new pageFactory();
     $pageFactory->clear_cache("shop:/common/header.html");
     return true;
 }
Esempio n. 5
0
 function &fetch($file, $display = false)
 {
     if (!strstr($this->template_dir, 'app')) {
         if (!$this->template_dir) {
             if (defined('CUSTOM_CORE_DIR')) {
                 if ($pos = strpos($file, '#')) {
                 } else {
                     $pos = strlen($file);
                 }
                 if (!file_exists(CUSTOM_CORE_DIR . '/' . __ADMIN__ . '/view/' . substr($file, 0, $pos))) {
                     $this->template_dir = CORE_DIR . '/admin/view/';
                 } else {
                     $this->template_dir = CUSTOM_CORE_DIR . '/admin/view/';
                 }
             }
         }
     }
     $content = parent::fetch($file);
     if ($this->_update_areas) {
         foreach ($this->_update_areas as $k => $area) {
             $content .= '<!-----' . $k . '-----' . $area . '-----' . $k . '----->';
         }
         $this->_update_areas = array();
     }
     $this->system->apply_modifiers($content, 'admin');
     if ($display) {
         echo $content;
     } else {
         return $content;
     }
 }
Esempio n. 6
0
<?php

include 'classes.php';
$requestedURI = preg_replace('/\\?(.+)?/', '', $_SERVER["REQUEST_URI"]);
$map = array('/' => 'index', '/test' => 'test');
if ($map[$requestedURI]) {
    $page = pageFactory::getPage($map[$requestedURI]);
    $page->render();
} else {
    header("HTTP/1.1 404 Not Found");
    echo '<html><head><title>404 Not found</title></head><body>';
    echo 'no page';
    echo '</body></html';
}
 function commodity_radar_default_modifiers()
 {
     parent::pageFactory();
     $this->system =& $GLOBALS['system'];
 }
 function taobao_goods_product_listener()
 {
     parent::pageFactory();
     $this->system =& $GLOBALS['system'];
     $this->db =& $this->system->database();
 }
Esempio n. 9
0
 function mdl_frontend()
 {
     parent::pagefactory();
     $this->_register_resource('systmpl', array(array($this, "_get_systmpl_template"), array($this, "_get_systmpl_timestamp")));
     $this->_register_resource("page", array(array(&$this, "_get_page_template"), array(&$this, "_get_page_timestamp")));
 }
Esempio n. 10
0
 function shopex_stat_modifiers()
 {
     parent::pageFactory();
     $this->system =& $GLOBALS['system'];
 }