[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/sitemgr/inc/ -> class.Outline_UI.inc.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare SiteMgr - Web Content Management                              *
   4      * http://www.egroupware.org                                                *
   5      * --------------------------------------------                             *
   6      *  This program is free software; you can redistribute it and/or modify it *
   7      *  under the terms of the GNU General Public License as published by the   *
   8      *  Free Software Foundation; either version 2 of the License, or (at your  *
   9      *  option) any later version.                                              *
  10      \**************************************************************************/
  11  
  12      /* $Id: class.Outline_UI.inc.php 20295 2006-02-15 12:31:25Z  $ */
  13  
  14      class Outline_UI
  15      {
  16          var $common_ui;
  17          var $t;
  18          var $acl;
  19          var $pagebo;
  20          var $cat_bo;
  21          var $isadmin;
  22          
  23          
  24          var $public_functions=array
  25          (
  26              'manage' => True,
  27          );
  28          
  29  		function Outline_UI()            
  30          {
  31              $this->common_ui =& CreateObject('sitemgr.Common_UI',True);
  32              $this->t = $GLOBALS['egw']->template;
  33              $this->pagebo = &$GLOBALS['Common_BO']->pages;
  34              $this->cat_bo = &$GLOBALS['Common_BO']->cats;
  35              $this->acl = $GLOBALS['Common_BO']->acl;
  36              $this->isadmin = $this->acl->is_admin();
  37          }
  38  
  39  		function manage()
  40          {
  41              $this->common_ui->DisplayHeader(lang('Manage categories and pages'));
  42  
  43              $this->t->set_file('ManageOutline','manage_outline.tpl');
  44              $this->t->set_block('ManageOutline', 'PageBlock', 'PBlock');
  45              $this->t->set_block('ManageOutline', 'CategoryBlock', 'CBlock');
  46  
  47              if ($this->isadmin)
  48              {
  49                  $this->t->set_var('addcategory','<a target="editwindow" href="' . 
  50                      $GLOBALS['egw']->link('/index.php','menuaction=sitemgr.Categories_UI.edit').
  51                      '">' . lang('Add a category') .'</a>'
  52                  );
  53              }
  54  
  55              $cat_list = $this->cat_bo->getpermittedcatsWrite();
  56  
  57              if (!$cat_list)
  58              {
  59                   echo lang("You do not have write permissions for any site categories.") . '<br><br>';
  60              }
  61  
  62              while (list(,$cat_id) = @each($cat_list))
  63              {
  64                  $category = $this->cat_bo->getCategory($cat_id);
  65                  $this->t->set_var('PBlock', '');
  66                  $page_list = $this->pagebo->getPageIDList($cat_id);
  67  
  68                  while (list(,$page_id) = @each($page_list))
  69                  {
  70                      $page = $this->pagebo->getPage($page_id,$this->sitelanguages[0]);
  71                      $page_description = sprintf(
  72                          '<b>%s</b>: %s &nbsp;&nbsp;<b>ID</b>: %s<br><b>%s</b>: %s',
  73                          lang('Name'),
  74                          $page->name,
  75                          $page_id,
  76                          lang('Title'),
  77                          $page->title
  78                      );
  79                      $this->t->set_var('page', $page_description);
  80                      $link_data['page_id'] = $page_id;
  81                      $link_data['menuaction'] = "sitemgr.Pages_UI.edit";
  82                      $this->t->set_var('editpage','<a target="editwindow" href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
  83                          '">' . lang('Edit page') . '</a>'
  84                      );
  85                      $link_data['menuaction'] = "sitemgr.Content_UI.manage";
  86                      $this->t->set_var('pagecontent','<a href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
  87                          '">' . lang('Manage page specific content') . '</a>'
  88                      );
  89                      $link_data['menuaction'] = "sitemgr.Pages_UI.delete";
  90                      $this->t->set_var('deletepage','<a href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
  91                          '">' . lang('Delete page') . '</a>'
  92                      );
  93                      $this->t->parse('PBlock', 'PageBlock', true);
  94                  }
  95                  $this->t->set_var(array(
  96                      'indent' => $category->depth * 5,
  97                      'category' => $category->name
  98                  ));
  99                  $link_data['page_id'] = 0;
 100                  $link_data['cat_id'] = $cat_id;
 101                  if ($this->isadmin)
 102                  {
 103                      $link_data['menuaction'] = "sitemgr.Categories_UI.edit";
 104                      $this->t->set_var('editcat','<a target="editwindow" href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
 105                          '">' . lang('Edit category') . '</a>');
 106                      $link_data['menuaction'] = "sitemgr.Categories_UI.delete";
 107                      $this->t->set_var('deletecat','<a href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
 108                          '">'  . lang('Delete category') . '</a>');
 109                      $link_data['menuaction'] = "sitemgr.Modules_UI.manage";
 110                      $this->t->set_var('moduleconfig','<a href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
 111                          '">'  . lang('Manage category wide module properties') . '</a>');
 112                  }
 113  
 114                  $link_data['menuaction'] = "sitemgr.Pages_UI.edit";
 115                  $this->t->set_var('addpage','<a target="editwindow" href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
 116                      '">' . lang('Add page to category') . '</a>');
 117                  $link_data['menuaction'] = "sitemgr.Content_UI.manage";
 118                  $this->t->set_var('catcontent','<a href="' . $GLOBALS['egw']->link('/index.php',$link_data) .
 119                      '">' . lang('Manage category wide content') . '</a>');
 120                  $this->t->parse('CBlock', 'CategoryBlock', true); 
 121              }
 122              $this->t->pfp('out','ManageOutline');
 123              $this->common_ui->DisplayFooter();
 124          }
 125      }


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7