public function __construct() { // Array of block params $block = array("classname" => "category_wildlife_block", "name" => "Wildlife Reports", "description" => "List the 10 latest reports in the wildlife category"); // register block with core, this makes it available to users blocks::register($block); }
public function __construct() { $block = array("classname" => "polaroid_reports_block", "name" => "Polaroid Reports", "description" => "List the 35 latest reports in the system. Part of the Polaroid Theme."); blocks::register($block); // Hook into routing Event::add('system.pre_controller', array($this, 'add')); }
function index() { $this->template->content = new View('admin/blocks'); $this->template->content->title = Kohana::lang('ui_admin.blocks'); // Get Registered Blocks if (!is_array($this->_registered_blocks)) { $this->_registered_blocks = array(); } // Get Active Blocks $settings = ORM::factory('settings', 1); $active_blocks = $settings->blocks; $active_blocks = array_filter(explode("|", $active_blocks)); // setup and initialize form field names $form = array('action' => '', 'block' => ''); // copy the form as errors, so the errors will be stored with keys corresponding to the form field names $errors = $form; $form_error = FALSE; $form_saved = FALSE; $form_action = ""; if ($_POST) { $post = Validation::factory($_POST); // Add some filters $post->pre_filter('trim', TRUE); // Add some rules, the input field, followed by a list of checks, carried out in order $post->add_rules('action', 'required', 'alpha', 'length[1,1]'); $post->add_rules('block', 'required', 'alpha_dash'); if (!array_key_exists($post->block, $this->_registered_blocks)) { $post->add_error('block', 'exists'); } if ($post->validate()) { // Activate a block if ($post->action == 'a') { array_push($active_blocks, $post->block); $settings->blocks = implode("|", $active_blocks); $settings->save(); } elseif ($post->action == 'd') { $active_blocks = array_diff($active_blocks, array($post->block)); $settings->blocks = implode("|", $active_blocks); $settings->save(); } } else { $errors = arr::overwrite($errors, $post->errors('blocks')); $form_error = TRUE; } } // Sort the Blocks $sorted_blocks = blocks::sort($active_blocks, array_keys($this->_registered_blocks)); $this->template->content->form = $form; $this->template->content->errors = $errors; $this->template->content->form_error = $form_error; $this->template->content->form_saved = $form_saved; $this->template->content->form_action = $form_action; $this->template->content->total_items = count($this->_registered_blocks); $this->template->content->registered_blocks = $this->_registered_blocks; $this->template->content->active_blocks = $active_blocks; $this->template->content->sorted_blocks = $sorted_blocks; // Javascript Header $this->template->tablerowsort_enabled = TRUE; $this->template->js = new View('admin/blocks_js'); }
" width="160" /></div> <div class="report-date"><?php echo $incident_date; ?> </div> <div class="report-location"><?php echo $incident_category; ?> </div> <div class="report-title"><?php echo $incident_title; ?> </div> </a> </div> <?php $i++; } } ?> <a class="more" href="<?php echo url::site() . 'reports/'; ?> "><?php echo Kohana::lang('ui_main.view_more'); ?> </a> <div style="clear:both;"></div> <?php blocks::close();
<!-- / right column --> <!-- content column --> <div id="content" class="clearingfix"> <?php // Map and Timeline Blocks echo $div_map; echo $div_timeline; ?> </div> </div> <!-- / content column --> </div> </div> <!-- / main body --> <!-- content --> <div class="content-container"> <!-- content blocks --> <?php blocks::render(); ?> <!-- /content blocks --> </div> <!-- content -->
public function __construct() { $block = array("classname" => "news_block", "name" => "Main Stream News", "description" => "List the 10 latest news items from available news feeds"); blocks::register($block); }
public function __construct() { $block = array("classname" => "tedx_reports_block", "name" => "TEDx Reports", "description" => "List the 10 latest reports in the system"); blocks::register($block); }
public static function theme_blocks($position) { if (module_manager::is_enabled("blocks")) { $path = page::clean_path(); $blocks = blocks::get_blocks_by_path($path, $position); $out = ""; foreach ($blocks as $b) { $out .= blocks::invoke_block($b); } return $out; } else { return " "; } }
/** * Установка отображемого модуля страницы для проверки в блоке * @param string $module имя модуля * @return null */ public static function set_module($module) { self::$module = $module; }
public function __construct() { $block = array("classname" => "media_reports_block", "name" => "Media", "description" => "List the 10 latest reports with thumbnails"); blocks::register($block); }
* * @page http://ctrev.cyber-tm.ru/ * @copyright (c) 2008-2012, Cyber-Team * @author The Cheat <*****@*****.**> * @name Главная страница сайта * @version 1.00 */ if (!file_exists('install/lock') && file_exists('install/')) { @header('Location: install.php'); die; } define('DELAYED_UINIT', true); // отложенная инициализация юзерей... include_once "./include/include.php"; $module = $_GET['module']; blocks::set_module($module ? $module : "index"); $this_file = globals::g('baseurl') . "index.php?module=" . $module; tpl::o()->assign("this_file", $this_file); $ajax = (bool) $_REQUEST['from_ajax']; // Из AJAX $nno = (bool) $_REQUEST['nno']; // Стандартный класс(без постфикса '_ajax') if (!$ajax && ($current = stats::o()->read(DATABASE_STATS)) != DATABASE_VERSION) { /* @var $m message */ $m = n("message"); $m->error('need_to_upgrade_database', array(DATABASE_VERSION, $current ? $current : "unknown")); } globals::s('ajax', $ajax); tpl::o()->assign('from_ajax', $ajax); tpl::o()->assign('module_loaded', $module); if ($module) {