示例#1
0
 public function generateOutput()
 {
     global $ari;
     // $ari->internalChrono('p_start');
     //start smarty-section template
     $this->template->caching = 0;
     if ($ari->get('mode') == 'admin') {
         $this->template->template_dir = $ari->enginedir . DIRECTORY_SEPARATOR . "admin" . DIRECTORY_SEPARATOR . $ari->agent->getLang();
         $this->template->compile_id = $ari->mode . "__" . $ari->agent->getLang() . "__";
     } else {
         $this->template->template_dir = $ari->filesdir . DIRECTORY_SEPARATOR . 'perspectives' . DIRECTORY_SEPARATOR . $this->perspective . DIRECTORY_SEPARATOR . $ari->agent->getLang();
         $this->template->compile_id = $ari->agent->getLang() . "_" . $this->perspective . "__";
     }
     // $ari->internalChrono('p_new');
     ///end smarty load
     //check to see if section template exist
     if (file_exists($this->template->template_dir . DIRECTORY_SEPARATOR . $ari->filename)) {
         $this->template->assign("maincontent", $ari->get('mod_content'));
         $this->template->assign("title", $ari->get('title'));
         $this->template->assign("keywords", $ari->get('keywords'));
         $this->template->assign("description", $ari->get('description'));
         $this->template->assign("author", $ari->get('author'));
         $this->template->assign("encoding", $ari->locale->get('encoding', 'general'));
         // $ari->internalChrono('p_vars');
         if ($ari->get('mode') == 'user') {
             $this->template->assign("webdir", $ari->webaddress);
         }
         // . $this->safeName()
         if ($ari->get('mode') == 'admin') {
             $this->template->assign("webdir", $ari->adminaddress);
             // Modules Selector
             /*	if ($menu = oob_module::adminModulesSelector ())
             				{	$this->template->assign("mod_names", $menu["name"]);
             					$this->template->assign("mod_values", $menu["value"]);
             					$this->template->assign("mod_selected", $menu["selected"]);
             					$this->template->assign("mod_selectedName", $menu["selectedName"]);
             				}
             					// Selected Module Menu
             					$this->template->assign("modulemenu", $ari->module->adminMenu());
             			*/
             $this->template->assign("modules_menu", oob_module::adminFullMenu());
             $this->template->assign("mod_selected", $ari->module->name());
         }
         //-----------------------------------------------------------------------
         //@todo => ver si quitar luego
         if ($ari->get("user")) {
             $this->template->assign("currentUser", $ari->get("user")->name());
             $this->template->assign("logued", true);
         } else {
             $this->template->assign("logued", false);
         }
         //-----------------------------------------------------------------------
         // $ari->internalChrono('p_morevars');
         $this->template->display($ari->filename);
     } else {
         throw new OOB_exception('No existe la plantilla en la perspectiva: ' . $ari->get('filename'), "73", "No existe la plantilla en la perspectiva", true);
     }
     // $ari->internalChrono('p_end');
 }
示例#2
0
文件: menu.php 项目: pablius/oob-n1
<?php

#OOB/N1 Framework [2008 - Nutus] - PM
// menu JSON para EXT-JS
//error_reporting(0);
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
$menu = oob_module::adminFullMenu();
$json_menu = array();
foreach ($menu as $datos_padre) {
    $padre = array();
    $padre['cls'] = 'Father-node';
    $padre['leaf'] = false;
    $padre['text'] = $datos_padre['name'];
    $padre['id'] = $datos_padre['id'];
    $padre['children'] = array();
    if (isset($datos_padre['menu']) && is_array($datos_padre['menu'])) {
        foreach ($datos_padre['menu'] as $datos_hijo) {
            $hijo = array();
            $hijo['iconCls'] = 'ChildNode';
            $hijo['leaf'] = true;
            $hijo['text'] = $datos_hijo['name'];
            $hijo['id'] = array($datos_hijo['name'], $ari->adminaddress . '/' . $datos_hijo['link']);
            // nombre del tab, url
            $padre['children'][] = $hijo;
        }
    }
    $json_menu[] = $padre;
}
//RESULTADO