function add_home_panel($method) { global $DSP, $EXT, $PREFS, $SESS; $r = $EXT->last_call !== FALSE ? $EXT->last_call : ''; $site = $PREFS->ini('site_id'); $group = $SESS->userdata['group_id']; // With this crazy hook we need to make sure that it's our method that's being called, // as other methods using this hook will *also* call this function. $our_methods = array('custom_panel_one', 'custom_panel_two'); if (in_array($method, $our_methods) && !empty($this->settings[$site][$method]) && !empty($this->settings[$site][$method . '_heading']) && in_array($group, $this->settings[$site][$method . '_groups'])) { if (!class_exists('Typography')) { require_once PATH_CORE . 'core.typography' . EXT; } $format = new Typography(); $text = $format->xhtml_typography($this->settings[$site][$method]); $r .= $DSP->table('tableBorder', '0', '0', '100%') . $DSP->tr() . $DSP->table_qcell('tableHeading', $this->settings[$site][$method . '_heading']) . $DSP->tr_c() . $DSP->table_qrow('tableCellTwo customPanel', $text) . $DSP->table_c(); // The'control_panel_home_page_left/right_option' hook doesn't return data, // so we have to manually save our output in the last_call variable. // Otherwise subsequent calls to this hook with other functions // will overwrite what we just created. $EXT->last_call = $r; } return $r; }