[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/sitemgr/modules/ -> class.module_bookmarks.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.module_bookmarks.inc.php 20295 2006-02-15 12:31:25Z  $ */
  13  
  14  class module_bookmarks extends Module 
  15  {
  16      var $template;
  17      var $startlevel;
  18  
  19  	function module_bookmarks()
  20      {
  21          $this->title = lang('Bookmarks');
  22          $this->description = lang('This module displays bookmarks in a javascript based tree');
  23          $this->cookie = array('expanded');
  24          $this->arguments = array(
  25              'category' => array(
  26                  'type' => 'select', 
  27                  'label' => lang('Choose the categories to display'), 
  28                  'options' => array(),
  29                  'multiple' => True
  30              )
  31          );
  32      }
  33  
  34  	function get_user_interface()
  35      {
  36          $cat = createobject('phpgwapi.categories','','bookmarks');
  37          $cats = $cat->return_array('all',0,False,'','cat_name','',True);
  38          $cat_ids = array();
  39          while (list(,$category) = @each($cats))
  40          {
  41              $cat_ids[$category['id']] = $GLOBALS['egw']->strip_html($category['name']);
  42          }
  43          $this->arguments['category']['options'] = $cat_ids;
  44          return parent::get_user_interface();
  45      }
  46  
  47  	function set_block(&$block,$produce=False)
  48      {
  49          parent::set_block($block,$produce);
  50  
  51          if ($produce)
  52          {
  53              require_once (EGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP . 'inc' . SEP . 'class.xslt_transform.inc.php');
  54              $this->add_transformer(new xslt_transform(
  55                  $this->find_template_dir() . SEP . 'xbel.xsl',
  56                  array('blockid' => $this->block->id)
  57              ));
  58          }
  59      }
  60  
  61  	function get_content(&$arguments,$properties)
  62      {
  63          if ($arguments['expanded'])
  64          {
  65              $expandedcats = array_keys($arguments['expanded']);
  66          }
  67          else
  68          {
  69              $expandedcats = Array();
  70          }
  71          $bo = createobject('bookmarks.bo');
  72          return $bo->export($arguments['category'],'xbel',$expandedcats);
  73      }
  74  }


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