From fd2bc6d7b76437bc765fce65c4a5531cae54a7a5 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 4 Apr 2016 08:48:04 +0000 Subject: [PATCH] fix problems with autoloading of etemplate_widget_tree --- admin/inc/class.admin_ui.inc.php | 20 ++++++++++-------- etemplate/inc/class.etemplate_widget.inc.php | 7 ------- .../inc/class.etemplate_widget_tree.inc.php | 21 +++++++++++++++++++ mail/inc/class.mail_ui.inc.php | 8 +++---- 4 files changed, 36 insertions(+), 20 deletions(-) create mode 100644 etemplate/inc/class.etemplate_widget_tree.inc.php diff --git a/admin/inc/class.admin_ui.inc.php b/admin/inc/class.admin_ui.inc.php index 1ccc58b3ae..a9874d0db7 100644 --- a/admin/inc/class.admin_ui.inc.php +++ b/admin/inc/class.admin_ui.inc.php @@ -5,11 +5,13 @@ * @link http://www.egroupware.org * @author Ralf Becker * @package admin - * @copyright (c) 2013-14 by Ralf Becker + * @copyright (c) 2013-16 by Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @version $Id$ */ +use EGroupware\Api; + /** * UI for admin */ @@ -41,7 +43,7 @@ class admin_ui { $_GET['load'] = 'admin.admin_statistics.submit'; } - $tpl = new etemplate_new('admin.index'); + $tpl = new Api\Etemplate('admin.index'); if (!is_array($content)) $content = array(); $content['nm'] = array( @@ -206,7 +208,7 @@ class admin_ui ), ); // generate urls for add/edit accounts via addressbook - $edit = egw_link::get_registry('addressbook', 'edit'); + $edit = Api\Link::get_registry('addressbook', 'edit'); $edit['account_id'] = '$id'; foreach($edit as $name => $val) { @@ -302,9 +304,9 @@ class admin_ui foreach($rows as &$row) { $row['status'] = self::$accounts->is_expired($row) ? - lang('Expired').' '.egw_time::to($row['account_expires'], true) : + lang('Expired').' '.Api\DateTime::to($row['account_expires'], true) : (!self::$accounts->is_active($row) ? lang('Disabled') : - ($row['account_expires'] != -1 ? lang('Expires').' '.egw_time::to($row['account_expires'], true) : + ($row['account_expires'] != -1 ? lang('Expires').' '.Api\DateTime::to($row['account_expires'], true) : lang('Enabled'))); if (!self::$accounts->is_active($row)) $row['status_class'] = 'adminAccountInactive'; @@ -318,7 +320,7 @@ class admin_ui */ public static function ajax_tree() { - etemplate_widget_tree::send_quote_json(self::tree_data(!empty($_GET['id']) ? $_GET['id'] : '/')); + Api\Etemplate\Widget\Tree::send_quote_json(self::tree_data(!empty($_GET['id']) ? $_GET['id'] : '/')); } /** @@ -373,7 +375,7 @@ class admin_ui } if (!empty($data['icon'])) { - $icon = etemplate_widget_tree::imagePath($data['icon']); + $icon = Api\Etemplate\Widget\Tree::imagePath($data['icon']); if ($data['child'] || $data['item']) { $data['im1'] = $data['im2'] = $icon; @@ -394,8 +396,8 @@ class admin_ui $path .= ($path == '/' ? '' : '/').$part; if (!isset($parent[$path])) { - $icon = etemplate_widget_tree::imagePath($part == 'apps' ? common::image('phpgwapi', 'home') : - (($i=common::image($part, 'navbar')) ? $i : common::image('phpgwapi', 'nonav'))); + $icon = Api\Etemplate\Widget\Tree::imagePath($part == 'apps' ? Api\Image::find('phpgwapi', 'home') : + (($i=Api\Image::find($part, 'navbar')) ? $i : Api\Image::find('phpgwapi', 'nonav'))); $parent[$path] = array( 'id' => $path, 'text' => $part == 'apps' ? lang('Applications') : lang($part), diff --git a/etemplate/inc/class.etemplate_widget.inc.php b/etemplate/inc/class.etemplate_widget.inc.php index 136d014f7c..267ed745ff 100644 --- a/etemplate/inc/class.etemplate_widget.inc.php +++ b/etemplate/inc/class.etemplate_widget.inc.php @@ -31,13 +31,6 @@ class etemplate_widget extends Etemplate\Widget {} */ abstract class etemplate_widget_entry extends Widget\Entry {} -/** - * eTemplate Tree widget - * - * @deprecated use Api\Etemplate\Widget\Tree - */ -class etemplate_widget_tree extends Widget\Tree {} - /** * eTemplate Select widget * diff --git a/etemplate/inc/class.etemplate_widget_tree.inc.php b/etemplate/inc/class.etemplate_widget_tree.inc.php new file mode 100644 index 0000000000..0099ce9500 --- /dev/null +++ b/etemplate/inc/class.etemplate_widget_tree.inc.php @@ -0,0 +1,21 @@ + + * @copyright 2002-16 by RalfBecker@outdoor-training.de + * @version $Id$ + */ + +use EGroupware\Api\Etemplate\Widget\Tree; + +/** + * eTemplate Tree widget + * + * @deprecated use Api\Etemplate\Widget\Tree + */ +class etemplate_widget_tree extends Tree {} diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 838193faf0..4b2b7d9cfb 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -251,8 +251,8 @@ class mail_ui static function ajax_tree_autoloading ($_id = null) { $mail_ui = new mail_ui(); - $_id = $_id? $_id:$_GET['id']; - etemplate_widget_tree::send_quote_json($mail_ui->mail_tree->getTree($_id,'',1,false)); + $id = $_id ? $_id : $_GET['id']; + Api\Etemplate\Widget\Tree::send_quote_json($mail_ui->mail_tree->getTree($id,'',1,false)); } /** @@ -808,7 +808,7 @@ class mail_ui $data = $this->mail_tree->getTree($nodeID,$_profileID,0, false,$subscribedOnly,!$this->mail_bo->mailPreferences['showAllFoldersInFolderPane']); } if (!is_null($_nodeID)) return $data; - etemplate_widget_tree::send_quote_json($data); + Api\Etemplate\Widget\Tree::send_quote_json($data); } /** @@ -4842,7 +4842,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2); { $mail_ui = new mail_ui(); $_id = $_id? $_id:$_GET['id']; - etemplate_widget_tree::send_quote_json($mail_ui->mail_tree->getTree($_id,'',1,true,false,false,false)); + Api\Etemplate\Widget\Tree::send_quote_json($mail_ui->mail_tree->getTree($_id,'',1,true,false,false,false)); } /**