- Reset accidental commit using et2

- Set current app before validating to use app-specific values (category)
This commit is contained in:
Nathan Gray 2012-06-05 16:19:02 +00:00
parent eae9b67d3c
commit 9846011ec2
2 changed files with 12 additions and 4 deletions

View File

@ -35,9 +35,9 @@ if (!isset($GLOBALS['egw_info']))
*
* @ToDo supported customized templates stored in DB, currently we only support xet files stored in filesystem
*/
//class etemplate extends etemplate_old {};
//class etemplate_new extends etemplate_widget_template
class etemplate extends etemplate_widget_template
class etemplate extends etemplate_old {};
class etemplate_new extends etemplate_widget_template
//class etemplate extends etemplate_widget_template
{
/**
* Are we running as sitemgr module or not
@ -214,6 +214,12 @@ class etemplate extends etemplate_widget_template
{
throw new egw_exception_wrong_parameter('Can NOT read template '.array2string(self::$request->template));
}
// Set current app for validation
list($app) = explode('.',self::$request->method);
if(!$app) list($app) = explode('::',self::$request->method);
if($app) $GLOBALS['egw_info']['flags']['currentapp'] = $app;
$validated = array();
$expand = array(
'cont' => &self::$request->content,

View File

@ -275,7 +275,8 @@ class etemplate_widget_menupopup extends etemplate_widget
$no_lang = True;
break;
case 'select-cat': // !$type == globals cats too, $type2: extraStyleMultiselect, $type3: application, if not current-app, $type4: parent-id, $type5=owner (-1=global),$type6=show missing
case 'select-cat': // !$type == globals cats too, $type3: extraStyleMultiselect, $type3: application, if not current-app, $type4: parent-id, $type5=owner (-1=global),$type6=show missing
error_log("---CATS: $type, 2: $type2, 3: $type3, 4: $type4, 5: $type5, 6: $type6");
if ((!$type3 || $type3 === $GLOBALS['egw']->categories->app_name) &&
(!$type5 || $type5 == $GLOBALS['egw']->categories->account_id))
{
@ -285,6 +286,7 @@ class etemplate_widget_menupopup extends etemplate_widget
{
$categories = new categories($type5,$type3);
}
error_log("--- CAT APPNAME: {$categories->app_name}");
// Allow text for global
$type = ($type && strlen($type) > 1 ? $type : !$type);
// we cast $type4 (parent) to int, to get default of 0 if omitted