/** * Set the contexts array and, optionally, the site area. * * @param array Context menus to display, normally stored in application config. * @param string Area to link to, if not provided (or null), will remain unchanged. * * @return void */ public static function setContexts($contexts = array(), $siteArea = null) { if (empty($contexts) || !is_array($contexts)) { die(lang('bf_no_contexts')); } // Ensure required contexts exist. foreach (self::$requiredContexts as $requiredContext) { if (!in_array($requiredContext, $contexts)) { $contexts[] = $requiredContext; } } self::$contexts = $contexts; if (!is_null($siteArea)) { self::$site_area = $siteArea; } log_message('debug', 'UI/Contexts setContexts has been called.'); }
/** * Set the contexts array * * @param array Array of Context Menus to Display normally stored in * application config. * @param string Area to link to defaults to SITE_AREA or Admin area. * * @return void */ public static function set_contexts($contexts = array(), $site_area = SITE_AREA) { if (empty($contexts) || !is_array($contexts) || !count($contexts)) { die(lang('bf_no_contexts')); } self::$contexts = $contexts; self::$site_area = $site_area; log_message('debug', 'UI/Contexts set_contexts has been called.'); }