当前位置: 首页>>代码示例>>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;未经允许,请勿转载。