예제 #1
0
파일: blocklib.php 프로젝트: Burick/moodle
 /**
  * Ensure that there is some content within the given region
  *
  * @param string $region The name of the region to check
  */
 protected function ensure_content_created($region, $output)
 {
     $this->ensure_instances_exist($region);
     if (!array_key_exists($region, $this->visibleblockcontent)) {
         $contents = array();
         if (array_key_exists($region, $this->extracontent)) {
             $contents = $this->extracontent[$region];
         }
         $contents = array_merge($contents, $this->create_block_contents($this->blockinstances[$region], $output, $region));
         if ($region == $this->defaultregion) {
             $addblockui = block_add_block_ui($this->page, $output);
             if ($addblockui) {
                 $contents[] = $addblockui;
             }
         }
         $this->visibleblockcontent[$region] = $contents;
     }
 }
예제 #2
0
파일: blocklib.php 프로젝트: stronk7/moodle
 /**
  * Ensure that there is some content within the given region
  *
  * @param string $region The name of the region to check
  */
 public function ensure_content_created($region, $output)
 {
     $this->ensure_instances_exist($region);
     if (!array_key_exists($region, $this->visibleblockcontent)) {
         $contents = array();
         if (array_key_exists($region, $this->extracontent)) {
             $contents = $this->extracontent[$region];
         }
         $contents = array_merge($contents, $this->create_block_contents($this->blockinstances[$region], $output, $region));
         if ($region == $this->defaultregion && (!isset($this->page->theme->addblockposition) || $this->page->theme->addblockposition == BLOCK_ADDBLOCK_POSITION_DEFAULT)) {
             $addblockui = block_add_block_ui($this->page, $output);
             if ($addblockui) {
                 $contents[] = $addblockui;
             }
         }
         $this->visibleblockcontent[$region] = $contents;
     }
 }