function cms_nav($link, $segment = NULL) { debug::dump($this); $CI =& get_instance(); if ($link == $CI->uri->segment($segment)) { if ($link == NULL) { $link = "dashboard"; } // Necessary for home page (since it's not a sub directory) $link = ' class="current"'; return $link; // Adds CSS class name 'base' to links matching site location. } }
public function index() { $ci =& get_instance(); $basepath = 'application/modules'; $dir = new RecursiveIteratorIterator(new RecursiveRegexIterator(new RecursiveDirectoryIterator($basepath), '#(?<!/)\\/config\\/[A-z]+_dashboard\\.php$|^[^\\.]*$#i'), true); foreach ($dir as $d) { if ($d->isFile()) { $_packages[] = dirname(dirname($d->getPathname())); // application/modules/menus/ $_configs[] = $d->getFilename(); } } $helper = new Site_View_Helper_Pod(); foreach ($_packages as $k => $v) { /* *Load mvc for each module with a dashboard config */ $ci->load->add_package_path($v); /* * Load that config file and the model and model->method from its config array */ $ci->config->load(str_replace('.php', '', $_configs[$k])); // menus_dashboard $ci->load->model($ci->config->item('_model')); $_model = $ci->config->item('_model'); $_method = $ci->config->item('_method'); $ci->config->item('_args') ? $args = $ci->config->item('_args') : ($args = null); /* * Get the properties of the Pod kids from the config file */ $ci->config->item('head_tag') ? $head_tag = $ci->config->item('head_tag') : ($head_tag = array('tag' => 'h2')); $ci->config->item('ul') ? $ul = $ci->config->item('ul') : ($ul = array('tag' => 'ul')); $ci->config->item('li') ? $li = $ci->config->item('li') : ($li = array('tag' => 'li')); $ci->config->item('a') ? $a = $ci->config->item('a') : ($a = array()); /* * Set the Heading of each pod */ $_heading = $ci->config->item('_heading') ? $_heading = $ci->config->item('_heading') : ($_heading = ucfirst(basename($obj['path']))); /* * Set the properties of the Pod parent and each Pod wrap */ $podParent = array('tag' => 'div', 'class' => 'pods'); $podKids = array('tag' => 'div', 'class' => 'pod one-third'); /* * Create a class property to hold the data of the model */ /* pod(array $data, array $wrapperAttribs = array('tag' => 'div', 'class' => 'pods'), array $podAttribs = array('tag' => 'div', 'class' => 'pod one-third'), array $headingAttribs = array('tag' => 'h2', 'class' => 'headingClass'), array $ulAttribs = array('tag' => 'ul', 'class' => 'podUlClass'), array $liAttribs = array('tag' => 'li', 'class' => 'liClass'), array $aAttribs = array('class' => 'linkClass') */ $pod[$_heading] = $ci->{$_model}->{$_method}($args); $final[] = $pod; $final[] = $podParent; $final[] = $podKids; $final[] = $head_tag; $final[] = $ul; $final[] = $li; $ci->load->remove_package_path(); unset($pod); } if (isset($final)) { $helper->setView(new Zend_View()); //$pods = $helper->pod($pod, $podParent, $podKids, $head_tag, $ul, $li, $a); //$li=array(); } debug::dump($final); return $helper->pod($final); unset($final); continue; }
/** * Send query data to debug bar * * @access public * @return void */ public function debug() { $debug = array(); $debug['request'] = $this->prepare_request; $debug['count'] = $this->count; $debug['cache'] = $this->cache; $debug['cached'] = $this->cached; if ($this->ok() && $this->which == "ALL") { $debug['results'] = $this->getArray(); } elseif ($this->ok() && $this->which == "FIRST") { $debug['results'] = $this->get(); } debug::dump($debug, lang::text('sql:request')); }
/** * Manage * * @access public * @param int * @return void */ public function manage($id = NULL) { if (!$id) { $this->template->_message('Invalid request', 'error', 'admin/pages'); } $data->parent = $this->pages->get($id); debug::dump($data->parent); exit; $data->rows = $this->pages->list_by_type($data->parent->typeX); $this->template->title('Manage ' . $data->parent->title)->set_breadcrumb('Site Content', '/admin/pages')->build('admin/manage', $data); }
static function env() { $raw= function($channel) { if ($channel=='_COOKIE') $data= $_COOKIE; elseif ($channel=='_GET') $data= $_GET; elseif ($channel=='_COOKIE') $data= $_COOKIE; elseif ($channel=='_POST') $data= $_POST; elseif ($channel=='_SESSION') $data= $_SESSION; elseif ($channel=='_SERVER') $data= $_SERVER; if ($channel=='_SERVER') { echo '<tr><th colspan="3" onclick="document.getElementById(\'conkit-'.$channel.'\').style.display=\'table-row-group\'">$'.$channel.' ▾</th></tr>'; echo '<tbody id="conkit-'.$channel.'" style="display:none;">'; } else { echo '<tr><th colspan="3">$'.$channel.'</th></tr>'; echo '<tbody id="conkit-'.$channel.'">'; } if ($data) { foreach ($data as $name=>$value) { echo "<tr><td>$name</td><td>"; debug::dump($value); echo '</td><td align="center">'; if ($channel=='_SERVER') echo ''; elseif (!isset(core::$req[$name])) echo '✗'; elseif ($channel=='_FILE') echo '✓'; elseif (core::$req[$name]==$value) echo '✓'; else echo '≠'; echo '</td></tr>'; } } echo '</tbody>'; }; $reg= function($channel) { echo '<tr><th colspan="3">core::'.$channel.'()</th></tr>'; echo '<tbody id="conkit-'.$channel.'">'; foreach (core::$channel() as $name=>$value) { echo "<tr><td>$name</td><td>"; debug::dump($value); echo '</td><td></td></tr>'; } echo '</tbody>'; }; echo '<table border="1">'; echo '<tr><th>Name</th><th>Value</th><th>core::req</th></tr>'; $raw('_COOKIE'); $raw('_GET'); $raw('_POST'); $raw('_FILES'); $raw('_SESSION'); $raw('_SERVER'); $reg('req'); $reg('reg'); $reg('vars'); echo '</table>'; }