eGroupWare PHP Cross Reference Groupware Applications

Source: /phpgwapi/templates/idots/class.idots_framework.inc.php - 645 lines - 20395 bytes - Summary - Text - Print

Description: EGroupware idots template set

   1  <?php
   2  /**
   3   * EGroupware idots template set
   4   *
   5   * @link http://www.egroupware.org
   6   * @author Ralf Becker <RalfBecker-AT-outdoor-training.de> rewrite in 12/2006
   7   * @author Pim Snel <pim@lingewoud.nl> author of the idots template set
   8   * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
   9   * @package api
  10   * @subpackage framework
  11   * @access public
  12   * @version $Id$
  13   */
  14  
  15  /**
  16  * eGW idots template
  17  *
  18  * The idots_framework class draws the default idots template. It's a phplib template based template-set.
  19  *
  20  * Other phplib template based template-sets should extend (not copy!) this class and reimplement methods they which to change.
  21  */
  22  class idots_framework extends egw_framework
  23  {
  24      /**
  25      * HTML of the sidebox menu, get's collected here by calls to $this->sidebox
  26      *
  27      * @var string
  28      */
  29      var $sidebox_content = '';
  30      /**
  31      * Instance of the phplib Template class for the API's template dir (EGW_TEMPLATE_DIR)
  32      *
  33      * @var Template
  34      */
  35      var $tpl;
  36      /**
  37      * Instance of the Savant template class
  38      *
  39      * @var tplsavant2
  40      */
  41      var $tplsav2;
  42  
  43      /**
  44      * Contains array with linked icons in the topmenu
  45      *
  46      * @var mixed
  47      * @access public
  48      */
  49      var $topmenu_icon_arr = array();
  50  
  51      /**
  52      * Contains array of information for additional topmenu items added
  53      * by hooks
  54      */
  55      private static $hook_items = array();
  56  
  57      /**
  58      * Constructor
  59      *
  60      * @param string $template='idots' name of the template
  61      * @return idots_framework
  62      */
  63  	function __construct($template='idots')
  64      {
  65          parent::__construct($template);        // call the constructor of the extended class
  66  
  67          $this->tplsav2 = new tplsavant2();
  68          $this->tplsav2->set_tpl_path(EGW_SERVER_ROOT.SEP.'phpgwapi'.SEP.'templates'.SEP.'idots');
  69      }
  70  
  71      /**
  72      * @deprecated use __construct()
  73      */
  74  	function idots_framework($template='idots')
  75      {
  76          self::__construct($template);
  77      }
  78  
  79      /**
  80      * Returns the html-header incl. the opening body tag
  81      *
  82      * @param array $extra=array() extra attributes passed as data-attribute to egw.js
  83      * @return string with html
  84      */
  85  	function header(array $extra=array())
  86      {
  87          // make sure header is output only once
  88          if (self::$header_done) return '';
  89          self::$header_done = true;
  90  
  91          // js stuff is not needed by login page or in popups
  92          $GLOBALS['egw_info']['flags']['js_link_registry'] =
  93              !(in_array($GLOBALS['egw_info']['flags']['currentapp'], array('login', 'logout', 'setup')) ||
  94                  $GLOBALS['egw_info']['flags']['nonavbar'] === 'popup');
  95          //error_log(__METHOD__."() ".__LINE__.' js_link_registry='.array2string($GLOBALS['egw_info']['flags']['js_link_registry']).' '.function_backtrace());
  96  
  97          $this->send_headers();
  98  
  99          // catch error echo'ed before the header, ob_start'ed in the header.inc.php
 100          $content = ob_get_contents();
 101          ob_end_clean();
 102  
 103          // the instanciation of the template has to be here and not in the constructor,
 104          // as the old Template class has problems if restored from the session (php-restore)
 105          $this->tpl = new Template(EGW_TEMPLATE_DIR,'keep');
 106          $this->tpl->set_file(array('_head' => 'head.tpl'));
 107          $this->tpl->set_block('_head','head');
 108  
 109          if (html::$ua_mobile)
 110          {
 111              self::$css_include_files[] = '/phpgwapi/templates/idots/mobile.css';
 112              $extra['mobile'] = true;
 113          }
 114  
 115          // load idots specific javascript files, if we are not in login or logout
 116          if (!in_array($GLOBALS['egw_info']['flags']['currentapp'], array('login', 'logout')))
 117          {
 118              self::validate_file('/phpgwapi/templates/idots/js/idots.js');
 119          }
 120          if ($GLOBALS['egw_info']['user']['preferences']['common']['click_or_onmouseover'] == 'onmouseover' && !html::$ua_mobile)
 121          {
 122              $show_menu_event = 'mouseover';
 123          }
 124          else
 125          {
 126              $show_menu_event = 'click';
 127          }
 128          $extra['slide-out'] = $show_menu_event;
 129  
 130          $this->tpl->set_var($this->_get_header($extra));
 131  
 132          $content .= $this->tpl->fp('out','head');
 133  
 134          $this->sidebox_content = '';    // need to be emptied here, as the object get's stored in the session
 135  
 136          return $content;
 137      }
 138  
 139      /**
 140      * Returns the html from the body-tag til the main application area (incl. opening div tag)
 141      *
 142      * @return string with html
 143      */
 144  	function navbar()
 145      {
 146          if (self::$navbar_done)
 147          {
 148              return !self::$header_done ? $this->header() : '';
 149          }
 150  
 151          if (!empty($_GET['nonavbar']) || $GLOBALS['egw_info']['flags']['currentapp'] == 'admin' && empty($_GET['ajax']))
 152          {
 153              if (!self::$header_done) return $this->header();
 154              return '';
 155          }
 156          self::$navbar_done = true;
 157  
 158          // the navbar
 159          if (!is_object($this->tpl)) $this->tpl = new Template(EGW_TEMPLATE_DIR,'keep');
 160          $this->tpl->set_file(array('navbar' => 'navbar.tpl'));
 161  
 162          $this->tpl->set_block('navbar','extra_blocks_header','extra_block_header');
 163          $this->tpl->set_block('navbar','extra_block_row','extra_block_row');
 164          $this->tpl->set_block('navbar','extra_block_row_raw','extra_block_row_raw');
 165          $this->tpl->set_block('navbar','extra_block_row_no_link','extra_block_row_no_link');
 166          $this->tpl->set_block('navbar','extra_block_spacer','extra_block_spacer');
 167          $this->tpl->set_block('navbar','extra_blocks_footer','extra_blocks_footer');
 168          $this->tpl->set_block('navbar','sidebox_hide_header','sidebox_hide_header');
 169          $this->tpl->set_block('navbar','sidebox_hide_footer','sidebox_hide_footer');
 170          $this->tpl->set_block('navbar','appbox','appbox');
 171          $this->tpl->set_block('navbar','navbar_footer','navbar_footer');
 172  
 173          $this->tpl->set_block('navbar','upper_tab_block','upper_tabs');
 174          $this->tpl->set_block('navbar','app_icon_block','app_icons');
 175          $this->tpl->set_block('navbar','app_title_block','app_titles');
 176          $this->tpl->set_block('navbar','app_extra_block','app_extra_icons');
 177          $this->tpl->set_block('navbar','app_extra_icons_div');
 178          $this->tpl->set_block('navbar','app_extra_icons_icon');
 179  
 180          if (html::$ua_mobile)    // replace whole navbar with just the extra apps icon
 181          {
 182              $this->tpl->set_block('navbar','navbar','mobil_not_needed');
 183              $this->tpl->set_block('app_extra_icons_icon','extra_icons_show');
 184              $this->tpl->set_var('mobil_not_needed',$this->tpl->get_var('extra_icons_show'));
 185          }
 186          $this->tpl->set_block('navbar','navbar_header','navbar_header');
 187  
 188          $apps = $this->_get_navbar_apps();
 189          $vars = $this->_get_navbar($apps);
 190  
 191          if($GLOBALS['egw_info']['user']['preferences']['common']['show_general_menu'] != 'sidebox' && !html::$ua_mobile)
 192          {
 193              $content .= $this->topmenu($vars,$apps);
 194              $vars['current_users'] = $vars['quick_add'] = $vars['user_info']='';
 195          }
 196  
 197          $this->tpl->set_var($vars);
 198          $content .= $this->tpl->fp('out','navbar_header');
 199  
 200          // general (app-unspecific) sidebox menu, instead of topmenu
 201          if($GLOBALS['egw_info']['user']['preferences']['common']['show_general_menu'] == 'sidebox')
 202          {
 203              $menu_title = lang('General Menu');
 204  
 205              $this->topmenu($vars,$apps);
 206              $file = $this->tplsav2->menuitems;
 207  
 208              $this->sidebox('',$menu_title,$file);
 209          }
 210  
 211          // allow other apps to hook into sidebox menu of an app, hook-name: sidebox_$app
 212          $GLOBALS['egw']->hooks->process('sidebox_'.$GLOBALS['egw_info']['flags']['currentapp'],
 213              array($GLOBALS['egw_info']['flags']['currentapp']),true);    // true = call independent of app-permissions
 214          // calling the old hook
 215          $GLOBALS['egw']->hooks->single('sidebox_menu',$GLOBALS['egw_info']['flags']['currentapp']);
 216  
 217          // allow other apps to hook into sidebox menu of every app: sidebox_all
 218          $GLOBALS['egw']->hooks->process('sidebox_all',array($GLOBALS['egw_info']['flags']['currentapp']),true);
 219  
 220          if($this->sidebox_content)
 221          {
 222              if($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox'] || html::$ua_mobile)
 223              {
 224                  $this->tpl->set_var('lang_show_menu',lang('show menu'));
 225                  $content .= $this->tpl->parse('out','sidebox_hide_header');
 226  
 227                  $content .= $this->sidebox_content;    // content from calls to $this->sidebox
 228  
 229                  $content .= $this->tpl->parse('out','sidebox_hide_footer');
 230  
 231                  $var['sideboxcolstart'] = '';
 232  
 233                  $this->tpl->set_var($var);
 234                  $content .= $this->tpl->parse('out','appbox');
 235                  $var['remove_padding'] = 'style="padding-left:0px;"';
 236                  $var['sideboxcolend'] = '';
 237              }
 238              else
 239              {
 240                  if (isset($GLOBALS['egw_info']['user']['preferences'][$GLOBALS['egw_info']['flags']['currentapp']]['idotssideboxwidth']))
 241                  {
 242                      $sideboxwidth = $GLOBALS['egw_info']['user']['preferences'][$GLOBALS['egw_info']['flags']['currentapp']]['idotssideboxwidth'];
 243                  }
 244                  if((int)$sideboxwidth < 1)
 245                  {
 246                      $sideboxwidth = 203;
 247                  }
 248  
 249                  $var['menu_link'] = '';
 250  
 251                  $var['sideboxcolstart'] = '<td id="tdSidebox" valign="top"><div id="thesideboxcolumn" style="width:'.$sideboxwidth.'px">';
 252                  $var['sideboxcolstart'] .= '<div id="sideresize"></div>';
 253                  $var['remove_padding'] = '';
 254                  $this->tpl->set_var($var);
 255                  $content .= $this->tpl->parse('out','appbox');
 256  
 257                  $content .= $this->sidebox_content;
 258  
 259                  $var['sideboxcolend'] = '</div></td>';
 260  
 261                  $this->tplsav2->assign('sideboxwidth', $sideboxwidth);
 262              }
 263          }
 264          else
 265          {
 266              $var['sideboxcolend']='';
 267          }
 268  
 269          $this->tpl->set_var($var);
 270          $content .= $this->tpl->parse('out','navbar_footer');
 271  
 272          // depricated (!) application header, if not disabled
 273          // ToDo: check if it can be removed
 274          if(!@$GLOBALS['egw_info']['flags']['noappheader'] && @isset($_GET['menuaction']))
 275          {
 276              list(, $class) = explode('.',$_GET['menuaction']);
 277              if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header'])
 278              {
 279                  ob_start();
 280                  $GLOBALS[$class]->header();
 281                  $content .= ob_get_contents();
 282                  ob_end_clean();
 283              }
 284          }
 285  
 286          // hook after navbar
 287          $content .= $this->_get_after_navbar();
 288  
 289          // make sure header is output (not explicitly calling header, allows to put validate calls eg. in sidebox)
 290          if (!self::$header_done) $content = $this->header() . $content;
 291  
 292          return $content;
 293      }
 294  
 295      /**
 296       * Return true if we are rendering the top-level EGroupware window
 297       *
 298       * A top-level EGroupware window has a navbar: eg. no popup and for a framed template (jdots) only frameset itself
 299       *
 300       * @return boolean $consider_navbar_not_yet_called_as_true=true
 301       * @return boolean
 302       */
 303  	public function isTop($consider_navbar_not_yet_called_as_true=true)
 304      {
 305          return self::$navbar_done || $consider_navbar_not_yet_called_as_true ||
 306              isset($GLOBALS['egw_info']['flags']['nonavbar']) && !$GLOBALS['egw_info']['flags']['nonavbar'];
 307      }
 308  
 309      /**
 310      * Get navbar as array to eg. set as vars for a template (from idots' navbar.inc.php)
 311      *
 312      * Reimplemented so set the vars for the navbar itself (uses $this->tpl and the blocks a and b)
 313      *
 314      * @internal PHP5 protected
 315      * @param array $apps navbar apps from _get_navbar_apps
 316      * @return array
 317      */
 318  	function _get_navbar($apps)
 319      {
 320          $var = parent::_get_navbar($apps);
 321  
 322          if($GLOBALS['egw_info']['user']['userid'] == 'anonymous')
 323          {
 324              $config_reg = config::read('registration');
 325  
 326              $this->tpl->set_var(array(
 327                  'url'   => $GLOBALS['egw']->link('/logout.php'),
 328                  'title' => lang('Login'),
 329              ));
 330              $this->tpl->fp('upper_tabs','upper_tab_block');
 331              if ($config_reg[enable_registration]=='True' && $config_reg[register_link]=='True')
 332              {
 333                  $this->tpl->set_var(array(
 334                      'url'   => $GLOBALS['egw']->link('/registration/index.php'),
 335                      'title' => lang('Register'),
 336                  ));
 337              }
 338          }
 339          else
 340          {
 341              $this->tpl->set_var('upper_tabs','');
 342          }
 343  
 344          if (html::$ua_mobile)
 345          {
 346              $max_icons = 0;
 347              $this->tpl->set_var('app_icons','');
 348          }
 349          elseif (!($max_icons=$GLOBALS['egw_info']['user']['preferences']['common']['max_icons']))
 350          {
 351              $max_icons = 30;
 352          }
 353  
 354          if($GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] == 'no' && !html::$ua_mobile)
 355          {
 356              $tdwidth = 100 / $max_icons;
 357          }
 358          else
 359          {
 360              $tdwidth = 100 / ($max_icons+1);    // +1 for logout
 361          }
 362          $this->tpl->set_var('tdwidth',round($tdwidth));
 363  
 364          // not shown in the navbar
 365          $i = 0;
 366          foreach($apps as $app => $app_data)
 367          {
 368              if ($app != 'preferences' && $app != 'about' && $app != 'logout' && $app != 'manual' &&
 369                  ($app != 'home' || $GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no') ||
 370                  html::$ua_mobile && in_array($app,array('preferences','logout','home')))
 371              {
 372                  $this->tpl->set_var($app_data);
 373  
 374                  if($i < $max_icons)
 375                  {
 376                      $this->tpl->set_var($app_data);
 377                      if($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'text')
 378                      {
 379                          $this->tpl->fp('app_icons','app_icon_block',true);
 380                      }
 381                      if($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'icons')
 382                      {
 383                          $this->tpl->fp('app_titles','app_title_block',true);
 384                      }
 385                  }
 386                  else // generate extra icon layer shows icons and/or text
 387                  {
 388                      $this->tpl->fp('app_extra_icons','app_extra_block',true);
 389                  }
 390                  $i++;
 391              }
 392          }
 393          // settings for the extra icons dif
 394          if ($i <= $max_icons)    // no extra icon div
 395          {
 396              $this->tpl->set_var('app_extra_icons_div','');
 397              $this->tpl->set_var('app_extra_icons_icon','');
 398          }
 399          else
 400          {
 401              $var['lang_close'] = lang('Close');
 402              $var['lang_show_more_apps'] = lang('show_more_apps');
 403          }
 404          if ($GLOBALS['egw_info']['user']['preferences']['common']['start_and_logout_icons'] != 'no' &&
 405              $GLOBALS['egw_info']['user']['userid'] != 'anonymous')
 406          {
 407              $this->tpl->set_var($apps['logout']);
 408              if($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'text')
 409              {
 410                  $this->tpl->fp('app_icons','app_icon_block',true);
 411              }
 412              if($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] != 'icons')
 413              {
 414                  $this->tpl->fp('app_titles','app_title_block',true);
 415              }
 416          }
 417  
 418          if($GLOBALS['egw_info']['user']['preferences']['common']['navbar_format'] == 'icons')
 419          {
 420              $var['app_titles'] = '<td colspan="'.$max_icons.'">&nbsp;</td>';
 421          }
 422          return $var;
 423      }
 424  
 425      /**
 426      * Add menu items to the topmenu template class to be displayed
 427      *
 428      * @param array $app application data
 429      * @param mixed $alt_label string with alternative menu item label default value = null
 430      * @param string $urlextra string with alternate additional code inside <a>-tag
 431      * @access protected
 432      * @return void
 433      */
 434  	function _add_topmenu_item(array $app_data,$alt_label=null)
 435      {
 436          $_item['link'] = $_item['url'] = htmlspecialchars($app_data['url']);
 437          $_item['target'] = $_item['urlextra'] = $app_data['target'];
 438          $_item['text'] = $_item['label'] = $alt_label ? $alt_label : $app_data['title'];
 439          $this->tplsav2->menuitems[] = $_item;
 440          $this->tplsav2->icon_or_star = common::image('phpgwapi','bullet');
 441      }
 442  
 443      /**
 444      * Add info items to the topmenu template class to be displayed
 445      *
 446      * @param string $content html of item
 447      * @param string $id=null
 448      * @access protected
 449      * @return void
 450      */
 451  	function _add_topmenu_info_item($content, $id=null)
 452      {
 453          $this->tplsav2->menuinfoitems[$id] = $content;
 454      }
 455  
 456      /**
 457      * Display the string with html of the topmenu if its enabled
 458      *
 459      * @param array $vars
 460      * @param array $apps
 461      * @return string
 462      */
 463  	function topmenu(array $vars,array $apps)
 464      {
 465          $this->tplsav2->menuitems = array();
 466          $this->tplsav2->menuinfoitems = array();
 467  
 468          parent::topmenu($vars,$apps);
 469  
 470          $this->tplsav2->assign('info_icons',$this->topmenu_icon_arr);
 471  
 472          return $this->tplsav2->fetch('topmenu.tpl.php');
 473      }
 474  
 475      /**
 476      * called by hooks to add an icon in the topmenu info location
 477      *
 478      * @param string $id unique element id
 479      * @param string $icon_src src of the icon image. Make sure this nog height then 18pixels
 480      * @param string $iconlink where the icon links to
 481      * @param booleon $blink set true to make the icon blink
 482      * @param mixed $tooltip string containing the tooltip html, or null of no tooltip
 483      * @access public
 484      * @return void
 485      */
 486  	function topmenu_info_icon($id,$icon_src,$iconlink,$blink=false,$tooltip=null)
 487      {
 488          $icon_arr['id'] = $id;
 489          $icon_arr['blink'] = $blink;
 490          $icon_arr['link'] = $iconlink;
 491          $icon_arr['image'] = $icon_src;
 492  
 493          if(!is_null($tooltip))
 494          {
 495              $icon_arr['tooltip'] = html::tooltip($tooltip);
 496          }
 497  
 498          $this->topmenu_icon_arr[]=$icon_arr;
 499      }
 500  
 501      /**
 502      * Returns the html from the closing div of the main application area to the closing html-tag
 503      *
 504      * @return string html or null if no footer needed/wanted
 505      */
 506  	function footer()
 507      {
 508          static $footer_done=0;
 509          if ($footer_done++) return;    // prevent multiple footers, not sure we still need this (RalfBecker)
 510  
 511          if (!isset($GLOBALS['egw_info']['flags']['nofooter']) || !$GLOBALS['egw_info']['flags']['nofooter'])
 512          {
 513              // get the (depricated) application footer
 514              $content = $this->_get_app_footer();
 515  
 516              // run the hook navbar_end
 517              // ToDo: change to return the content
 518              ob_start();
 519              $GLOBALS['egw']->hooks->process('navbar_end');
 520              $content .= ob_get_contents();
 521              ob_end_clean();
 522  
 523              // eg. javascript, which need to be at the end of the page
 524              if ($GLOBALS['egw_info']['flags']['need_footer'])
 525              {
 526                  $content .= $GLOBALS['egw_info']['flags']['need_footer'];
 527              }
 528  
 529              // do the template sets footer, former parse_navbar_end function
 530              // this closes the application area AND renders the closing body- and html-tag
 531              if (self::$navbar_done)
 532              {
 533                  if (!is_a($this->tpl,'Template')) $this->tpl = new Template(EGW_TEMPLATE_DIR);
 534                  $this->tpl->set_file(array('footer' => 'footer.tpl'));
 535                  $this->tpl->set_var($this->_get_footer());
 536                  $content .= $this->tpl->fp('out','footer');
 537              }
 538              elseif (!isset($GLOBALS['egw_info']['flags']['noheader']) || !$GLOBALS['egw_info']['flags']['noheader'] ||
 539                  self::$header_done || !empty($_GET['nonavbar']) ||
 540                  $GLOBALS['egw_info']['flags']['currentapp'] == 'admin' && empty($_GET['ajax']))
 541              {
 542                  $content .= "</body>\n</html>\n";    // close body and html tag, eg. for popups
 543              }
 544              return $content;
 545          }
 546      }
 547  
 548      /**
 549      * Parses one sidebox menu and add's the html to $this->sidebox_content for later use by $this->navbar
 550      *
 551      * @param string $appname
 552      * @param string $menu_title
 553      * @param array $file
 554      * @param string $type=null 'admin', 'preferences', 'favorites', ...
 555      */
 556  	function sidebox($appname,$menu_title,$file,$type=null)
 557      {
 558          if((!$appname || ($appname==$GLOBALS['egw_info']['flags']['currentapp'] && $file)) && is_object($this->tpl))
 559          {
 560              // fix app admin menus to use admin.admin_ui.index loader
 561              if (($type == 'admin' || $menu_title == lang('Admin')) && $appname != 'admin')
 562              {
 563                  $file = preg_replace("/^(.*)menuaction=([^&]+)(.*)$/",
 564                      '$1menuaction=admin.admin_ui.index&load=$2$3&ajax=true', $file);
 565              }
 566              $this->tpl->set_var('lang_title',$menu_title);
 567              $this->sidebox_content .= $this->tpl->fp('out','extra_blocks_header');
 568  
 569              foreach($file as $text => $url)
 570              {
 571                  if ($text === 'menuOpened') continue;
 572                  $this->sidebox_content .= $this->_sidebox_menu_item($url,$text);
 573              }
 574              $this->sidebox_content .= $this->tpl->parse('out','extra_blocks_footer');
 575          }
 576      }
 577  
 578      /**
 579      * Return a sidebox menu item
 580      *
 581      * @internal PHP5 protected
 582      * @param string $item_link
 583      * @param string $item_text
 584      * @return string
 585      */
 586  	function _sidebox_menu_item($item_link='',$item_text='')
 587      {
 588          if($item_text === '_NewLine_' || $item_link === '_NewLine_')
 589          {
 590              return $this->tpl->parse('out','extra_block_spacer');
 591          }
 592          if (strtolower($item_text) == 'grant access' && $GLOBALS['egw_info']['server']['deny_user_grants_access'])
 593          {
 594              return;
 595          }
 596  
 597          $var['icon_or_star']='<img class="sideboxstar" src="'.common::image('phpgwapi', 'bullet').'" width="9" height="9" alt="ball"/>';
 598          $var['target'] = '';
 599          if(is_array($item_link))
 600          {
 601              if(isset($item_link['icon']))
 602              {
 603                  $app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['egw_info']['flags']['currentapp'];
 604                  $var['icon_or_star'] = $item_link['icon'] ? '<img style="margin:0px 2px 0px 2px; height: 16px;" src="'.common::image($app,$item_link['icon']).'"/>' : False;
 605              }
 606              $var['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']);
 607              $var['item_link'] = $item_link['link'];
 608              if ($item_link['target'])
 609              {
 610                  if (strpos($item_link['target'], 'target=') !== false)
 611                  {
 612                      $var['target'] = $item_link['target'];
 613                  }
 614                  else
 615                  {
 616                      $var['target'] = ' target="' . $item_link['target'] . '"';
 617                  }
 618              }
 619          }
 620          else
 621          {
 622              $var['lang_item'] = lang($item_text);
 623              $var['item_link'] = $item_link;
 624          }
 625          $this->tpl->set_var($var);
 626  
 627          $block = 'extra_block_row';
 628          if ($var['item_link'] === False)
 629          {
 630              $block .= $var['icon_or_star'] === False ? '_raw' : '_no_link';
 631          }
 632          return $this->tpl->parse('out',$block);
 633      }
 634  
 635      /**
 636       * Return javascript (eg. for onClick) to open manual with given url
 637       *
 638       * @param string $url
 639       * @return string
 640       */
 641  	function open_manual_js($url)
 642      {
 643          return "egw_openWindowCentered2('$url','manual',800,600,'yes')";
 644      }
 645  }

title

Description

title

Description

title

Description

title

title

Body