當前位置: 首頁>>代碼示例>>PHP>>正文


PHP site::id方法代碼示例

本文整理匯總了PHP中site::id方法的典型用法代碼示例。如果您正苦於以下問題:PHP site::id方法的具體用法?PHP site::id怎麽用?PHP site::id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在site的用法示例。


在下文中一共展示了site::id方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Template loading and setup routine.
  */
 public function __construct()
 {
     parent::__construct();
     // checke request is ajax
     $this->ajax_request = request::is_ajax();
     // Load the template
     $this->template = new View($this->template);
     if ($this->auto_render == TRUE) {
         Event::add('system.post_controller', array($this, '_render'));
     }
     /**
      * 判斷用戶登錄情況
      */
     if (isset($_REQUEST['session_id'])) {
         $session = Session::instance($_REQUEST['session_id']);
         $manager = role::get_manager($_REQUEST['session_id']);
     } else {
         $session = Session::instance();
         $manager = role::get_manager();
     }
     /* 當前請求的URL */
     $current_url = urlencode(url::current(TRUE));
     //當前用戶管理的站點的ID
     $this->site_id = site::id();
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:28,代碼來源:kc_template.php

示例2: __construct

 /**
  * 構造方法
  */
 public function __construct()
 {
     parent::__construct();
     if ($this->is_ajax_request()) {
         $this->template = new View('layout/default_json');
     }
     $this->site_id = site::id();
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:11,代碼來源:sitemap.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $this->site_id = site::id();
     if ($this->site_id <= 0) {
         die(Kohana::lang('o_global.access_denied'));
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:8,代碼來源:update.php

示例4: __construct

 /**
  * 構造方法
  */
 public function __construct()
 {
     $package_name = substr(dirname(__FILE__), strlen(APPPATH . 'controllers/'));
     empty($package_name) && ($package_name = 'default');
     $this->package_name = $package_name;
     $this->class_name = strtolower(substr(__CLASS__, 0, strpos(__CLASS__, '_')));
     $this->phprpc_server = Kohana::config('phprpc.remote.statking.host');
     $this->site_ids = role::get_site_ids();
     $this->site_id = site::id();
     parent::__construct();
     if ($this->is_ajax_request() == TRUE) {
         $this->template = new View('layout/default_json');
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:17,代碼來源:fromsite.php

示例5:

?>
js/jquery.validate.js"></script>
<script type="text/javascript" src="<?php 
echo url::base();
?>
js/jq/plugins/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="<?php 
echo url::base();
?>
js/init_tiny_mce.js"></script>
<script type="text/javascript">
var global_site_id = <?php 
if (isset($messages['site_id'])) {
    echo $messages['site_id'];
} else {
    echo site::id();
}
?>
;
    $(document).ready(function(){
        $("#edit_form").validate({
            errorPlacement:function(error, element){
                if(element.attr("name") == "content"){
                    //alert(error);
                    error.appendTo( element.parent());
                }else{
                    error.insertAfter(element)
                }
            }
        });
		tinyMCE.execCommand('mceAddControl', true, 'content');
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:31,代碼來源:message_edit.php

示例6: set_order

 /**
  * 設定菜單的排序
  */
 public function set_order()
 {
     //初始化返回數組
     $return_struct = array('status' => 0, 'code' => 501, 'msg' => 'Not Implemented', 'content' => array());
     $request_data = $this->input->get();
     $id = isset($request_data['id']) ? $request_data['id'] : '';
     $order = isset($request_data['order']) ? $request_data['order'] : '';
     /* 驗證是否可以操作 */
     if (!role::verify('product_filter', site::id(), 0)) {
         $return_struct['msg'] = Kohana::lang('o_global.permission_enough');
         exit(json_encode($return_struct));
     }
     if (empty($id) || empty($order) && $order != 0) {
         $return_struct['msg'] = Kohana::lang('o_global.bad_request');
         exit(json_encode($return_struct));
     }
     if (!is_numeric($order) || $order < 0) {
         $return_struct['msg'] = Kohana::lang('o_global.position_rule');
         exit(json_encode($return_struct));
     }
     $aliasfilter_service = Alias_filterService::get_instance();
     $aliasfilter_service->set($id, array('order' => $order));
     $return_struct = array('status' => 1, 'code' => 200, 'msg' => Kohana::lang('o_global.position_success'), 'content' => array('order' => $order));
     exit(json_encode($return_struct));
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:28,代碼來源:aliasfilter.php

示例7: set_order

 /**
  * 設定菜單的排序
  */
 public function set_order()
 {
     //初始化返回數組
     $return_struct = array('status' => 0, 'code' => 501, 'msg' => 'Not Implemented', 'content' => array());
     $request_data = $this->input->get();
     $id = isset($request_data['id']) ? $request_data['id'] : '';
     $order = isset($request_data['order']) ? $request_data['order'] : '';
     /* 驗證是否可以操作 */
     if (!role::verify('inquiry_subject', site::id(), 0)) {
         $return_struct['msg'] = Kohana::lang('o_global.permission_enough');
         exit(json_encode($return_struct));
     }
     $validation = Validation::factory($request_data)->pre_filter('trim')->add_rules('id', 'required', 'digit')->add_rules('order', 'required', 'digit');
     if (!$validation->validate()) {
         $return_struct['msg'] = Kohana::lang('o_global.position_rule');
         exit(json_encode($return_struct));
     }
     if (empty($id) || empty($order) && $order != 0) {
         $return_struct['msg'] = Kohana::lang('o_global.bad_request');
         exit(json_encode($return_struct));
     }
     if (!is_numeric($order) || $order < 0) {
         $return_struct['msg'] = Kohana::lang('o_global.position_rule');
         exit(json_encode($return_struct));
     }
     $inquieysubject_service = InquirysubjectService::get_instance();
     $inquieysubject_service->set($id, array('position' => $order));
     $return_struct = array('status' => 1, 'code' => 200, 'msg' => Kohana::lang('o_global.position_success'), 'content' => array('order' => $order));
     exit(json_encode($return_struct));
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:33,代碼來源:inquirysubject.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->site_id = site::id();
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:5,代碼來源:newsletter.php

示例9: delete

 public function delete()
 {
     $return_struct = array('status' => 0, 'code' => 501, 'msg' => 'Not Implemented', 'content' => array());
     try {
         //* 初始化返回數據 */
         $return_data = array('assoc' => NULL, 'count' => 0);
         //* 收集請求數據 ==根據業務邏輯定製== */
         $request_data = $this->input->get();
         $site_ids = role::get_site_ids();
         if (empty($site_ids)) {
             throw new MyRuntimeException(Kohana::lang('o_global.access_denied'), 403);
         }
         $in_site_id = site::id();
         if (isset($request_data['site_id']) and $request_data['site_id'] === '0') {
             unset($request_data['site_id']);
         }
         if (isset($request_data['site_id']) and !in_array($request_data['site_id'], $site_ids)) {
             throw new MyRuntimeException(Kohana::lang('o_global.access_denied'), 403);
         }
         if ($in_site_id > 0) {
             $query_site_id = $in_site_id;
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.select_site'), 400);
         }
         $template_id = intval($request_data['template_id']);
         $template = Product_templateService::get_instance()->index(array('where' => array('id' => $template_id)));
         if (!empty($template)) {
             if ($template[0]['site_id'] == $query_site_id) {
                 ORM::factory('product_template')->where('id', $template_id)->delete_all();
             } else {
                 throw new MyRuntimeException('沒有權限刪除該商品模板!', 403);
             }
         } else {
             throw new MyRuntimeException('該模板不存在,或者已被刪除!', 403);
         }
         //* 補充&修改返回結構體 */
         //* 補充&修改返回結構體 ==根據業務邏輯定製== */
         $return_struct['status'] = 1;
         $return_struct['code'] = 200;
         $return_struct['msg'] = '商品模板已經成功刪除!';
         $return_struct['content'] = $return_data;
         $return_struct['action'] = array('type' => 'location', 'url' => !empty($request_data['listurl']) ? url::base() . $request_data['listurl'] : url::base() . $this->package_name . '/' . $this->class_name . '/' . 'index');
         //* 請求類型 */
         if ($this->is_ajax_request()) {
             // ajax 請求
             // json 輸出
             $this->template->content = $return_struct;
         } else {
             // html 輸出
             //* 模板輸出 */
             $this->template->return_struct = $return_struct;
             $content = new View('info');
             //* 變量綁定 */
             $this->template->title = Kohana::config('site.name');
             $this->template->content = $content;
             //* 請求結構數據綁定 */
             $this->template->content->request_data = $request_data;
             //* 返回結構體綁定 */
             $this->template->content->return_struct = $return_struct;
             //:: 當前應用專用數據
             $this->template->content->title = Kohana::config('site.name');
         }
         // end of request type determine
     } catch (MyRuntimeException $ex) {
         $return_struct['status'] = 0;
         $return_struct['code'] = $ex->getCode();
         $return_struct['msg'] = $ex->getMessage();
         //TODO 異常處理
         //throw $ex;
         if ($this->is_ajax_request()) {
             $this->template->content = $return_struct;
         } else {
             $this->template->return_struct = $return_struct;
             $content = new View('info');
             $this->template->content = $content;
             //* 請求結構數據綁定 */
             $this->template->content->request_data = $request_data;
             //* 返回結構體綁定 */
             $this->template->content->return_struct = $return_struct;
         }
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:82,代碼來源:pdttpl.php

示例10: select

 /**
  * 對網站聯盟訂單的查詢處理
  *
  */
 public function select()
 {
     $site_id_list = role::check('affiliate');
     $return_struct = array('status' => 0, 'code' => 501, 'msg' => 'Not Implemented', 'content' => array());
     try {
         //* 初始化返回數據 */
         $return_data = array('assoc' => NULL, 'count' => 0);
         //* 收集請求數據 ==根據業務邏輯定製== */
         $request_data = $this->input->get();
         $site_ids = role::get_site_ids();
         if (empty($site_ids)) {
             throw new MyRuntimeException(Kohana::lang('o_global.access_denied'), 403);
         }
         $in_site_id = site::id();
         if (isset($request_data['site_id']) and $request_data['site_id'] === '0') {
             unset($request_data['site_id']);
         }
         if (isset($request_data['site_id']) and !in_array($request_data['site_id'], $site_ids)) {
             throw new MyRuntimeException(Kohana::lang('o_global.access_denied'), 403);
         }
         if ($in_site_id > 0) {
             $query_site_id = $in_site_id;
         } else {
             $query_site_id = $site_ids;
             //throw new MyRuntimeException(Kohana::lang('o_global.select_site'), 400);
         }
         $site_name = Mysite::instance($this->site_id)->get('domain');
         //頁數
         $page = isset($request_data['page']) && intval($request_data['page']) >= 1 ? intval($request_data['page']) : 1;
         //聯盟id
         $affiliate_id = isset($request_data['affiliate_id']) && intval($request_data['affiliate_id']) >= 1 ? intval($request_data['affiliate_id']) : 0;
         //起始時間
         $time_f = isset($request_data['time_f']) ? $request_data['time_f'] : date('Y-m-d', time() - 86400 * 365 * 5);
         $time_f = $time_f == '' ? date('Y-m-d', time() - 86400 * 365 * 5) : $time_f;
         //結束時間
         $time_t = isset($request_data['time_t']) ? $request_data['time_t'] : date('Y-m-d');
         $time_t = $time_t == '' ? date('Y-m-d') : $time_t;
         //獲取聯盟的訂單
         $where = array('site_id' => $query_site_id, 'order_time >' => date('Y-m-d H:i:s', strtotime($time_f . ' 00:00:00')), 'order_time <' => date('Y-m-d H:i:s', strtotime($time_t . ' 23:59:59')));
         if ($affiliate_id > 0) {
             $where['affiliate_id'] = $affiliate_id;
         }
         $query_struct = array('where' => $where, 'limit' => array('page' => $page, 'per_page' => 20));
         $orders = Affiliate_orderService::get_instance()->index($query_struct);
         $orders_count = Affiliate_orderService::get_instance()->count($query_struct);
         $this->pagination = new Pagination(array('total_items' => $orders_count, 'items_per_page' => 20));
         $affiliates = AffiliateService::get_instance()->index(array('where' => array('mark' => 1)));
         for ($i = 0; $i < count($affiliates); $i++) {
             if ($affiliates[$i]['id'] == $affiliate_id) {
                 $affiliates[$i]['selected'] = 1;
             } else {
                 $affiliates[$i]['selected'] = 0;
             }
         }
         $content = new View($this->package_name . '/' . $this->class_name . '/' . __FUNCTION__);
         $this->template->content = $content;
         $this->template->content->site_name = $site_name;
         $this->template->content->orders = $orders;
         $this->template->content->pagination = $this->pagination;
         $this->template->content->time_f = $time_f;
         $this->template->content->time_t = $time_t;
         $this->template->content->affiliates = $affiliates;
     } catch (MyRuntimeException $ex) {
         $return_struct['status'] = 0;
         $return_struct['code'] = $ex->getCode();
         $return_struct['msg'] = $ex->getMessage();
         //TODO 異常處理
         //throw $ex;
         if ($this->is_ajax_request()) {
             $this->template->content = $return_struct;
         } else {
             $this->template->return_struct = $return_struct;
             $content = new View('info');
             $this->template->content = $content;
             //* 請求結構數據綁定 */
             $this->template->content->request_data = $request_data;
             //* 返回結構體綁定 */
             $this->template->content->return_struct = $return_struct;
         }
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:85,代碼來源:affiliate.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $this->site_id = site::id();
     role::check('site_scan', $this->site_id);
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:6,代碼來源:scan.php

示例12: check_exist_uri_name

 public function check_exist_uri_name()
 {
     $return_struct = array('status' => 0, 'code' => 501, 'msg' => 'Not Implemented', 'content' => array());
     try {
         //$profiler = new Profiler;
         //* 初始化返回數據 */
         $return_data = array();
         //* 收集請求數據 ==根據業務邏輯定製== */
         $request_data = $this->input->get();
         //* 實現功能後屏蔽此異常拋出 */
         //throw new MyRuntimeException('Not Implemented',501);
         //必須為ajax請求
         if (!$this->is_ajax_request()) {
             throw new MyRuntimeException(Kohana::lang('o_global.bad_request'), 404);
         }
         //* 權限驗證 */
         $site_id = site::id();
         if ($site_id == 0) {
             throw new MyRuntimeException(Kohana::lang('o_global.select_site'), 400);
         }
         if (!isset($request_data['uri_name']) || empty($request_data['uri_name'])) {
             throw new MyRuntimeException(Kohana::lang('o_global.input_error'), 404);
         }
         $category_service = CategoryService::get_instance();
         if (isset($request_data['category_id']) && is_numeric($request_data['category_id'])) {
             $category = $category_service->get($request_data['category_id']);
             //判斷站點
             if ($site_id != $category['site_id']) {
                 throw new MyRuntimeException(Kohana::lang('o_global.access_denied'), 404);
             }
             if (strtolower($category['uri_name']) == strtolower($request_data['uri_name'])) {
                 exit(Kohana::lang('o_global.true'));
             }
         }
         // 調用底層服務
         if ($category_service->check_exist_uri_name($site_id, $request_data['uri_name'])) {
             exit(Kohana::lang('o_global.false'));
         } else {
             exit(Kohana::lang('o_global.true'));
         }
     } catch (MyRuntimeException $ex) {
         $this->_ex($ex, $return_struct, $request_data);
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:44,代碼來源:category.php

示例13: delete

 /**
  * SEO信息刪除
  */
 public function delete($id)
 {
     //收集請求
     $seo_manages = Myseo_manage::instance($id)->get();
     $site_id = site::id();
     if ($site_id == 0) {
         remind::set('請首先進入所要操作的站點', request::referrer(), 'error');
     }
     if (!$seo_manages['id']) {
         remind::set('無效SEO信息,請重試', request::referrer(), 'error');
     }
     $site_id_list = role::check('seo_manage', 0, 0);
     // 權限驗證
     if (!in_array($seo_manages['site_id'], $site_id_list)) {
         remind::set('access denied', request::referrer(), 'error');
     }
     if (Myseo_manage::instance()->delete($id)) {
         Myseo_manage::instance()->update_seo_manage_by_site_id($site_id);
         remind::set('刪除 信息成功', request::referrer(), 'success');
     } else {
         remind::set('刪除 信息失敗', request::referrer(), 'error');
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:26,代碼來源:seo_manage.php

示例14: request_site

 /**
  * 請求站點處理
  *
  * 2010-04-21
  */
 public static function request_site(&$request_struct_current, &$request_data, $site_id_list)
 {
     if (isset($request_data['site_id']) && intval($request_data['site_id']) > 0) {
         $request_struct_current['where']['site_id'] = intval($request_data['site_id']);
         $request_data['site_id'] = $request_struct_current['where']['site_id'];
     } else {
         $site_id = site::id();
         if ($site_id > 0) {
             $request_struct_current['where']['site_id'] = $site_id;
             $request_data['site_id'] = $site_id;
         } else {
             $request_struct_current['where']['site_id'] = $site_id_list;
             $request_data['site_id'] = -1;
         }
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:21,代碼來源:controller_tool.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     // DISABLE MAGIC QUOTES
     if (function_exists('set_magic_quotes_runtime')) {
         @set_magic_quotes_runtime(false);
     }
     // Charset
     $this->charset = Kohana::config('kc.charset');
     // INPUT INIT
     $this->get = $this->input->get();
     $this->post = $this->input->post();
     $this->cookie = $this->input->cookie();
     // LINKING UPLOADED FILE
     if (count($_FILES)) {
         $this->file =& $_FILES[key($_FILES)];
     }
     // SETTING UP SESSION
     $session_life_time = Kohana::config('kc._sessionLifetime');
     $session_dir = Kohana::config('kc._sessionDir');
     $session_domain = Kohana::config('kc._sessionDomain');
     if ($session_life_time) {
         ini_set('session.gc_maxlifetime', $session_life_time * 60);
     }
     if ($session_dir) {
         ini_set('session.save_path', $session_dir);
     }
     if ($session_domain) {
         ini_set('session.cookie_domain', $session_domain);
     }
     // RELOAD DEFAULT CONFIGURATION
     $this->config = Kohana::config('kc');
     // LOAD SESSION CONFIGURATION IF EXISTS
     if (isset($this->config['_sessionVar']) && is_array($this->config['_sessionVar'])) {
         foreach ($this->config['_sessionVar'] as $key => $val) {
             if (substr($key, 0, 1) != "_" && isset($this->config[$key])) {
                 $this->config[$key] = $val;
             }
         }
         if (!isset($this->config['_sessionVar']['self'])) {
             $this->config['_sessionVar']['self'] = array();
         }
         $this->session =& $this->config['_sessionVar']['self'];
     } else {
         $this->session =& $_SESSION;
     }
     // GET TYPE DIRECTORY
     $this->types =& $this->config['types'];
     $firstType = array_keys($this->types);
     $firstType = $firstType[0];
     $this->type = isset($this->get['type']) && isset($this->types[$this->get['type']]) ? $this->get['type'] : $firstType;
     // LOAD DIRECTORY TYPE SPECIFIC CONFIGURATION IF EXISTS
     if (is_array($this->types[$this->type])) {
         foreach ($this->types[$this->type] as $key => $val) {
             if (in_array($key, $this->typeSettings)) {
                 $this->config[$key] = $val;
             }
         }
         $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : "";
     }
     // COOKIES INIT
     if (isset($this->config['cookieDomain']) and !strlen($this->config['cookieDomain'])) {
         $this->config['cookieDomain'] = $_SERVER['HTTP_HOST'];
     }
     if (isset($this->config['cookiePath']) and !strlen($this->config['cookiePath'])) {
         $this->config['cookiePath'] = "/";
     }
     // HOST APPLICATIONS INIT
     if (isset($this->get['CKEditorFuncNum'])) {
         $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum'];
     }
     if (isset($this->get['opener']) && strtolower($this->get['opener']) == "tinymce" && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath'])) {
         $this->opener['TinyMCE'] = true;
     }
     // 通過參數傳遞過來的site_id 優先級高
     $site_id = isset($this->get['site_id']) ? $this->get['site_id'] : 0;
     // 通過全局方法獲得的site_id
     $site_id2 = site::id();
     $this->site_id = $site_id > 0 ? $site_id : $site_id2;
     if ($this->site_id == 0) {
         $this->back_msg(Kohana::lang('o_global.select_site'));
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:83,代碼來源:kc_uploader.php


注:本文中的site::id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。