[eGroupWare-svn] r55923 - in /trunk: addressbook/inc/ calendar/inc/ egroupware/home/ egroupware/home/inc/ filemanager/inc/ infolog/inc/ news_...
[email protected] Thu, 28 Apr 2016 18:06:46 -0000
| Newsgroups | gmane.comp.web.egroupware.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: ralfbecker
Date: Thu Apr 28 20:06:46 2016
New Revision: 55923
URL: http://svn.stylite.de/viewvc/egroupware?rev=55923&view=rev
Log:
use new api in home and portlets
Modified:
trunk/addressbook/inc/class.addressbook_favorite_portlet.inc.php
trunk/calendar/inc/class.calendar_favorite_portlet.inc.php
trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php
trunk/egroupware/home/inc/class.home_favorite_portlet.inc.php
trunk/egroupware/home/inc/class.home_legacy_portlet.inc.php
trunk/egroupware/home/inc/class.home_link_portlet.inc.php
trunk/egroupware/home/inc/class.home_list_portlet.inc.php
trunk/egroupware/home/inc/class.home_note_portlet.inc.php
trunk/egroupware/home/inc/class.home_portlet.inc.php
trunk/egroupware/home/inc/class.home_tutorial_ui.inc.php
trunk/egroupware/home/inc/class.home_ui.inc.php
trunk/egroupware/home/inc/class.home_weather_portlet.inc.php
trunk/egroupware/home/index.php
trunk/filemanager/inc/class.filemanager_favorite_portlet.inc.php
trunk/infolog/inc/class.infolog_favorite_portlet.inc.php
trunk/news_admin/inc/class.news_admin_favorite_portlet.inc.php
trunk/projectmanager/inc/class.projectmanager_favorite_portlet.inc.php
trunk/resources/inc/class.resources_favorite_portlet.inc.php
trunk/tracker/inc/class.tracker_favorite_portlet.inc.php
Modified: trunk/addressbook/inc/class.addressbook_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_favorite_portlet.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
-/*
+/**
* Egroupware - Addressbook - A portlet for displaying a list of entries
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package addressbook
@@ -9,6 +8,11 @@
* @author Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
/**
* The addressbook_list_portlet uses a nextmatch / favorite
@@ -24,7 +28,7 @@
public function __construct(Array &$context = array(), &$need_reload = false)
{
$context['appname'] = 'addressbook';
-
+
// Let parent handle the basic stuff
parent::__construct($context,$need_reload);
@@ -45,11 +49,11 @@
);
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$ui = new addressbook_ui();
- $this->context['sel_options']['filter'] = $this->context['sel_options']['owner'] = $ui->get_addressbooks(EGW_ACL_READ,lang('All'));
- $this->context['sel_options']['filter2'] = $ui->get_lists(EGW_ACL_READ,array('' => lang('none')));
+ $this->context['sel_options']['filter'] = $this->context['sel_options']['owner'] = $ui->get_addressbooks(Acl::READ,lang('All'));
+ $this->context['sel_options']['filter2'] = $ui->get_lists(Acl::READ,array('' => lang('none')));
$this->nm_settings['actions'] = $ui->get_actions($this->nm_settings['col_filter']['tid'], $this->nm_settings['org_view']);
parent::exec($id, $etemplate);
@@ -76,7 +80,7 @@
* output is handled by parent.
*
* @param type $id
- * @param etemplate_new $etemplate
+ * @param Etemplate $etemplate
*/
public static function process($values = array())
{
@@ -86,34 +90,33 @@
{
if (!count($values['nm']['selected']) && !$values['nm']['select_all'])
{
- egw_framework::message(lang('You need to select some entries first'));
+ Framework::message(lang('You need to select some entries first'));
}
else
{
// Some processing to add values in for links and cats
- $multi_action = $values['nm']['action'];
- $success = $failed = $action_msg = null;
+ $success = $failed = $action_msg = $msg = null;
if ($ui->action($values['nm']['action'],$values['nm']['selected'],$values['nm']['select_all'],
$success,$failed,$action_msg,$values['do_email'] ? 'email' : 'index',$msg,$values['nm']['checkboxes']))
{
$msg .= lang('%1 contact(s) %2',$success,$action_msg);
- egw_json_response::get()->apply('egw.message',array($msg,'success'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'success'));
foreach($values['nm']['selected'] as &$id)
{
$id = 'addressbook::'.$id;
}
// Directly request an update - this will get addressbook tab too
- egw_json_response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected']));
+ Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected']));
}
elseif(is_null($msg))
{
$msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
elseif($msg)
{
$msg .= "\n".lang('%1 entries %2, %3 failed.',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
unset($values['nm']['action']);
unset($values['nm']['select_all']);
Modified: trunk/calendar/inc/class.calendar_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/inc/class.calendar_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/calendar/inc/class.calendar_favorite_portlet.inc.php (original)
+++ trunk/calendar/inc/class.calendar_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,14 +1,18 @@
<?php
-
-/*
- * Egroupware - Addressbook - A portlet for displaying a list of entries
+/**
+ * Egroupware - Calendar - A portlet for displaying a list of entries
+ *
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
- * @package addressbook
+ * @package calendar
* @subpackage home
* @link http://www.egroupware.org
* @author Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Etemplate;
/**
* The addressbook_list_portlet uses a nextmatch / favorite
@@ -32,7 +36,6 @@
if($this->favorite['state']['view'] == 'listview')
{
- $ui = new calendar_uilist();
$this->context['template'] = 'calendar.list.rows';
$this->context['sel_options'] = array();
$this->nm_settings += array(
@@ -55,16 +58,16 @@
$need_reload = $reload && $need_reload;
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
// Always load app's javascript, so most actions have a chance of working
- egw_framework::validate_file('.','app',$this->context['appname']);
+ Framework::includeJS('.','app',$this->context['appname']);
// Always load app's css
- egw_framework::includeCSS('calendar', 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) ||
- egw_framework::includeCSS('calendar','app');
-
+ Framework::includeCSS('calendar', 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) ||
+ Framework::includeCSS('calendar','app');
+
if($this->favorite['state']['view'] == 'listview' || is_array($this->favorite) && !$this->favorite['state']['view'])
{
$ui = new calendar_uilist();
@@ -98,11 +101,8 @@
case 'listview':
$this->context['sel_options']['filter'] = &$ui->date_filters;
$this->nm_settings['actions'] = $ui->get_actions($this->nm_settings['col_filter']['tid'], $this->nm_settings['org_view']);
-
// Early exit
return parent::exec($id, $etemplate);
-
- break;
case 'planner_user':
case 'planner_cat':
@@ -121,7 +121,7 @@
$etemplate->read('calendar.view');
$etemplate->set_dom_id($id);
$this->actions =& $etemplate->getElementAttribute('view', 'actions');
-
+
$ui->month($this->favorite['state']['view'] == 'month' ?
0 :
(int)$ui->cal_prefs['multiple_weeks'],
@@ -150,7 +150,7 @@
unset($GLOBALS['egw_info']['flags']['app_header']);
// Force loading of CSS
- egw_framework::include_css_js_response();
+ Framework::include_css_js_response();
// Set this to calendar so app.js gets initialized
$old_app = $GLOBALS['egw_info']['flags']['currentapp'];
@@ -184,8 +184,7 @@
* Here we need to handle any incoming data. Setup is done in the constructor,
* output is handled by parent.
*
- * @param type $id
- * @param etemplate_new $etemplate
+ * @param $values =array()
*/
public static function process($values = array())
{
@@ -195,39 +194,39 @@
{
if (!count($values['nm']['selected']) && !$values['nm']['select_all'])
{
- egw_framework::message(lang('You need to select some entries first'));
+ Framework::message(lang('You need to select some entries first'));
}
else
{
- $success = $failed = $action_msg = null;
+ $success = $failed = $action_msg = $msg = null;
if ($ui->action($values['nm']['action'],$values['nm']['selected'],$values['nm']['select_all'],
$success,$failed,$action_msg,'calendar_list',$msg, $values['nm']['checkboxes']['no_notifications']))
{
$msg .= lang('%1 event(s) %2',$success,$action_msg);
- egw_json_response::get()->apply('egw.message',array($msg,'success'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'success'));
foreach($values['nm']['selected'] as &$id)
{
$id = 'calendar::'.$id;
}
// Directly request an update - this will get addressbook tab too
- egw_json_response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected']));
+ Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected']));
}
elseif(is_null($msg))
{
$msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
elseif($msg)
{
$msg .= "\n".lang('%1 entries %2, %3 failed.',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
unset($values['nm']['action']);
unset($values['nm']['select_all']);
}
}
}
-
+
/**
* No filters default favorite causes problems with calendar's special state handling,
* so just remove it.
Modified: trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_birthday_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
- /*
+/**
* Egroupware
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package home
@@ -10,13 +9,16 @@
* @version $Id$
*/
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
/**
* Show birthdays
*
*/
- class home_birthday_portlet extends home_portlet {
- /**
+ class home_birthday_portlet extends home_portlet
+{
+ /**
* Constructor sets up the portlet according to the user's saved property values
* for this particular portlet. It is possible to have multiple instances of the
* same portlet with different properties.
@@ -29,6 +31,9 @@
*/
public function __construct(Array &$context = array(), &$need_reload = false)
{
+ unset($need_reload); // not used, but required by function signature
+ if (false) parent::__construct();
+
$this->context = $context;
}
@@ -57,15 +62,15 @@
*
* @param id String unique ID, provided to the portlet so it can make sure content is
* unique, if needed.
- * @param etemplate etemplate_new Etemplate to generate content
- */
- public function exec($id = null, etemplate_new &$etemplate = null)
+ * @param etemplate Etemplate Etemplate to generate content
+ */
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$content = array();
$etemplate->read('home.birthdays');
-
- if ($GLOBALS['egw_info']['server']['hide_birthdays'] != 'yes') // calendar config
+
+ if ($GLOBALS['egw_info']['server']['hide_birthdays'] != 'yes') // calendar Api\Config
{
$content = $this->get_birthdays();
}
@@ -79,7 +84,7 @@
*/
protected function get_birthdays()
{
- $contacts = new addressbook_bo();
+ $contacts = new Api\Contacts();
$month_start = date('-m-',$contacts->now_su);
$days = $this->context['days'];
$birthdays = array();
@@ -110,6 +115,7 @@
unset($month_start); unset($month_end);
if ($bdays)
{
+ $ab_lang_loaded = 0;
for($n = 0; $n <= $days; ++$n)
{
$day = date('-m-d',$contacts->now_su+$n*24*3600);
@@ -117,7 +123,7 @@
{
if(substr($contact['bday'],-6) == $day)
{
- if (!$ab_lang_loaded++) $GLOBALS['egw']->translation->add_app('addressbook');
+ if (!$ab_lang_loaded++) Api\Translation::add_app('addressbook');
switch($n)
{
case 0:
@@ -130,7 +136,7 @@
list($y,$m,$d) = explode('-',$contact['bday']);
if ($GLOBALS['egw_info']['server']['hide_birthdays'] == 'dateonly') $y = '';
$text = lang("In %1 days (%2) is %3's birthday.",$n,
- $GLOBALS['egw']->common->dateformatorder($y,$m,$d,true),
+ common::dateformatorder($y,$m,$d,true),
$contact['n_given'].' '.$contact['n_family']);
break;
}
Modified: trunk/egroupware/home/inc/class.home_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_favorite_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,5 +1,5 @@
<?php
-/**
+/***
* EGroupware - Home - A simple portlet for displaying a list of entries
*
* @link www.egroupware.org
@@ -11,6 +11,10 @@
* @version $Id: class.home_list_portlet.inc.php 49321 2014-11-06 21:40:03Z nathangray $
*/
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Etemplate;
+
/**
* The home_favorite_portlet uses a nextmatch to display the entries for a particular
@@ -26,10 +30,10 @@
'appname' => '',
'favorite' => 'blank'
);
-
+
/**
* Nextmatch settings
- * @see etemplate_widget_nextmatch
+ * @see Etemplate\Widget\Nextmatch
* @var array
*/
protected $nm_settings = array(
@@ -55,6 +59,8 @@
*/
public function __construct(Array &$context = array(), &$need_reload = false)
{
+ if (false) parent::__construct();
+
// Process dropped data (Should be [appname => <appname>, id => <favorite ID>]) into something useable
if($context['dropped_data'])
{
@@ -67,7 +73,7 @@
}
unset($context['dropped_data']);
-
+
$need_reload = true;
}
// Favorite not set for new widgets created via context menu
@@ -76,14 +82,14 @@
// Set initial size to 6x3, default is way too small
$context['width'] = max($context['width'], 6);
$context['height'] = max($context['height'], 3);
-
+
$need_reload = true;
}
// Load and copy favorite
if($context['favorite'] && !is_array($context['favorite']))
{
- $favorites = egw_favorites::get_favorites($context['appname']);
+ $favorites = Framework\Favorites::get_favorites($context['appname']);
$context['favorite'] = $favorites[$context['favorite']];
$need_reload = true;
}
@@ -101,13 +107,14 @@
}
$this->nm_settings['columnselection_pref'] = "nextmatch-home.{$this->context['id']}";
- translation::add_app($context['appname']);
- }
- public function exec($id = null, etemplate_new &$etemplate = null)
+ Api\Translation::add_app($context['appname']);
+ }
+
+ public function exec($id = null, Etemplate &$etemplate = null)
{
if($etemplate == null)
{
- $etemplate = new etemplate_new();
+ $etemplate = new Etemplate();
}
$etemplate->read('home.favorite');
@@ -121,11 +128,11 @@
// Always load app's css
- egw_framework::includeCSS($this->context['appname'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) ||
- egw_framework::includeCSS($this->context['appname'],'app');
+ Framework::includeCSS($this->context['appname'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) ||
+ Framework::includeCSS($this->context['appname'],'app');
// Always load app's javascript, so most actions have a chance of working
- egw_framework::validate_file('.','app',$this->context['appname']);
+ Framework::includeJS('.','app',$this->context['appname']);
// Set this so app's JS gets initialized
$old_app = $GLOBALS['egw_info']['flags']['currentapp'];
@@ -138,19 +145,21 @@
public static function process($content = array())
{
+ unset($content); // not used, but required by function signature
+
// We need to keep the template going, thanks.
- etemplate_widget::setElementAttribute('','','');
+ Etemplate\Widget::setElementAttribute('','','');
}
public function get_actions(){
return array();
}
-
+
/**
* Some descriptive information about the portlet, so that users can decide if
* they want it or not, and for inclusion in lists, hover text, etc.
*
- * These should be already translated, no further translation will be done.
+ * These should be already translated, no further Api\Translation will be done.
*
* @return Array with keys
* - displayName: Used in lists
@@ -171,7 +180,7 @@
* Settings should be in the same style as for preferences. It is OK to return an empty array
* for no customizable settings.
*
- * These should be already translated, no further translation will be done.
+ * These should be already translated, no further Api\Translation will be done.
*
* @see preferences/inc/class.preferences_settings.inc.php
* @return Array of settings. Each setting should have the following keys:
@@ -184,7 +193,7 @@
public function get_properties()
{
$properties = parent::get_properties();
- $favorites = egw_favorites::get_favorites($this->context['appname']);
+ $favorites = Framework\Favorites::get_favorites($this->context['appname']);
$favorite_list = array();
foreach($favorites as $id => $favorite)
{
Modified: trunk/egroupware/home/inc/class.home_legacy_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_legacy_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_legacy_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_legacy_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -11,6 +11,9 @@
* @version $Id$
*/
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
+
class home_legacy_portlet extends home_portlet
{
@@ -18,33 +21,36 @@
* Context for this portlet
*/
protected $context = array();
-
+
/**
* Custom title from hook
*/
protected $title = 'Legacy';
-
+
/**
* @var String Content generated by hook
*/
protected $content = '';
-
+
public function __construct(array &$context = array(), &$need_reload = false)
{
+ unset($need_reload); // not used, but required by function signature
+ if (false) parent::__construct();
+
$this->context = $context;
-
+
// Try to load content here, so all needed info is available
$appname = $this->context['app'];
- if(!$appname || !$GLOBALS['egw']->hooks->hook_exists('home', $appname))
+ if(!$appname || !Api\Hooks::exists('home', $appname))
{
return;
}
// Set a fallback title for if we can't extract it
$this->title = lang($this->context['app']);
-
+
// Execute hook to get content
ob_start();
- $_content = $GLOBALS['egw']->hooks->single('home',$appname);
+ $_content = Api\Hooks::single('home',$appname);
if (!$_content || $_content == 1) // content has been echoed and not returned
{
$_content = ob_get_contents();
@@ -57,24 +63,23 @@
libxml_use_internal_errors(true);
$dom->loadHTML($_content,LIBXML_NOWARNING + LIBXML_NOERROR);
$finder = new DOMXPath($dom);
-
+
// Find header for title
$title = $finder->query("//div[contains(@class,'divSideboxHeader')]/descendant::strong");
if($title->length)
{
$this->title = $title->item(0)->textContent;
}
-
+
// Remove header
$content = $finder->query("//div[contains(@class,'divSideboxHeader')]/descendant::strong/ancestor::tr");
for($i = 0; $i < $content->length; $i++)
{
$content->item($i)->parentNode->removeChild($content->item($i));
}
-
+
// Content remains
- $content = $dom->saveHTML();
- $this->content = $content;
+ $this->content = $dom->saveHTML();
}
}
@@ -90,7 +95,7 @@
* unique, if needed.
* @return string HTML fragment for display
*/
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$etemplate->read('home.legacy');
@@ -119,4 +124,3 @@
);
}
}
-?>
Modified: trunk/egroupware/home/inc/class.home_link_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_link_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_link_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_link_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -11,6 +11,11 @@
* @version $Id$
*/
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Vfs;
+use EGroupware\Api\Etemplate;
+
/**
* A single entry is displayed with its application icon and title
*/
@@ -46,6 +51,8 @@
*/
public function __construct(Array &$context = array(), &$need_reload = false)
{
+ if (false) parent::__construct();
+
// Process dropped data into something useable
if($context['dropped_data'])
{
@@ -53,9 +60,9 @@
unset($context['dropped_data']);
$need_reload = true;
}
- if($context['entry'] && is_array($context['entry']));
- {
- $this->title = $context['entry']['title'] = egw_link::title($context['entry']['app'], $context['entry']['id']);
+ if($context['entry'] && is_array($context['entry']))
+ {
+ $this->title = $context['entry']['title'] = Link::title($context['entry']['app'], $context['entry']['id']);
// Reload to get the latest title
// TODO: This is a performance hit, it would be good to do this less
@@ -90,7 +97,7 @@
* @param id String unique ID, provided to the portlet so it can make sure content is
* unique, if needed.
*/
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
// Check for custom template for app
$custom_template = false;
@@ -107,7 +114,7 @@
$etemplate->set_dom_id($id);
-
+
$content = array(
'image' => $this->image
);
@@ -117,9 +124,9 @@
{
// Always load app's css
- egw_framework::includeCSS($this->context['entry']['app'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) ||
- egw_framework::includeCSS($this->context['entry']['app'],'app');
-
+ Framework::includeCSS($this->context['entry']['app'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) ||
+ Framework::includeCSS($this->context['entry']['app'],'app');
+
try
{
$classname = $this->context['entry']['app'] . '_egw_record';
@@ -153,7 +160,7 @@
error_log("Problem loading record " . array2string($this->context['entry']));
throw $e;
}
-
+
// Set a fallback image
if($content['image'] == false)
{
@@ -173,8 +180,8 @@
{
$this->context['entry']['app'] = 'file';
$this->context['entry']['path'] = $this->context['entry']['title'] = $this->context['entry']['id'];
- $this->context['entry']['type'] = egw_vfs::mime_content_type($this->context['entry']['id']);
- $content['image'] = egw_framework::link('/api/thumbnail.php',array('path' => $this->context['entry']['id']));
+ $this->context['entry']['type'] = Vfs::mime_content_type($this->context['entry']['id']);
+ $content['image'] = Framework::link('/api/thumbnail.php',array('path' => $this->context['entry']['id']));
}
$content += $this->context;
@@ -193,7 +200,7 @@
* Settings should be in the same style as for preferences. It is OK to return an empty array
* for no customizable settings.
*
- * These should be already translated, no further translation will be done.
+ * These should be already translated, no further Api\Translation will be done.
*
* @see preferences/inc/class.preferences_settings.inc.php
* @return Array of settings. Each setting should have the following keys:
Modified: trunk/egroupware/home/inc/class.home_list_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_list_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_list_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_list_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -11,6 +11,8 @@
* @version $Id$
*/
+use EGroupware\Api\Vfs;
+use EGroupware\Api\Etemplate;
/**
* The home_list_portlet uses the link system and its associated link-list widget
@@ -38,6 +40,8 @@
*/
public function __construct(Array &$context = array(), &$need_reload = false)
{
+ if (false) parent::__construct();
+
if(!is_array($context['list'])) $context['list'] = array();
// Process dropped data (Should be GUIDs) into something useable
@@ -65,7 +69,7 @@
if($item['app'] == 'filemanager' || $item['app'] == 'file')
{
$item['app'] = 'file';
- $item['type'] = egw_vfs::mime_content_type($item['id']);
+ $item['type'] = Vfs::mime_content_type($item['id']);
// Always reload...
$need_reload = true;
@@ -78,7 +82,7 @@
* Some descriptive information about the portlet, so that users can decide if
* they want it or not, and for inclusion in lists, hover text, etc.
*
- * These should be already translated, no further translation will be done.
+ * These should be already translated, no further Api\Translation will be done.
*
* @return Array with keys
* - displayName: Used in lists
@@ -101,7 +105,7 @@
* unique, if needed.
* @return string HTML fragment for display
*/
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$etemplate->read('home.list');
@@ -119,7 +123,7 @@
{
$list['app'] = 'file';
$list['path'] = $list['title'] = $list['icon'] = $list['id'];
- $list['type'] = egw_vfs::mime_content_type($list['id']);
+ $list['type'] = Vfs::mime_content_type($list['id']);
}
}
@@ -132,7 +136,7 @@
* Settings should be in the same style as for preferences. It is OK to return an empty array
* for no customizable settings.
*
- * These should be already translated, no further translation will be done.
+ * These should be already translated, no further Api\Translation will be done.
*
* @see preferences/inc/class.preferences_settings.inc.php
* @return Array of settings. Each setting should have the following keys:
Modified: trunk/egroupware/home/inc/class.home_note_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_note_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_note_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_note_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
- /*
+/**
* Egroupware
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package home
@@ -9,6 +8,9 @@
* @author Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
/**
* A simple HTML note-to-self
@@ -24,12 +26,14 @@
public $public_functions = array(
'edit' => true
);
-
+
/**
* Context for this portlet
*/
public function __construct(Array &$context = array(), &$need_reload = false)
{
+ if (false) parent::__construct();
+
// Title not set for new widgets created via context menu
if(!$context['title'])
{
@@ -39,7 +43,7 @@
$need_reload = true;
}
-
+
$this->context = $context;
}
@@ -54,34 +58,31 @@
if($content['group'] && $GLOBALS['egw_info']['apps']['admin'])
{
- $prefs = new preferences(is_numeric($group) ? $group : $GLOBALS['egw_info']['user']['account_id']);
+ $prefs = new Api\Preferences(is_numeric($content['group']) ? $content['group'] : $GLOBALS['egw_info']['user']['account_id']);
}
else
{
$prefs = $GLOBALS['egw']->preferences;
}
- $type = is_numeric($group) ? "user" : $group;
- $portlets = $prefs->read_repository();
- $portlets = $portlets['home'];
+ $type = is_numeric($content['group']) ? "user" : $content['group'];
+ $arr = $prefs->read_repository();
+ $portlets = $arr['home'];
if($content['button'])
{
- // Save updated preferences
+ // Save updated Api\Preferences
$portlets[$id]['note'] = $content['note'];
$prefs->add('home', $id, $portlets[$id],$type);
$prefs->save_repository(True,$type);
// Yay for AJAX submit
- egw_json_response::get()->apply('window.opener.app.home.refresh',array($id));
-
+ Api\Json\Response::get()->apply('window.opener.app.home.refresh',array($id));
+
if(key($content['button'])=='save')
{
- egw_json_response::get()->apply('window.close',array());
+ Api\Json\Response::get()->apply('window.close',array());
}
}
- $etemplate = new etemplate_new('home.note');
+ $etemplate = new Etemplate('home.note');
- $content = array(
- 'note' => $portlets[$id]['note']
- );
$etemplate->setElementAttribute('note', 'width', '99%');
$etemplate->setElementAttribute('note', 'height', $height);
$preserve = array(
@@ -89,10 +90,12 @@
'height' => $height,
'group' => $portlets[$id]['group']
);
- $etemplate->exec('home.home_note_portlet.edit',$content, array(),array('note'=>false,'save'=>false), $preserve);
+ $etemplate->exec('home.home_note_portlet.edit',array(
+ 'note' => $portlets[$id]['note']
+ ), array(),array('note'=>false,'save'=>false), $preserve);
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
// Allow to submit directly back here
if(is_array($id) && $id['id'])
@@ -107,7 +110,7 @@
if(!$content['note'])
{
$content['note'] = '';
- egw_json_response::get()->apply('app.home.note_edit',array($id));
+ Api\Json\Response::get()->apply('app.home.note_edit',array($id));
}
$etemplate->exec('home.home_note_portlet.exec',$content,array(),array('__ALL__'=>true),array('id' =>$id));
Modified: trunk/egroupware/home/inc/class.home_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -10,6 +10,8 @@
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
+
+use EGroupware\Api\Etemplate;
abstract class home_portlet
{
@@ -33,7 +35,7 @@
* @param boolean $need_reload Flag to indicate that the portlet needs to be reloaded (exec will be called)
*/
public abstract function __construct(Array &$context = array(), &$need_reload = false);
-
+
/**
* Some descriptive information about the portlet, so that users can decide if
* they want it or not, and for inclusion in lists, hover text, etc.
@@ -52,9 +54,9 @@
*
* @param id String unique ID, provided to the portlet so it can make sure content is
* unique, if needed.
- * @param etemplate etemplate_new Etemplate to generate content
+ * @param Etemplate $etemplate eTemplate to generate content
*/
- public abstract function exec($id = null, etemplate_new &$etemplate = null);
+ public abstract function exec($id = null, Etemplate &$etemplate = null);
/**
* Return a list of settings to customize the portlet.
@@ -96,7 +98,7 @@
* same id / key to override the default action.
*/
public abstract function get_actions();
-
+
/**
* If this portlet can accept, display, or otherwise handle multiple
* EgroupWare entries. Used for drag and drop processing. How the entries
Modified: trunk/egroupware/home/inc/class.home_tutorial_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_tutorial_ui.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_tutorial_ui.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_tutorial_ui.inc.php Thu Apr 28 20:06:46 2016
@@ -9,6 +9,10 @@
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Etemplate;
class home_tutorial_ui
{
@@ -32,15 +36,13 @@
if (!EGroupware\Api\Hooks::exists('sidebox_all', 'home') ||
EGroupware\Api\Hooks::exists('sidebox_all', 'home', true) != 'home_tutorial_ui::tutorial_menu')
{
- $setup_info = array();
- include(EGW_SERVER_ROOT.'/home/setup/setup.inc.php');
- $GLOBALS['egw']->hooks->register_hooks('home', $setup_info['home']['hooks']);
+ Api\Hooks::read(true);
}
//Allow youtube frame to pass the CSP check
- egw_framework::csp_frame_src_attrs(array('https://www.youtube.com'));
+ Api\Header\ContentSecurityPolicy::add('frame-src', array('https://www.youtube.com'));
- $tmpl = new etemplate_new('home.tutorial');
+ $tmpl = new Etemplate('home.tutorial');
if (!is_array($content))
{
// Get tutorial object id
@@ -92,7 +94,7 @@
else
{
$content = array();
- egw_framework::message(lang('You do not have permission to see this tutorial!'));
+ Framework::message(lang('You do not have permission to see this tutorial!'));
}
$tmpl->exec('home.home_tutorial_ui.popup', $content, $sel_options, array(), array(), 2);
@@ -103,7 +105,7 @@
*/
function ajax_data()
{
- $response = egw_json_response::get();
+ $response = Api\Json\Response::get();
$response->data(json_decode(self::getJsonData()));
}
@@ -114,13 +116,13 @@
*/
static function getJsonData()
{
- if (!($json = egw_cache::getCache(egw_cache::TREE, 'home', 'egw_tutorial_json')))
+ if (!($json = Api\Cache::getCache(Api\Cache::TREE, 'home', 'egw_tutorial_json')))
{
$json = file_get_contents('http://www.egroupware.de/videos/tutorials.json');
// Fallback tutorials.json
if (!$json) $json = file_get_contents('home/setup/tutorials.json');
// Cache the json object for two hours
- egw_cache::setCache(egw_cache::TREE, 'home', 'egw_tutorial_json', $json, 7200);
+ Api\Cache::setCache(Api\Cache::TREE, 'home', 'egw_tutorial_json', $json, 7200);
}
return $json;
@@ -132,7 +134,7 @@
*/
public static function tutorial_menu()
{
- if (html::$ua_mobile) return;
+ if (Api\Header\UserAgent::mobile()) return;
$tutorials = json_decode(self::getJsonData(),true);
$appname = $GLOBALS['egw_info']['flags']['currentapp'];
if (!is_array($tutorials[$appname])) return false;
Modified: trunk/egroupware/home/inc/class.home_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_ui.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_ui.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_ui.inc.php Thu Apr 28 20:06:46 2016
@@ -9,6 +9,10 @@
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Etemplate;
/**
* General user interface object of the Home app
@@ -37,9 +41,9 @@
self::setup_default_home();
// CSS for Gridster grid layout
- egw_framework::includeCSS('/api/js/jquery/gridster/jquery.gridster.css');
-
- $template = new etemplate_new('home.index');
+ Framework::includeCSS('/api/js/jquery/gridster/jquery.gridster.css');
+
+ $template = new Etemplate('home.index');
// Get a list of portlets
$content = array(
@@ -51,13 +55,13 @@
$GLOBALS['egw_info']['flags']['currentapp'] = 'home';
// Main screen message
- translation::add_app('mainscreen');
- $greeting = translation::translate('mainscreen_message',false,'');
+ Api\Translation::add_app('mainscreen');
+ $greeting = Api\Translation::translate('mainscreen_message',false,'');
if($greeting == 'mainscreen_message'|| empty($greeting))
{
- translation::add_app('mainscreen','en'); // trying the en one
- $greeting = translation::translate('mainscreen_message',false,'');
+ Api\Translation::add_app('mainscreen','en'); // trying the en one
+ $greeting = Api\Translation::translate('mainscreen_message',false,'');
}
if(!($greeting == 'mainscreen_message'|| empty($greeting)))
{
@@ -67,6 +71,7 @@
$template->exec('home.home_ui.index', $content);
// Now run the portlets themselves
+ $attrs = array();
foreach($content['portlets'] as $portlet => $p_data)
{
$id = $p_data['id'];
@@ -152,7 +157,7 @@
* Actual portlet content is provided by each portlet.
* @param template etemplate so attributes can be set
*/
- protected function get_user_portlets(etemplate_new &$template)
+ protected function get_user_portlets(Etemplate &$template)
{
$portlets = array();
@@ -228,9 +233,9 @@
// This should be set already, but just in case the execution path
// is different from normal...
- if(egw_json_response::isJSONResponse())
- {
- $GLOBALS['egw']->framework->response = egw_json_response::get();
+ if(Api\Json\Response::isJSONResponse())
+ {
+ $GLOBALS['egw']->framework->response = Api\Json\Response::get();
}
$classname = $context['class'];
@@ -239,7 +244,7 @@
$desc = $portlet->get_description();
// Pre-set up etemplate so it only needs done once
- $etemplate = new etemplate_new();
+ $etemplate = new Etemplate();
// Exclude common attributes changed through UI and settings lacking a type
$settings = $portlet->get_properties();
@@ -285,7 +290,7 @@
$appname = $app;
}
}
- egw_framework::validate_file('', $classname, $appname ? $appname : 'home');
+ Framework::includeJS('', $classname, $appname ? $appname : 'home');
if($full_exec)
{
@@ -320,7 +325,7 @@
break;
}
}
- if($no_pref || !$GLOBALS['egw']->hooks->hook_exists('home', $appname))
+ if($no_pref || !Api\Hooks::exists('home', $appname))
{
continue;
}
@@ -344,7 +349,7 @@
*/
protected function get_portlet_list()
{
- $list = egw_cache::getTree('home', 'portlet_classes', function() {
+ $list = Api\Cache::getTree('home', 'portlet_classes', function() {
$list = array();
$classes = array();
@@ -411,7 +416,7 @@
}, array(), 60);
// Filter list by current user's permissions
- foreach($list as $appname => $children)
+ foreach(array_keys($list) as $appname)
{
if(in_array($appname, array_keys($GLOBALS['egw_info']['apps']))) {
if(!in_array($appname, array_keys($GLOBALS['egw_info']['user']['apps'])))
@@ -457,11 +462,11 @@
// If it's a group, we'd like to know which
if($location == 'group')
{
- $options = array('account_type' => $type);
- $groups = accounts::link_query('',$options);
- foreach($groups as $gid => $name)
+ $options = array('account_type' => 'groups');
+ $groups = Api\Accounts::link_query('',$options);
+ foreach(array_keys($groups) as $gid)
{
- $prefs = new preferences($gid);
+ $prefs = new Api\Preferences($gid);
$prefs->read_repository();
if (isset($prefs->user['home'][$portlet_id]))
{
@@ -472,7 +477,7 @@
}
$actions['remove_default_'.$location] = array(
'type' => 'popup',
- 'caption' => lang('Remove as default for %1',is_numeric($location) ? accounts::id2name($location,'account_fullname') : $location),
+ 'caption' => lang('Remove as default for %1',is_numeric($location) ? Api\Accounts::id2name($location,'account_fullname') : $location),
'onExecute' => 'javaScript:app.home.set_default',
'group' => 'Admins',
'portlet_group' => $location
@@ -526,7 +531,7 @@
}
if($group && $GLOBALS['egw_info']['user']['apps']['admin'])
{
- $prefs = new preferences(is_numeric($group) ? $group : $GLOBALS['egw_info']['user']['account_id']);
+ $prefs = new Api\Preferences(is_numeric($group) ? $group : $GLOBALS['egw_info']['user']['account_id']);
}
else
{
@@ -536,7 +541,7 @@
$prefs->read_repository();
- $response = egw_json_response::get();
+ $response = Api\Json\Response::get();
if($values =='~reload~')
{
@@ -588,6 +593,7 @@
$add = true;
$classname = substr($classname, 4);
}
+ $content = null;
$portlet = $this->get_portlet($portlet_id, $context, $content, $attributes, $full_exec);
$context['class'] = get_class($portlet);
@@ -637,7 +643,7 @@
// Load the appropriate group
if($group)
{
- $prefs = new preferences(is_numeric($group) ? $group : $GLOBALS['egw_info']['user']['account_id']);
+ $prefs = new Api\Preferences(is_numeric($group) ? $group : $GLOBALS['egw_info']['user']['account_id']);
}
else
{
@@ -651,7 +657,7 @@
{
foreach($portlet_ids as $id)
{
- egw_json_response::get()->call('egw.message', lang("Set default"));
+ Api\Json\Response::get()->call('egw.message', lang("Set default"));
// Current user is setting the default, copy their settings
$settings = $GLOBALS['egw_info']['user']['preferences']['home'][$id];
$settings['group'] = $group;
@@ -666,16 +672,16 @@
{
foreach($portlet_ids as $id)
{
- egw_json_response::get()->call('egw.message', lang("Removed default"));
+ Api\Json\Response::get()->call('egw.message', lang("Removed default"));
$prefs->delete('home',$id, $type);
}
}
$prefs->save_repository(false,$type);
- // Update preferences client side for consistency
+ // Update Api\Preferences client side for consistency
$prefs = $GLOBALS['egw']->preferences;
$pref = $prefs->read_repository();
- egw_json_response::get()->call('egw.set_preferences', (array)$pref['home'], 'home');
+ Api\Json\Response::get()->call('egw.set_preferences', (array)$pref['home'], 'home');
}
/**
@@ -697,12 +703,12 @@
$lang = $preferences->default['common']['lang'];
if (empty($lang)) $lang = 'en';
- translation::add_app('calendar', $lang);
+ Api\Translation::add_app('calendar', $lang);
$weekview = lang('Weekview');
if ($GLOBALS['egw_info']['apps']['news_admin'])
{
- $cats = new categories('', 'news_admin');
+ $cats = new Api\Categories('', 'news_admin');
$cat_id_egw_org_news = $cats->name2id('egroupware.org');
}
@@ -776,12 +782,12 @@
{
foreach($prefs as $name => $value)
{
- preferences::delete_preference($app, $name, 'default');
+ Api\Preferences::delete_preference($app, $name, 'default');
$preferences->add($app, $name, $value, 'default');
}
}
// remove tutorial from home, as it is now in sidebox
- preferences::delete_preference('home', 'portlet_setup142t', 'default');
+ Api\Preferences::delete_preference('home', 'portlet_setup142t', 'default');
$preferences->delete('home', 'portlet_setup142t', 'default');
// assigning saved preferences to egw_info, which is used for this request
@@ -802,7 +808,7 @@
default:
call_user_func(array(__CLASS__, 'setup_default_home_'.str_replace('.', '_', self::CURRENT_HOME_VERSION)));
- config::save_value(self::HOME_VERSION, self::CURRENT_HOME_VERSION, 'phpgwapi');
+ Api\Config::save_value(self::HOME_VERSION, self::CURRENT_HOME_VERSION, 'phpgwapi');
break;
}
}
Modified: trunk/egroupware/home/inc/class.home_weather_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/inc/class.home_weather_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/inc/class.home_weather_portlet.inc.php (original)
+++ trunk/egroupware/home/inc/class.home_weather_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
- /*
+/**
* Egroupware Weather widget
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package home
@@ -9,6 +8,10 @@
* @author Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Etemplate;
/**
* Widget displaying the weather
@@ -33,6 +36,8 @@
*/
public function __construct(Array &$context = array(), &$need_reload = false)
{
+ if (false) parent::__construct();
+
// City not set for new widgets created via context menu
if(!$context['city'] || $context['height'] < 2)
{
@@ -42,11 +47,11 @@
}
$need_reload = true;
-
+
$this->context = $context;
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
// Allow to submit directly back here
if(is_array($id) && $id['id'])
@@ -82,11 +87,11 @@
// Caching is best done by city ID, so store that
if($content['city_id'] && (!$this->context['city_id'] || $content['city_id'] != $this->context['city_id']))
{
-
- $portlets = $GLOBALS['egw']->preferences->read_repository();
- $portlets = $portlets['home'];
-
- // Save updated preferences
+
+ $arr = $GLOBALS['egw']->preferences->read_repository();
+ $portlets = $arr['home'];
+
+ // Save updated Api\Preferences
$portlets[$id]['city_id'] = $content['city_id'];
$this->context['city'] = $portlets[$id]['city'] = $content['settings']['city'] =
$content['settings']['title'] = $content['city'] = is_array($content['city']) ? $content['city']['name'] : $content['city'];
@@ -111,11 +116,11 @@
{
$content['current']['no_current_temp'] = true;
}
-
+
// Direct to full forecast page
$content['attribution'] ='http://openweathermap.org/city/'.$content['city_id'];
-
+
$etemplate->exec('home.home_weather_portlet.exec',$content,array(),array('__ALL__'=>true),array('id' =>$id));
}
@@ -136,7 +141,8 @@
{
$query['APPID'] = self::API_KEY;
}
- $data = egw_cache::getTree('home', json_encode($query), function($query) use(&$clear_cache) {
+ $data = Api\Cache::getTree('home', json_encode($query), function($query)
+ {
$debug = false;
if($debug) error_log('Fetching fresh data from ' . static::API_URL);
@@ -158,7 +164,7 @@
if($debug)
{
error_log(__METHOD__ .' weather info:');
- foreach($data as $key => $val)
+ foreach(array_keys($data) as $key)
{
error_log($key . ': ' .array2string($data[$key]));
}
@@ -166,7 +172,7 @@
if(is_string($data['message']))
{
$desc = $this->get_description();
- egw_framework::message($desc['displayName'] . ': ' . $desc['title'] . "\n".$data['message'], 'warning');
+ Framework::message($desc['displayName'] . ': ' . $desc['title'] . "\n".$data['message'], 'warning');
return array();
}
@@ -181,11 +187,11 @@
if($data['list'])
{
$massage =& $data['list'];
-
+
for($i = 0; $i < min(count($massage), $this->context['width']); $i++)
{
$forecast =& $massage[$i];
- $forecast['day'] = egw_time::to($forecast['dt'],'l');
+ $forecast['day'] = Api\DateTime::to($forecast['dt'],'l');
self::format_forecast($forecast);
}
// Chop data to fit into portlet
Modified: trunk/egroupware/home/index.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/home/index.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/egroupware/home/index.php (original)
+++ trunk/egroupware/home/index.php Thu Apr 28 20:06:46 2016
@@ -21,9 +21,6 @@
include('../header.inc.php');
$GLOBALS['egw_info']['flags']['nonavbar']=false;
-// check and if neccessary force user to chane password
-auth::check_password_age('home','index');
-
// Home is treated specially, so a redirect won't work.
$home = new home_ui();
echo $home->index();
Modified: trunk/filemanager/inc/class.filemanager_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/filemanager/inc/class.filemanager_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/filemanager/inc/class.filemanager_favorite_portlet.inc.php (original)
+++ trunk/filemanager/inc/class.filemanager_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
-/*
+/**
* Egroupware - Filemanager - A portlet for displaying a list of entries
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package filemanager
@@ -10,13 +9,16 @@
* @version $Id$
*/
+use EGroupware\Api;
+use EGroupware\Api\Vfs;
+use EGroupware\Api\Etemplate;
+
/**
* The filemanager_list_portlet uses a nextmatch / favorite
* to display a list of entries.
*/
class filemanager_favorite_portlet extends home_favorite_portlet
{
-
/**
* Construct the portlet
*
@@ -24,11 +26,9 @@
public function __construct(Array &$context = array(), &$need_reload = false)
{
$context['appname'] = 'filemanager';
-
+
// Let parent handle the basic stuff
parent::__construct($context,$need_reload);
-
- $ui = new filemanager_ui();
$this->nm_settings += array(
'get_rows' => 'filemanager.filemanager_favorite_portlet.get_rows',
@@ -45,12 +45,12 @@
'row_modified' => 'mtime',
'parent_id' => 'dir',
'is_parent' => 'mime',
- 'is_parent_value'=> egw_vfs::DIR_MIME_TYPE,
+ 'is_parent_value'=> Vfs::DIR_MIME_TYPE,
'placeholder_actions' => array('mkdir','file_drop_mail','file_drop_move','file_drop_copy','file_drop_symlink')
);
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$this->context['sel_options']['filter'] = array(
@@ -93,7 +93,7 @@
* output is handled by parent.
*
* @param type $id
- * @param etemplate_new $etemplate
+ * @param Etemplate $etemplate
*/
public static function process($content = array())
{
@@ -104,13 +104,13 @@
if ($content['nm']['action'])
{
$msg = filemanager_ui::action($content['nm']['action'],$content['nm']['selected'],$content['nm']['path']);
- if($msg) egw_json_response::get()->apply('egw.message',array($msg));
+ if($msg) Api\Json\Response::get()->apply('egw.message',array($msg));
foreach($content['nm']['selected'] as &$id)
{
$id = 'filemanager::'.$id;
}
// Directly request an update - this will get filemanager tab too
- egw_json_response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
+ Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
}
}
}
Modified: trunk/infolog/inc/class.infolog_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/infolog/inc/class.infolog_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/infolog/inc/class.infolog_favorite_portlet.inc.php (original)
+++ trunk/infolog/inc/class.infolog_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
-/*
+/**
* Egroupware - Infolog - A portlet for displaying a list of portlet entries
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package infolog
@@ -9,6 +8,10 @@
* @author Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Etemplate;
/**
* The infolog_list_portlet uses a nextmatch / favorite
@@ -27,7 +30,7 @@
public function __construct(Array &$context = array(), &$need_reload = false)
{
$context['appname'] = 'infolog';
-
+
// Let parent handle the basic stuff
parent::__construct($context,$need_reload);
@@ -66,7 +69,7 @@
// Make sure we pass the type check
if ($query['col_filter']['info_type'])
{
- $tpl = new etemplate_new;
+ $tpl = new Etemplate;
if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type']))
{
$query['template'] = $tpl->name;
@@ -80,13 +83,12 @@
unset($GLOBALS['egw_info']['flags']['app_header']);
return $total;
}
-
+
/**
* Here we need to handle any incoming data. Setup is done in the constructor,
* output is handled by parent.
*
- * @param type $id
- * @param etemplate_new $etemplate
+ * @param $values =array()
*/
public static function process($values = array())
{
@@ -96,7 +98,7 @@
{
if (!count($values['nm']['selected']) && !$values['nm']['select_all'])
{
- egw_framework::message(lang('You need to select some entries first'));
+ Framework::message(lang('You need to select some entries first'));
}
else
{
@@ -127,28 +129,28 @@
unset($values[$multi_action.'_popup']);
unset($values[$multi_action]);
}
- $success = $failed = $action_msg = null;
+ $success = $failed = $action_msg = $msg = null;
if ($ui->action($values['nm']['multi_action'], $values['nm']['selected'], $values['nm']['select_all'],
$success, $failed, $action_msg, $values['nm'], $msg, $values['nm']['checkboxes']['no_notifications']))
{
$msg .= lang('%1 entries %2',$success,$action_msg);
- egw_json_response::get()->apply('egw.message',array($msg,'success'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'success'));
foreach($values['nm']['selected'] as &$id)
{
$id = 'infolog::'.$id;
}
// Directly request an update - this will get infolog tab too
- egw_json_response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected']));
+ Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected']));
}
elseif(is_null($msg))
{
$msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
elseif($msg)
{
$msg .= "\n".lang('%1 entries %2, %3 failed.',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
unset($values['nm']['multi_action']);
unset($values['nm']['select_all']);
Modified: trunk/news_admin/inc/class.news_admin_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/news_admin/inc/class.news_admin_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/news_admin/inc/class.news_admin_favorite_portlet.inc.php (original)
+++ trunk/news_admin/inc/class.news_admin_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
-/*
+/**
* Egroupware - News Admin - A portlet for displaying a list of entries
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package news_admin
@@ -10,6 +9,10 @@
* @version $Id$
*/
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
+
require_once(EGW_INCLUDE_ROOT.'/news_admin/inc/class.news_ui.inc.php');
/**
* The news_admin_list_portlet uses a nextmatch / favorite
@@ -17,7 +20,6 @@
*/
class news_admin_favorite_portlet extends home_favorite_portlet
{
-
/**
* Construct the portlet
*
@@ -25,11 +27,9 @@
public function __construct(Array &$context = array(), &$need_reload = false)
{
$context['appname'] = 'news_admin';
-
+
// Let parent handle the basic stuff
parent::__construct($context,$need_reload);
-
- $ui = new news_admin_ui();
$this->context['template'] = 'news_admin.index.rows';
$this->nm_settings += array(
@@ -43,11 +43,11 @@
);
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$ui = new news_ui();
- $this->context['sel_options']['filter'] = array('' => lang('All news'))+$ui->rights2cats(EGW_ACL_READ);
+ $this->context['sel_options']['filter'] = array('' => lang('All news'))+$ui->rights2cats(Acl::READ);
$this->context['sel_options']['filter2'] = array(
'content' => 'Content',
'teaser' => 'Teaser',
@@ -65,13 +65,11 @@
* Here we need to handle any incoming data. Setup is done in the constructor,
* output is handled by parent.
*
- * @param type $id
- * @param etemplate_new $etemplate
+ * @param $content =array()
*/
public static function process($content = array())
{
parent::process($content);
- $ui = new news_ui();
// This is just copy+pasted from news_ui line 235, but we don't want
// the etemplate exec to fire again.
@@ -84,7 +82,7 @@
}
if($success)
{
- egw_framework::refresh_opener($success . ' ' . lang('News deleted.'),'news_admin');
+ Framework::refresh_opener($success . ' ' . lang('News deleted.'),'news_admin');
}
}
}
Modified: trunk/projectmanager/inc/class.projectmanager_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_favorite_portlet.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
-/*
+/**
* Egroupware - Infolog - A portlet for displaying a list of portlet entries
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package projectmanager
@@ -9,6 +8,9 @@
* @author Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
/**
* The projectmanager_list_portlet uses a nextmatch / favorite
@@ -24,7 +26,7 @@
public function __construct(Array &$context = array(), &$need_reload = false)
{
$context['appname'] = 'projectmanager';
-
+
// Let parent handle the basic stuff
parent::__construct($context,$need_reload);
@@ -44,7 +46,7 @@
);
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$ui = new projectmanager_ui();
$this->nm_settings['options-filter'] = $ui->filter_labels;
@@ -81,33 +83,34 @@
*/
public static function process($content = array())
{
- parent::process($values);
+ parent::process($content);
$ui = new projectmanager_ui();
if ($content['nm']['action'])
{
if (!count($content['nm']['selected']) && !$content['nm']['select_all'])
{
$msg = lang('You need to select some entries first!');
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
else
{
+ $success = $failed = $action_msg = null;
if ($ui->action($content['nm']['action'],$content['nm']['selected'],$content['nm']['select_all'],
$success,$failed,$action_msg,'project_list',$msg,$content['nm']['checkboxes']['sources_too']))
{
$msg .= lang('%1 project(s) %2',$success,$action_msg);
- egw_json_response::get()->apply('egw.message',array($msg,'success'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'success'));
foreach($content['nm']['selected'] as &$id)
{
$id = 'projectmanager::'.$id;
}
// Directly request an update - this will get timesheet tab too
- egw_json_response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
+ Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
}
elseif(is_null($msg))
{
$msg .= lang('%1 project(s) %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
}
}
Modified: trunk/resources/inc/class.resources_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/resources/inc/class.resources_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/resources/inc/class.resources_favorite_portlet.inc.php (original)
+++ trunk/resources/inc/class.resources_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
-/*
+/**
* Egroupware - Resources - A portlet for displaying a list of entries
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package resources
@@ -10,13 +9,16 @@
* @version $Id$
*/
+use EGroupware\Api;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
+
/**
* The resources_list_portlet uses a nextmatch / favorite
* to display a list of entries.
*/
class resources_favorite_portlet extends home_favorite_portlet
{
-
/**
* Construct the portlet
*
@@ -24,11 +26,9 @@
public function __construct(Array &$context = array(), &$need_reload = false)
{
$context['appname'] = 'resources';
-
+
// Let parent handle the basic stuff
parent::__construct($context,$need_reload);
-
- $ui = new resources_ui();
$this->context['template'] = 'resources.show.rows';
$this->nm_settings += array(
@@ -48,11 +48,11 @@
);
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$ui = new resources_ui();
- $this->context['sel_options']['filter']= array(''=>lang('all categories'))+(array)$ui->bo->acl->get_cats(EGW_ACL_READ);
+ $this->context['sel_options']['filter']= array(''=>lang('all categories'))+(array)$ui->bo->acl->get_cats(Acl::READ);
$this->context['sel_options']['filter2'] = resources_bo::$filter_options;
if(!$content['nm']['filter2'])
{
@@ -67,8 +67,7 @@
* Here we need to handle any incoming data. Setup is done in the constructor,
* output is handled by parent.
*
- * @param type $id
- * @param etemplate_new $etemplate
+ * @param $content =array()
*/
public static function process($content = array())
{
@@ -93,7 +92,7 @@
if (!count($content['nm']['selected']) && !$content['nm']['select_all'])
{
$msg = lang('You need to select some entries first!');
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
else
{
@@ -103,21 +102,20 @@
{
$msg .= lang('%1 resource(s) %2',$success,$action_msg);
- egw_json_response::get()->apply('egw.message',array($msg,'success'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'success'));
foreach($content['nm']['selected'] as &$id)
{
$id = 'resources::'.$id;
}
// Directly request an update - this will get resources tab too
- egw_json_response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
+ Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
}
elseif(empty($msg))
{
$msg .= lang('%1 resource(s) %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
}
}
-
}
- }
+}
Modified: trunk/tracker/inc/class.tracker_favorite_portlet.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/tracker/inc/class.tracker_favorite_portlet.inc.php?rev=55923&r1=55922&r2=55923&view=diff
==============================================================================
--- trunk/tracker/inc/class.tracker_favorite_portlet.inc.php (original)
+++ trunk/tracker/inc/class.tracker_favorite_portlet.inc.php Thu Apr 28 20:06:46 2016
@@ -1,6 +1,5 @@
<?php
-
-/*
+/**
* Egroupware - Tracker - A portlet for displaying a list of entries on the home tab
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package tracker
@@ -9,6 +8,9 @@
* @author Nathan Gray
* @version $Id$
*/
+
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
/**
* The tracker_list_portlet uses a nextmatch / favorite
@@ -24,11 +26,9 @@
public function __construct(Array &$context = array(), &$need_reload = false)
{
$context['appname'] = 'tracker';
-
+
// Let parent handle the basic stuff
parent::__construct($context,$need_reload);
-
- $ui = new tracker_ui();
$this->context['template'] = 'tracker.index.rows';
$this->nm_settings += array(
@@ -46,7 +46,7 @@
);
}
- public function exec($id = null, etemplate_new &$etemplate = null)
+ public function exec($id = null, Etemplate &$etemplate = null)
{
$ui = new tracker_ui();
@@ -68,7 +68,7 @@
);
$this->nm_settings['actions'] = $ui->get_actions($tracker, $this->nm_settings['cat_id']);
- // disable start date / due date column, if disabled in config
+ // disable start date / due date column, if disabled in Api\Config
if(!$ui->show_dates)
{
// Need to set each field so parser takes the whole column
@@ -100,8 +100,7 @@
* Here we need to handle any incoming data. Setup is done in the constructor,
* output is handled by parent.
*
- * @param type $id
- * @param etemplate_new $etemplate
+ * @param $content =array()
*/
public static function process($content = array())
{
@@ -160,13 +159,13 @@
$success,$failed,$action_msg,'index',$msg,$content['nm']['checkboxes']['no_notifications']))
{
$msg .= lang('%1 entries %2',$success,$action_msg);
- egw_json_response::get()->apply('egw.message',array($msg,'success'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'success'));
foreach($content['nm']['selected'] as &$id)
{
$id = 'tracker::'.$id;
}
// Directly request an update - this will get tracker tab too
- egw_json_response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
+ Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected']));
}
else
{
@@ -174,7 +173,7 @@
{
$msg = lang('%1 entries %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
}
- egw_json_response::get()->apply('egw.message',array($msg,'error'));
+ Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
}
}
}
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z