Пример #1
0
 public function __construct(array $params = null)
 {
     global $CFG;
     $params_array = array();
     // Grab the main link parameter
     // the url portion for the link
     $link_url = !empty($params['linkurl']) ? $params['linkurl'] : '';
     // the comma separated list of parameters we will look for
     $link_params = !empty($params['linkparams']) ? $params['linkparams'] : '';
     // Check to see if URI needs to be prepended
     if (substr($link_url, 0, 7) != 'http://' && substr($link_url, 0, 8) != 'https://') {
         $link_url = $CFG->wwwroot . '/' . $link_url;
     }
     $link_params_array = strlen($link_params) > 0 ? explode(',', $link_params) : array();
     // Append specified params to the link URL
     if (!empty($link_params_array)) {
         foreach ($link_params_array as $link_param) {
             $param_value = $params[$link_param];
             if (substr($param_value, 0, 1) == '=') {
                 list($junk, $rep_var) = explode('=', $param_value);
                 $param_value = isset($params[$rep_var]) ? $params[$rep_var] : $param_value;
             }
             $params_array[$link_param] = urlencode($param_value);
         }
     }
     parent::__construct($params_array);
     //set up the url and parameters on the current page object
     $this->set_url($link_url, $params_array);
 }
Пример #2
0
 public function __construct($params = null)
 {
     parent::__construct($params);
     $this->section = $this->get_parent_page()->section;
 }
Пример #3
0
 function __construct(array $params = null)
 {
     $this->params = $this->_get_page_params();
     parent::__construct($params);
 }
Пример #4
0
 function __construct(array $params = null)
 {
     parent::__construct($params);
 }
Пример #5
0
 function __construct(array $params = null)
 {
     $this->tabs = array(array('tab_id' => 'default', 'page' => get_class($this), 'params' => array('action' => 'default'), 'name' => get_string('current', 'block_courserequest')), array('tab_id' => 'requests', 'page' => get_class($this), 'params' => array('action' => 'requests'), 'name' => get_string('requests', 'block_courserequest')));
     parent::__construct($params);
 }