Index: /extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php =================================================================== --- /extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php (revision 6173) +++ /extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php (revision 6174) @@ -100,4 +100,49 @@ + /** + * this function is called by the request builder to make the search page, and + * must return the HTML & JS code of the dialogbox used to select criterion + * + * Notes : + * - the dialogbox is a JS object with a public method 'show' + * - when the method show is called, one parameter is given by the request + * builder ; the parameter is an object defined as this : + * { + * cBuilder: an instance of the criteriaBuilder object used in the page, + * } + * + * + * + * + * @param String $mode : can take 'admin' or 'public' values, allowing to + * return different interface if needed + * @return String : HTML formatted value + */ + static public function getInterfaceContent($mode='admin') + { + return(""); + } + + /** + * this function returns the label displayed in the criterion menu + * + * @return String : label displayed in the criterions menu + */ + static public function getInterfaceLabel() + { + return(l10n('gpc_rb_unknown_interface')); + } + + /** + * this function returns the name of the dialog box class + * + * @return String : name of the dialogbox class + */ + static public function getInterfaceDBClass() + { + return(''); + } + + } @@ -119,5 +164,5 @@ * @return Boolean : true if registering is Ok, otherwise false */ - static public function register($pluginName, $fileName) + static public function register($pluginName, $fileName, $dialogBoxObject) { $config=Array(); @@ -127,4 +172,5 @@ 'name' => $pluginName, 'fileName' => $fileName, + 'dialogBox' => $dialogBoxObject, 'date' => date("Y-m-d H:i:s"), 'version' => self::$version, @@ -880,4 +926,47 @@ + + /** + * display search page + */ + static public function displaySearchPage() + { + global $template, $lang; + + load_language('rbuilder.lang', GPC_PATH); + + $template->set_filename('gpc_search_page', + dirname(dirname(__FILE__)).'/templates/GPCRequestBuilder_search.tpl'); + + $registeredPlugin=self::getRegistered(); + $dialogBox=Array(); + foreach($registeredPlugin as $key=>$val) + { + if(array_key_exists($key, $registeredPlugin)) + { + if(file_exists($registeredPlugin[$key]['fileName'])) + { + include_once($registeredPlugin[$key]['fileName']); + + $dialogBox[]=Array( + 'handle' => $val['name'].'DB', + 'dialogBoxClass' => call_user_func(Array('RBCallBack'.$key, 'getInterfaceDBClass')), + 'label' => call_user_func(Array('RBCallBack'.$key, 'getInterfaceLabel')), + 'content' => call_user_func(Array('RBCallBack'.$key, 'getInterfaceContent')), + ); + } + } + } + + $datas=Array( + 'dialogBox' => $dialogBox, + 'themeName' => $template->get_themeconf('name'), + ); + + $template->assign('datas', $datas); + + return($template->parse('gpc_search_page', true)); + } //displaySearchPage + } Index: /extensions/GrumPluginClasses/classes/GPCTabSheet.class.inc.php =================================================================== --- /extensions/GrumPluginClasses/classes/GPCTabSheet.class.inc.php (revision 6173) +++ /extensions/GrumPluginClasses/classes/GPCTabSheet.class.inc.php (revision 6174) @@ -62,4 +62,14 @@ } + + function add($name, $caption, $url, $selected = false, $onClick='') + { + if(parent::add($name,$caption,$url,$selected)) + { + $this->sheets[$name]['onClick'] = $onClick; + return(true); + } + return(false); + } public function setClasses($classes) Index: /extensions/GrumPluginClasses/css/rbuilder.css =================================================================== --- /extensions/GrumPluginClasses/css/rbuilder.css (revision 6173) +++ /extensions/GrumPluginClasses/css/rbuilder.css (revision 6174) @@ -19,2 +19,95 @@ margin-left:0px; } + +.cPnActive, .cPnDisabled, .cPnInactive { margin:2px; padding:2px; min-width:20px; text-align:center; } +.pnInactiveclear, .pnInactiveroma { cursor:pointer; } +.pnInactiveclear:hover { background:#F1F1F1; } +.pnActiveclear { background:#F1F1F1; font-weight:bold; } +.pnInactiveroma:hover { background:#999999; color:#444444; } +.pnActiveroma { background:#999999; color:#444444; font-weight:bold; } +#iPagesNavigator ul { margin:0px; } + + +.cbGroup { border-width:1px; border-style:solid; padding:0px; margin:2px; min-height:30px; list-style:none; } +.cbItem { padding:2px; margin:8px; min-height:34px; list-style:none; } + +#iListSelectedCriterions { padding:0px; } + +#dragHelper ul li.cbItem { padding:2px; } +#dragHelper ul li { + clear:both; + min-height:32px; + list-style-image:none; + list-style-position:outside; + list-style-type:none; + margin:4px; + padding:0px; +} + +.cbItemButtons { padding:2px; } +.cbItem img { cursor: pointer; } + +.cbSortHandle { cursor:move; } + + +.helper { + border:2px dashed #777777; +} + +div.cbOperator { + cursor:pointer; + padding:4px; + text-align:left; + font-weight:bold; +} + +div.cbOperatorBgroma { + background:#333333; +} + +div.cbOperatorBgclear { + background:#dbe8f3; +} + +.cbButtons { + float:left; + margin:2px; + padding:8px; + height:15px; +} + + +div#iMenuCriterions div#iMenuCItems { + display:none; + list-style-type:none; + max-height:30px; + position:absolute; + padding:0px; + margin:36px 2px 2px; +} + + +div#iMenuCriterions ul { + padding:2px; +} + +div#iMenuCriterions ul li { + list-style-type:none; + padding:4px; +} + +div#iMenuCriterions:hover div#iMenuCItems +{ + cursor:pointer; + display:block; +} + +div#iMenuCriterions:hover div#iMenuCTitle +{ + margin-bottom:0px; + padding-bottom:11px; +} + +div#iMenuCriterions div#iMenuCTitle +{ + margin-bottom:3px; Index: /extensions/GrumPluginClasses/language/fr_FR/rbuilder.lang.php =================================================================== --- /extensions/GrumPluginClasses/language/fr_FR/rbuilder.lang.php (revision 6174) +++ /extensions/GrumPluginClasses/language/fr_FR/rbuilder.lang.php (revision 6174) @@ -0,0 +1,13 @@ + Index: /extensions/GrumPluginClasses/templates/GPCRequestBuilder_search.tpl =================================================================== --- /extensions/GrumPluginClasses/templates/GPCRequestBuilder_search.tpl (revision 6174) +++ /extensions/GrumPluginClasses/templates/GPCRequestBuilder_search.tpl (revision 6174) @@ -0,0 +1,298 @@ +{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} +{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"} +{known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js"} + +{known_script id="gpc.pagesNavigator" src=$ROOT_URL|@cat:"plugins/GrumPluginClasses/js/pagesNavigator.js"} + + +{literal} + +{/literal} + +{foreach from=$datas.dialogBox item=dialogBox} + {$dialogBox.content} +{/foreach} + +
+ + + + + Index: /extensions/GrumPluginClasses/templates/GPCTabSheet.tpl =================================================================== --- /extensions/GrumPluginClasses/templates/GPCTabSheet.tpl (revision 6173) +++ /extensions/GrumPluginClasses/templates/GPCTabSheet.tpl (revision 6174) @@ -1,9 +1,25 @@ {if isset($tabsheet) and count($tabsheet)}