public static function DrawDashboard() { // get large widget area ob_start(); uEvents::TriggerEvent('ShowDashboard'); $largeContent = ob_get_clean(); if ($largeContent) { echo '<div class="dash-large">' . $largeContent . '</div>'; } // get small widget area $smallContent = ''; $w = utopia::GetModulesOf('uDashboardWidget'); foreach ($w as $wid) { $wid = $wid['module_name']; $ref = new ReflectionClass($wid); ob_start(); if ($ref->hasMethod('Draw100')) { $wid::Draw100(); } elseif ($ref->hasMethod('Draw50')) { $wid::Draw50(); } elseif ($ref->hasMethod('Draw25')) { $wid::Draw25(); } $content = ob_get_clean(); if (!$content) { continue; } $smallContent .= '<div class="widget-container ' . $wid . '"><h1>' . $wid::GetTitle() . '</h1><div class="module-content">' . $content . '</div></div>'; } if ($smallContent) { echo '<div class="dash-small">' . $smallContent . '</div>'; } }
static function Initialise($sender) { $installed = array(); $classes = utopia::GetModulesOf('uDataModule'); foreach ($classes as $classname => $info) { // install tables if (is_subclass_of($classname, 'iAdminModule')) { continue; } $o = utopia::GetInstance($classname); if (!$o->HasRewrite()) { continue; } $installed[$classname] = $classname; } $sender->CreateTable('custom', 'tabledef_CustomWidget', 'blocks', 'widget_id'); $sender->AddField('module', 'module', 'custom', 'Data Source', itCOMBO, $installed); $sender->AddSpacer(); $sender->AddField('content_info', "'The content you enter below will be repeated for each row in the result.<br>If you want to repeat only a part of the content, give the element a class of _r (class=\"_r\"), or _ri to repeat contained elements only (innerHTML).'", '', ''); $sender->AddField('fields', array(__CLASS__, 'getPossibleFields'), 'blocks', 'Possible Fields'); $sender->AddField('content', 'content', 'custom', 'Content', itHTML); $sender->FieldStyles_Set('content', array('width' => '100%', 'height' => '20em')); $sender->AddSpacer(); $sender->AddField('nr_info', "'The content below will be shown if no rows exist.'", '', ''); $sender->AddField('no_rows', 'no_rows', 'custom', 'No Rows Found', itHTML); $sender->FieldStyles_Set('content', array('height' => '20em')); $sender->NewSection('Filters'); $sender->AddField('clear_filter', 'clear_filter', 'custom', 'Remove Filters', itCHECKBOX, 'uCustomWidget::ListFilters'); $sender->AddField('filter', 'filter', 'custom', 'Add Filter', itTEXT); $sender->AddField('order', 'order', 'custom', 'Order', itTEXT); $sender->AddField('limit', 'limit', 'custom', 'Limit', itTEXT); }
public static function GetModules() { $modules = utopia::GetModulesOf('iRestrictedAccess'); foreach ($modules as $k => $v) { $modules[$k] = $k; } foreach (self::$linked as $k => $mods) { // unset all mods foreach ($mods as $m) { unset($modules[$m]); } // add k to modules $modules[$k] = $k; } // remove custom roles foreach (self::$customRoles as $k => $c) { unset($modules[$k]); } return $modules; }
// must run second due to requiring GLOB_MOD to be setup fully timer_start('Init: ' . $row['module_name']); $row['module_name']::Initialise(); timer_end('Init: ' . $row['module_name']); } timer_end('Static Initialise'); uConfig::DefineConfig(); uConfig::ValidateConfig(); uEvents::TriggerEvent('ConfigDefined'); timer_start('Before Init'); uEvents::TriggerEvent('BeforeInit'); timer_end('Before Init'); timer_start('Table Initialise'); uTableDef::TableExists(null); // cache table exists $allmodules = utopia::GetModulesOf('uTableDef'); foreach ($allmodules as $row) { // must run second due to requiring GLOB_MOD to be setup fully timer_start('Init: ' . $row['module_name']); $obj = utopia::GetInstance($row['module_name']); $obj->AssertTable(); // setup Parents timer_end('Init: ' . $row['module_name']); } timer_end('Table Initialise'); define('INIT_COMPLETE', TRUE); timer_start('After Init'); uEvents::TriggerEvent('InitComplete'); uEvents::TriggerEvent('AfterInit'); timer_end('After Init'); if ($_SERVER['HTTP_HOST'] !== 'cli') {