当前位置: 首页>>代码示例>>PHP>>正文


PHP Module::init方法代码示例

本文整理汇总了PHP中Module::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::init方法的具体用法?PHP Module::init怎么用?PHP Module::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Module的用法示例。


在下文中一共展示了Module::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 function init($request)
 {
     parent::init($request);
     $ck = new Cookie(COOKIE_NAME_SESSION);
     $ck->delete();
     Request::redirectToModule('index');
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:7,代码来源:Logout.class.php

示例2: init

 public function init()
 {
     parent::init();
     Yii::app()->params['forum_max_crumb_length'] = 40;
     Yii::app()->params['forum_max_latest_reply_length'] = 30;
     Yii::app()->params['forum_pageSize'] = 20;
 }
开发者ID:aakbar24,项目名称:CollegeCorner_Ver_2.0,代码行数:7,代码来源:CommunityModule.php

示例3: run

 public static function run()
 {
     if (!Site::init(!empty($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : '')) {
         @header('HTTP/1.1 404 Not Found');
         exit;
     }
     $method = Core::getRequestMethod();
     if (!in_array($method, array('get', 'put', 'delete', 'post'))) {
         @header("HTTP/1.1 501 Not Implemented");
         exit;
     }
     $data = Core::getRequestData();
     if (empty($data[$method]) && !in_array($_SERVER['REQUEST_URI'], array($_SERVER['SCRIPT_NAME'], "", "/"))) {
         $data[$method] = $_SERVER['REQUEST_URI'];
     }
     $resource = Core::getResource($data, $method);
     $staticFolders = array('/cache/', '/static/', '/uploads/', '/vendor/');
     foreach ($staticFolders as $folder) {
         if (strncasecmp($resource, $folder, strlen($folder)) === 0) {
             @header('HTTP/1.1 404 Not Found');
             exit;
         }
     }
     App::set(App::parse($resource));
     Core::resource($resource);
     Module::init();
     $response = Response\Factory::get($resource, $method);
     if (empty($response)) {
         @header('HTTP/1.1 406 Not Acceptable');
         exit;
     }
     Request::init($response, $data);
     echo Request::run($resource, $method);
 }
开发者ID:pinahq,项目名称:framework,代码行数:34,代码来源:App.php

示例4: init

 /**
  * initialize module with request datas
  * 
  * @param object request
  * @return void
  */
 function init(&$request)
 {
     parent::init($request);
     $this->tpl->caching = 0;
     $this->tpl->mainTemplate = 'admin/structureAdmin.tpl';
     if (isset($this->site)) {
         $this->site->generateFiles();
     }
     // set mod to view because of specific elements in this case (period_selection.tpl)
     $this->tpl->assign('mod', 'admin');
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:17,代码来源:AdminModule.class.php

示例5: init

 public function init()
 {
     parent::init();
     //nested sets tree
     $tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_SITEMAP_TREE));
     //        //проверяем наличие корневого элемента
     //        if( $tree->checkRootNode( $nRootID ) )
     //        {
     //если только-что создан, создаем и в "недеревянной" таблице
     //            $this->db->execute('INSERT INTO '.TABLE_SITEMAP.' (node_id, keyword, menu_title, created)
     //                           VALUES('.$nRootID.', '.$this->db->str2sql('root').', '.$this->db->str2sql('Корневой раздел').', '.$this->db->getNOW().')');
     //        }
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:13,代码来源:sitemap.bl.class.php

示例6: init

 function init($request)
 {
     parent::init($request);
     // if tpl is not allocated (which is the case for graphs)
     // and if the login fails, there would be an error here trying to set a template with smarty not constructed
     // so we simply display an error message and exit
     if (!is_a($this->tpl, "TemplateEngine")) {
         print "Error while authentificate, and TemplateEngine not constructed. <br>Exiting...<br>";
         exit;
     }
     $this->tpl->caching = 0;
     $this->tpl->setMainTemplate("common/login.tpl");
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:13,代码来源:Login.class.php

示例7: init

 /**
  * initialize module with request datas
  * 
  * @param object request
  * @return void
  */
 function init(&$request, $o_tpl = null, $o_archive = null)
 {
     if (!is_a($o_tpl, "TemplateEngine")) {
         $o_tpl = null;
     }
     parent::init($request, $o_tpl);
     $date = $this->request->getDate();
     if (is_null($this->data)) {
         if (is_null($o_archive)) {
             $o_archive = DataModel::getArchive($this->site, $date, $this->request->getPeriod());
         }
         $this->data = new DataModel($o_archive, $this->request);
     }
     $d = new Date(getDateFromTimestamp(time()));
     if (($this->data->archive->date->get() == $d->get() || isset($this->disableCache)) && is_a($this->tpl, "TemplateEngine")) {
         printDebug("Current date asked is today's date, cache not activated<br>");
         $this->tpl->caching = 0;
     }
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:25,代码来源:ViewModule.class.php

示例8: init

 public function init()
 {
     parent::init();
     $this->items_images_path = bff::buildPath('items', 'images');
     $this->items_images_url = bff::buildUrl('items', 'images');
     # nested sets tree
     $tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_BBS_CATEGORIES));
     bff::i()->GetModule('Services');
     if (bff::$isFrontend) {
         return;
     }
     # !
     # проверяем наличие корневого элемента
     if ($tree->checkRootNode($nRootID)) {
         # если только-что создан, создаем категорию
         $this->db->execute('UPDATE ' . TABLE_BBS_CATEGORIES . ' 
                             SET title = ' . $this->db->str2sql('Корневой раздел') . ', created = ' . $this->db->getNOW() . '
                             WHERE id = ' . $nRootID);
     }
     $this->initDynprops();
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:21,代码来源:bbs.bl.class.php

示例9: init

 public function init()
 {
     parent::init();
     // custom initialization code goes here
 }
开发者ID:simplator,项目名称:medialib,代码行数:5,代码来源:ModuleAdmin.php

示例10: displayName

<?php

namespace ATPCore\Model;

class Module extends \ATP\ActiveRecord
{
    public function displayName()
    {
        return $this->name;
    }
    public function getActiveModules()
    {
        return $this->loadMultiple("is_active = 1");
    }
    public function getActiveModuleNames()
    {
        $names = array();
        foreach ($this->getActiveModules() as $module) {
            $names[] = $module->name;
        }
        return $names;
    }
}
Module::init();
开发者ID:daemonalchemist,项目名称:atp-core,代码行数:24,代码来源:Module.php

示例11: init

 public function init()
 {
     Yii::import('application.modules.formdesigner.models.*');
     parent::init();
 }
开发者ID:barricade86,项目名称:raui,代码行数:5,代码来源:FormeditorModule.php

示例12: init

    protected function init($page='', $args=array()) {
      
        parent::init();

        $moduleData = $this->getModuleData();
        $this->moduleName = $moduleData['title'];

        $this->setArgs($args);
        $this->setPage($page);
        $this->setTemplatePage($this->page, $this->id);

        $this->pagetype      = $GLOBALS['deviceClassifier']->getPagetype();
        $this->platform      = $GLOBALS['deviceClassifier']->getPlatform();
        $this->supportsCerts = $GLOBALS['deviceClassifier']->getSupportsCerts();

        $this->setAutoPhoneNumberDetection($GLOBALS['siteConfig']->getVar('AUTODETECT_PHONE_NUMBERS'));
        
        // Pull in fontsize
        if (isset($args['font'])) {
          $this->fontsize = $args['font'];
          setcookie('fontsize', $this->fontsize, time() + $this->getSiteVar('LAYOUT_COOKIE_LIFESPAN'), COOKIE_PATH);      
        
        } else if (isset($_COOKIE['fontsize'])) { 
          $this->fontsize = $_COOKIE['fontsize'];
        }

        switch ($this->pagetype) {
          case 'compliant':
            $this->imageExt = '.png';
            break;
            
          case 'touch':
          case 'basic':
            $this->imageExt = '.gif';
            break;
        }
    }
开发者ID:nicosiseng,项目名称:Kurogo-Mobile-Web,代码行数:37,代码来源:WebModule.php

示例13: init

 public function init()
 {
     parent::init();
     \Yii::configure($this, require __DIR__ . '/config.php');
 }
开发者ID:davidfang,项目名称:yii2-adminlte,代码行数:5,代码来源:SrbacModule.php

示例14: init

 function init()
 {
     global $MOD_TITLE, $MOD_GROUP, $MOD_VISIBLE, $MOD_SUBMENU;
     parent::init($MOD_TITLE, $MOD_GROUP, $MOD_VISIBLE);
     // получаем список лицевых счетов абонента
     $this->accounts = array();
     $this->urfa->call(-16469);
     $this->urfa->send();
     // получаем количество записей
     $count = $this->urfa->get_int();
     for ($i = 0; $i < $count; $i++) {
         $aid = $this->urfa->get_int();
         // номер лицевого счета
         // пропускаем два неинтересных нам параметра
         $this->urfa->get_double();
         // денег на счету
         $this->urfa->get_double();
         // ??
         // добавлем в списков лицевых счетов
         $this->accounts[$aid] = $aid;
     }
     $this->urfa->finish();
     if (isset($_REQUEST['Status'])) {
         $status = $_REQUEST['Status'];
     } else {
         $status = '';
     }
     if ($status == 'pay') {
         // получаем информацию о текущем пользователе
         $this->user = array();
         $this->urfa->call(-0x4052);
         $this->urfa->send();
         $this->user['id'] = $this->urfa->get_int();
         $this->user['login'] = $this->urfa->get_string();
         $this->user['basic_account'] = $this->urfa->get_int();
         $this->user['balance'] = roundDouble($this->urfa->get_double());
         $this->user['credit'] = roundDouble($this->urfa->get_double());
         $this->user['is_blocked'] = resolveBlockState($this->urfa->get_int());
         $this->user['create_date'] = getDateFromTimestamp($this->urfa->get_int());
         $this->user['last_change_date'] = getDateFromTimestamp($this->urfa->get_int());
         $this->user['who_create'] = resolveUserName($this->urfa->get_int());
         $this->user['who_change'] = resolveUserName($this->urfa->get_int());
         $this->user['is_juridical'] = $this->urfa->get_int();
         $this->user['full_name'] = $this->urfa->get_string();
         $accountId = intval($_REQUEST["AccountId"]);
         // проверка введенного значения суммы оплаты
         $subtotal_P = $_REQUEST['OutSum'];
         $subtotal_P = trim($subtotal_P);
         //убиарем лишние пробелы
         $subtotal_P = str_replace(',', '.', $subtotal_P);
         // заменяем запятые на точку
         $subtotal_P = floatval($subtotal_P);
         // пробуем преобразовать к числу
         $subtotal_P = round($subtotal_P, 2);
         // округляем до 2 знаков после запятой
         if ($subtotal_P != 0 && $subtotal_P >= 10 && $subtotal_P < 10000) {
             $client_ip = $_SERVER["REMOTE_ADDR"];
             echo $client_ip . '<br \\>' . "\n";
             $order_IDP = Uniteller::NewOrder($accountId, $subtotal_P, $client_ip);
             echo $order_IDP . '<br \\>' . "\n";
             //// Для отладки разрешаем переход на страницу оплаты только с определённого IP
             //if ((strpos($client_ip, '10.79.124.') == 0)
             //    or (strpos($client_ip, '10.78.252.') == 0)) {
             Uniteller::GoToPaymentPage($accountId, $order_IDP, $subtotal_P);
             //}
         } else {
             // при некорректно введенной сумме платежа возвращаемся на эту же страницу
             $url_return = $_SERVER['HTTP_REFERER'];
             header('Location: ' . $url_return);
         }
         exit;
     }
 }
开发者ID:shyokinmv,项目名称:utm_uniteller,代码行数:73,代码来源:48_uniteller.php

示例15: init

 /**
  * Initialize the request
  */
 protected function init($command = '', $args = array())
 {
     parent::init();
     $this->setArgs($args);
     $this->setCommand($command);
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:9,代码来源:ShellModule.php


注:本文中的Module::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。