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


PHP Block::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param string $key Key string
  */
 public function __construct($key = null)
 {
     $this->cipherMethod = 'aes-128-cbc';
     $this->keySize = 16;
     $this->type = self::AES128_CBC;
     parent::__construct($key);
 }
開發者ID:komex,項目名稱:XmlSecurity,代碼行數:12,代碼來源:Aes128Cbc.php

示例2: __construct

 /**
  * @param string
  * @param array
  * @param int
  * @return void
  */
 public function __construct($name, array $args, $line)
 {
     parent::__construct();
     $this->name = $name;
     $this->args = $args;
     $this->line = $line;
 }
開發者ID:enumag,項目名稱:ivory,代碼行數:13,代碼來源:Mixin.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param string $key Key string
  */
 public function __construct($key = null)
 {
     $this->cipherMethod = 'aes-256-cbc';
     $this->keySize = 32;
     $this->type = self::AES256_CBC;
     parent::__construct($key);
 }
開發者ID:komex,項目名稱:XmlSecurity,代碼行數:12,代碼來源:Aes256Cbc.php

示例4: __construct

 /**
  * Creates a new Layout
  * @param string $html Sub content
  */
 public function __construct($html = '')
 {
     parent::__construct('layout', $html);
     $this->loadSession();
     $this->addMicrodata();
     $this->loadIdioms();
 }
開發者ID:taviroquai,項目名稱:bootwiki,代碼行數:11,代碼來源:Layout.php

示例5: array

 function __construct($block_id)
 {
     parent::__construct($block_id);
     global $site_settings;
     //$this->cal['day_names'] = array( 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday' ); // these names could be set to a different language or used as abbreviated names, etc.
     $this->cal['day_names'] = $site_settings['day_names'];
     $this->cal['week_start'] = 7;
     // from what day of the week to start the week
     $this->cal['wkh'] = array();
     // holds days of the week starting from selected week_start
     $this->cal['wks'] = array();
     // holds matrix for calendar in the form of $this->cal['wks'][index = <YY-MM-01>][j = <week number>][i = <day number placeholder>] = day of month, i.e. 23.
     $this->cal['hours_monthly'] = array();
     // holds total number of scheduled hours for each month in the format of: $this->cal['hours_monthly'][<category>][index = <YY-MM-01>] = hours
     $this->cal['hours_daily'] = array();
     // same as above but has sum of scheduled hours for all members for each day
     //$this->cal['nav_links'] = array(); // holds html code for navigation links around the calendar. Currently <a href="" class="prev/next"></a>. This array is first referenced by 'index' for each calendar month, then contains 'prev' and 'next' links, i.e. $this->cal['nav_links'][$inbox]=>array( 'prev' => <html>, 'next' => <html> )
     $this->cal['start_ts'] = 0;
     // timestamps for the start and end of the calendar array
     $this->cal['end_ts'] = 0;
     $this->cal['members'] = array();
     // holds all members that have events in the given calendar span in the format of: $this->cal['members'][<category>][<group>]['f.l'][<account_no>] = <first_name.last_name>; $this->cal['members'][<category>][<group>]['l.f'][<account_no>] = <last_name.first_name>
     if (isset($_GET['city'])) {
         $this->city = $_GET['city'];
     } else {
         $this->city = $_SESSION['user']['city'];
     }
     /*
      * create calendars and corresponding next and prev nav_links
      */
     $n = 3 + 6;
     // number of months back and forward from the current month
     $year = date('Y');
     $start_mo = date('n') - 3;
     if ($start_mo <= 0) {
         $start_mo += 12;
         $year -= 1;
     }
     for ($month = $start_mo, $i = 0; $i < $n; $month++, $i++) {
         if ($month > 12) {
             $month = $month - 12;
             $year++;
         }
         $index = sprintf('%04s-%02s-01', $year, $month);
         if (0 == $i) {
             $this->cal['start_ts'] = strtotime($index);
             // needed to determine boundaries of event cycles
             $week = 0;
             // keep track of the number of the week within entire calendar sequence stored in $this->cal['wks']. Needed for javascript slide display in weekly view
         }
         $this->create_calendar($month, $year, $week);
         $week += count($this->cal['wks'][$index]);
         $this->cal['end_ts'] = strtotime($index) + date('t', strtotime($index)) * 3600 * 24;
         // date( 't' ) number of days in a given month
         $this->cal['hours_monthly'][$site_settings['cats'][0]][$index] = 0;
         // initialize for iteration of the events table for figuring out number of hours scheduled for the month
         $this->cal['hours_monthly'][$site_settings['cats'][1]][$index] = 0;
         // initialize for iteration of the events table for figuring out number of hours scheduled for the month
     }
 }
開發者ID:mgwebgroup,項目名稱:crew_scheduling,代碼行數:60,代碼來源:Calendar_drv.php

示例6: __construct

 protected function __construct(Page $parent, $nextPage, $refreshEnabled = false, $dataRequiredFromPage = "")
 {
     parent::__construct($parent);
     $this->nextPage = $nextPage;
     $this->refreshEnabled = $refreshEnabled;
     $this->dataRequiredFromPage = $dataRequiredFromPage;
 }
開發者ID:alican,項目名稱:HalloPizza,代碼行數:7,代碼來源:Form.php

示例7: __construct

 public function __construct($p_settings)
 {
     Assert::type(__METHOD__, 'is_array($p_settings)', is_array($p_settings));
     parent::__construct($p_settings);
     $this->m_blocks = array();
     $this->state = -1;
 }
開發者ID:4xi0m,項目名稱:ecofood,代碼行數:7,代碼來源:Layout.class.php

示例8: __construct

 /**
  * Constructor.
  *
  * @param string $key Key string
  */
 public function __construct($key = null)
 {
     $this->cipherMethod = 'des-ede3-cbc';
     $this->keySize = 24;
     $this->type = self::TRIPLEDES_CBC;
     parent::__construct($key);
 }
開發者ID:komex,項目名稱:XmlSecurity,代碼行數:12,代碼來源:TripleDesCbc.php

示例9: array

 function __construct()
 {
     $block_options = array('name' => __('Carousel', 'oblivion'), 'size' => 'span12');
     //create the widget
     parent::__construct('Carousel_Block', $block_options);
     //add ajax functions
     add_action('wp_ajax_block_item_add_new', array($this, 'add_item'));
 }
開發者ID:CamionCiterne,項目名稱:wordpress_fbpc,代碼行數:8,代碼來源:carousel-block.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     DB::connect();
     if (isset($_SESSION['userid'])) {
         $this->setUser();
     }
 }
開發者ID:abhipil,項目名稱:hoods,代碼行數:8,代碼來源:User.class.php

示例11: array

 function __construct($title, $description = NULL, $items = NULL, $help_text = NULL, $hidden = FALSE)
 {
     parent::__construct('sidebar_item');
     if (is_null($items)) {
         $items = array();
     }
     $this->set_vars(compact('title', 'description', 'items', 'help_text'));
     $this->hidden = $hidden;
 }
開發者ID:bufvc,項目名稱:bufvc-potnia-framework,代碼行數:9,代碼來源:Block.class.php

示例12: __construct

 public function __construct($p_model, $p_view, $p_settings)
 {
     Assert::type(__METHOD__, '$p_model instanceof Model || is_null($p_model)', $p_model instanceof Model || is_null($p_model));
     Assert::type(__METHOD__, '$p_view instanceof View || is_null($p_view)', $p_view instanceof View || is_null($p_view));
     parent::__construct($p_settings);
     $this->m_model = $p_model;
     $this->m_view = $p_view;
     $this->outputs = array();
 }
開發者ID:4xi0m,項目名稱:ecofood,代碼行數:9,代碼來源:Module.class.php

示例13: __construct

 public function __construct($texto, $template = null)
 {
     //echo 'construtct Texto';
     $this->templateHolder = $template;
     if ($template != null) {
         parent::__construct($template);
     }
     $this->pTexto = $texto;
 }
開發者ID:eriveltonguedes,項目名稱:atlas_ivs,代碼行數:9,代碼來源:Texto.class.php

示例14: array

 function __construct($block_id)
 {
     $this->messages = array(0 => '<div class="notif success"><strong>Success :</strong> User information updated. <a href="#" class="close"></a></div>', 1 => '<div class="notif error"><strong>Error :</strong> Could not update user information. Please contact your system administrator. <a href="#" class="close"></a></div>', 2 => '<div class="notif success"><strong>Success :</strong> Schedule information updated. <a href="#" class="close"></a></div>', 3 => '<div class="notif error"><strong>Error :</strong> Could not update schedule information. Please contact your system administrator. <a href="#" class="close"></a></div>', 4 => '<div class="notif info"><strong>Information :</strong> New scheduled shift added. Check days of week, select time and click \'Submit\'.<a href="#" class="close"></a></div>', 5 => '<div class="notif error"><strong>Error :</strong> Could not add new shift information. Please contact your system administrator. <a href="#" class="close"></a></div>', 6 => '<div class="notif error"><strong>Error :</strong> Could not delete existing shift. Please contact your system administrator. <a href="#" class="close"></a></div>', 7 => '<div class="notif success"><strong>Success :</strong> Shift deleted. <a href="#" class="close"></a></div>', 8 => '<div class="notif error"><strong>Error :</strong> Could not add user to the database. Please try again later. <a href="#" class="close"></a></div>', 9 => '<div class="notif success"><strong>Success :</strong> New user added. You can now add work and off time shifts or click Back to go back to the calendar view. <a href="#" class="close"></a></div>', 10 => '<div class="notif error"><strong>Error :</strong> User already exists. <a href="#" class="close"></a></div>', 11 => '<div class="notif error"><strong>Error :</strong> Email address already exists. Please provide unique email address. <a href="#" class="close"></a></div>', 12 => '<div class="notif error"><strong>Error :</strong> You are trying to change existing user\'s name to the one that is already registered. You can use an alias or a middle name to make users unique. <a href="#" class="close"></a></div>', 13 => '<div class="notif success"><strong>Success :</strong> Updated user information and password. <a href="#" class="close"></a></div>');
     parent::__construct($block_id);
     //$this->cache_allowed = FALSE; // This block relies heavily on db for all of its values. Disallow caching of this block (and subsequently entire view) because we want it to be reconstructed every time in order to get its valued filled from db.
     global $errors, $query, $site_settings;
     // $errors holds error messages for the entire site, $this->errors error messages for this block
     $this->errors['update_user_info'] = array('first_name' => '&nbsp;', 'last_name' => '&nbsp;', 'middle_name' => '&nbsp;', 'email_addr' => '&nbsp;', 'password' => '&nbsp;', 'phone_a' => '&nbsp;', 'city' => '&nbsp;', 'duplicate' => '&nbsp;');
     // holds error messages for the form fields
     for ($i = 0; $i <= 59; $i += $site_settings['formats']['min_round']) {
         $this->minutes[] = (int) ceil($i / $site_settings['formats']['min_round']) * $site_settings['formats']['min_round'];
     }
     try {
         if ('user_edit' == $_SESSION['user']['view']) {
             if (isset($_GET['user'])) {
                 //var_dump( $_GET ); exit();
                 /* get user's info and associated content ids*/
                 $query[17]->bindParam(':account_no', $_GET['user'], PDO::PARAM_STR);
                 $query[17]->execute();
                 if (!($this->user = $query[17]->fetch(PDO::FETCH_ASSOC))) {
                     throw new CustomException($errors['24']);
                 }
                 $this->x['user_groups_system'] = json_decode($this->user['user_groups_system']);
                 /* get user's cycles. Users cycles can only be mentioned once per category, i.e. for "work", would be only one line, with all the cycles collected into one json string. In this way, any user may have max 2 lines in the content_a table, one for each category: "work", "offtime" */
                 if ($this->x['content_a_ids'] = json_decode($this->user['content_a_ids'])) {
                     foreach ($this->x['content_a_ids'] as $id) {
                         $query[18]->bindParam(':id', $id, PDO::PARAM_INT);
                         $query[18]->execute();
                         if (!($result[18] = $query[18]->fetch(PDO::FETCH_ASSOC))) {
                             throw new CustomException($errors['26']);
                         }
                         $this->x['content_cats'] = json_decode($result[18]['cont_categories']);
                         $cat = $this->x['content_cats'][0];
                         // work with only the first category mentioned in the json string for cont_categories
                         $this->content[$cat][$id] = json_decode($result[18]['content']);
                     }
                 }
             } elseif ('user_add' == $_GET['action']) {
                 $this->user = array('first_name' => NULL, 'last_name' => NULL, 'middle_name' => NULL, 'alias' => NULL, 'city' => 'phoenix', 'email_addr' => NULL, 'phone_a' => NULL, 'user_groups_system' => '["driver"]', 'content_a_ids' => NULL, 'account_no' => NULL);
                 //echo "got into the user_add branch\n";
                 $this->x['user_groups_system'] = array($_GET['group0']);
                 $this->x['content_a_ids'] = NULL;
             } else {
                 //reset_user();
                 //header( "Location:{$this->form_proc}" );
                 throw new CustomException($errors['24']);
             }
         } else {
             //reset_user();
             //header( "Location:{$this->form_proc}" );
             throw new CustomException(sprintf($errors['12'], $_SESSION['user']['view'], $_SESSION['user']['user_group']));
         }
     } catch (CustomException $e) {
         echo $e;
         exit;
     }
 }
開發者ID:mgwebgroup,項目名稱:crew_scheduling,代碼行數:57,代碼來源:UserEdit.php

示例15: array

 function __construct($block_id)
 {
     $this->messages = array(0 => '<div class="notif success"><strong>Success :</strong> User information updated. <a href="#" class="close"></a></div>', 1 => '<div class="notif error"><strong>Error :</strong> Could not update user information. Please contact your system administrator. <a href="#" class="close"></a></div>', 2 => '<div class="notif success"><strong>Success :</strong> Schedule information updated. <a href="#" class="close"></a></div>', 3 => '<div class="notif error"><strong>Error :</strong> Could not update schedule information. Please contact your system administrator. <a href="#" class="close"></a></div>', 4 => '<div class="notif info"><strong>Information :</strong> New scheduled shift added. Check days of week, select time and click \'Submit\'.<a href="#" class="close"></a></div>', 5 => '<div class="notif error"><strong>Error :</strong> Could not add new shift information. Please contact your system administrator. <a href="#" class="close"></a></div>', 6 => '<div class="notif error"><strong>Error :</strong> Could not delete existing shift. Please contact your system administrator. <a href="#" class="close"></a></div>', 7 => '<div class="notif success"><strong>Success :</strong> Shift deleted. <a href="#" class="close"></a></div>', 8 => '<div class="notif error"><strong>Error :</strong> Could not add user to the database. Please try again later. <a href="#" class="close"></a></div>', 9 => '<div class="notif success"><strong>Success :</strong> New user added. You can now add work and off time shifts or click Back to go back to the calendar view. <a href="#" class="close"></a></div>', 10 => '<div class="notif error"><strong>Error :</strong> User already exists. <a href="#" class="close"></a></div>', 11 => '<div class="notif error"><strong>Error :</strong> Email address already exists. Please provide unique email address. <a href="#" class="close"></a></div>', 12 => '<div class="notif error"><strong>Error :</strong> You are trying to change existing user\'s name to the one that is already registered. You can use an alias or a middle name to make users unique. <a href="#" class="close"></a></div>', 13 => '<div class="notif success"><strong>Success :</strong> Updated user information and password. <a href="#" class="close"></a></div>');
     parent::__construct($block_id);
     global $errors, $query, $site_settings;
     // $errors holds error messages for the entire site, $this->errors error messages for this block
     $this->errors['update_user_info'] = array('first_name' => '&nbsp;', 'last_name' => '&nbsp;', 'middle_name' => '&nbsp;', 'email_addr' => '&nbsp;', 'password' => '&nbsp;', 'phone_a' => '&nbsp;', 'city' => '&nbsp;', 'duplicate' => '&nbsp;');
     // holds error messages for the form fields
     for ($i = 0; $i <= 59; $i += $site_settings['formats']['min_round']) {
         $this->minutes[] = (int) ceil($i / $site_settings['formats']['min_round']) * $site_settings['formats']['min_round'];
     }
     try {
         $query[17]->bindParam(':account_no', $_SESSION['user']['account_no'], PDO::PARAM_STR);
         $query[17]->execute();
         if (!($this->user = $query[17]->fetch(PDO::FETCH_ASSOC))) {
             throw new CustomException($errors['24']);
         }
         $this->x['user_groups_system'] = json_decode($this->user['user_groups_system']);
         if ($this->x['content_a_ids'] = json_decode($this->user['content_a_ids'])) {
             foreach ($this->x['content_a_ids'] as $id) {
                 $query[18]->bindParam(':id', $id, PDO::PARAM_INT);
                 $query[18]->execute();
                 if (!($result[18] = $query[18]->fetch(PDO::FETCH_ASSOC))) {
                     throw new CustomException($errors['26']);
                 }
                 $this->x['content_cats'] = json_decode($result[18]['cont_categories']);
                 $cat = $this->x['content_cats'][0];
                 // work with only the first category mentioned in the json string for cont_categories
                 $this->content[$cat][$id] = json_decode($result[18]['content']);
             }
         }
     } catch (CustomException $e) {
         echo $e;
         exit;
     }
 }
開發者ID:mgwebgroup,項目名稱:crew_scheduling,代碼行數:36,代碼來源:UserEdit_drv.php


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