Changeset 7175
- Timestamp:
- Oct 13, 2010, 5:22:04 PM (14 years ago)
- Location:
- extensions/GrumPluginClasses
- Files:
-
- 22 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/classes/GPCCore.class.inc.php
r6948 r7175 3 3 /* ----------------------------------------------------------------------------- 4 4 class name : GPCCore 5 class version : 1. 2.06 plugin version : 3. 2.05 class version : 1.3.0 6 plugin version : 3.3.0 7 7 date : 2010-07-28 8 8 ------------------------------------------------------------------------------ … … 20 20 | 1.2.0 | 2010/07/28 | * add the loadConfigFromFile function 21 21 | | | 22 | | |22 | 1.3.0 | 2010/10/13 | * add the addHeaderCSS, addHeaderJS functions 23 23 | | | 24 24 | | | … … 35 35 - static function unregister 36 36 - static function BBtoHTML 37 - static function addHeaderCSS 38 - static function addHeaderJS 37 39 ---------------------------------------------------------------------- */ 38 40 … … 42 44 { 43 45 static public $pluginName = "GPCCore"; 46 static protected $headerItems = array( 47 'css' => array(), 48 'js' => array() 49 ); 44 50 45 51 /* --------------------------------------------------------------------------- … … 305 311 } 306 312 313 /** 314 * used to add a css file in the header 315 * 316 * @param String $id : a unique id for the file 317 * @param String $file : the css file 318 */ 319 static public function addHeaderCSS($id, $file) 320 { 321 if(!array_key_exists($file, self::$headerItems['css'])) 322 { 323 self::$headerItems['css'][$id]=$file; 324 } 325 } 326 static public function addHeaderJS($id, $file) 327 { 328 global $template; 329 330 if(!array_key_exists($id, $template->known_scripts) and !array_key_exists($file, self::$headerItems['js'])) 331 { 332 $template->known_scripts[$id]=$url; 333 self::$headerItems['js'][$id]=$file; 334 } 335 } 336 337 /** 338 * declared as public to be accessible by the event manager, but this funcion 339 * is not aimed to be used directly 340 */ 341 static public function applyHeaderItems() 342 { 343 global $template; 344 345 foreach(self::$headerItems['css'] as $file) 346 { 347 $template->block_html_head(null, '<link rel="stylesheet" type="text/css" href="'.$file.'"/>', $template->smarty, $false); 348 } 349 350 foreach(self::$headerItems['js'] as $file) 351 { 352 $template->block_html_head(null, '<script type="text/javascript" src="'.$file.'"></script>', $template->smarty, $false); 353 } 354 } 355 307 356 } //class 308 357 358 add_event_handler('loc_end_page_header', array('GPCCore', 'applyHeaderItems')); 359 360 309 361 ?> -
extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php
r6975 r7175 466 466 $template->append('head_elements', '<script type="text/javascript" src="plugins/'.$baseName.'external/interface/interface.js"></script>'); 467 467 $template->append('head_elements', '<script type="text/javascript" src="plugins/'.$baseName.'external/inestedsortable.pack.js"></script>'); 468 $template->append('head_elements', '<script type="text/javascript" src="plugins/'.$baseName.'criteriaBuilder. js"></script>');468 $template->append('head_elements', '<script type="text/javascript" src="plugins/'.$baseName.'criteriaBuilder.packed.js"></script>'); 469 469 $template->append('head_elements', 470 470 "<script type=\"text/javascript\"> -
extensions/GrumPluginClasses/css/gpc.css
r7146 r7175 90 90 } 91 91 92 93 .ui-icon-selector {94 background:none no-repeat scroll 2px 2px;95 padding:2px;96 }97 .ui-icon-selector-icon {98 background: none no-repeat scroll 2px 2px;99 padding:2px;100 float:left;101 }102 103 104 div.roma div.ui-icon-selector {105 background-color:#444444;106 border:1px solid #666666;107 }108 div.roma div.ui-icon-selector-list {109 background-color:#444444;110 border:1px solid #666666;111 margin-top:-1px;112 }113 div.roma div.ui-icon-selector-list li.ui-icon-selector-icon:hover {114 background-color:#666666;115 }116 div.roma div.ui-icon-selector-list li.ui-icon-selector-selected-icon {117 background-color:#777777;118 }119 120 121 div.clear div.ui-icon-selector {122 background-color:#CCCCCC;123 border:1px solid #777777;124 }125 div.clear div.ui-icon-selector-list {126 background-color:#CCCCCC;127 border:1px solid #777777;128 margin-top:-1px;129 }130 div.clear div.ui-icon-selector-list li.ui-icon-selector-icon:hover {131 background-color:#777777;132 }133 div.clear div.ui-icon-selector-list li.ui-icon-selector-selected-icon {134 background-color:#888888;135 } -
extensions/GrumPluginClasses/gpc_ajax.php
r6894 r7175 16 16 * 17 17 * manage all the ajax requests 18 * 19 * known functions : 20 * - admin.rbuilder.fillCaddie 21 * - admin.categorySelector.getList 22 * 18 23 * ----------------------------------------------------------------------------- 19 24 */ … … 68 73 // check if asked function is valid 69 74 if(!( 70 $_REQUEST['ajaxfct']=='admin.rbuilder.fillCaddie' 75 $_REQUEST['ajaxfct']=='admin.rbuilder.fillCaddie' or 76 $_REQUEST['ajaxfct']=='admin.categorySelector.getList' or 77 $_REQUEST['ajaxfct']=='public.categorySelector.getList' 71 78 ) 72 79 ) $_REQUEST['ajaxfct']=''; … … 77 84 { 78 85 /* 79 * check admin. makeStats.getListvalues86 * check admin.rbuilder.fillCaddie values 80 87 */ 81 88 if($_REQUEST['ajaxfct']=="admin.rbuilder.fillCaddie") … … 88 95 if(!isset($_REQUEST['requestNumber'])) $_REQUEST['ajaxfct']=""; 89 96 } 97 98 /* 99 * check admin.categorySelector.getList values 100 */ 101 if($_REQUEST['ajaxfct']=="admin.categorySelector.getList" or 102 $_REQUEST['ajaxfct']=="public.categorySelector.getList") 103 { 104 if(!isset($_REQUEST['filter'])) $_REQUEST['filter']="accessible"; 105 106 if(!($_REQUEST['filter']=="public" or 107 $_REQUEST['filter']=="accessible" or 108 $_REQUEST['filter']=="all") 109 ) $_REQUEST['filter']="accessible"; 110 111 if(!isset($_REQUEST['galleryRoot'])) $_REQUEST['galleryRoot']="y"; 112 113 if(!($_REQUEST['galleryRoot']=="y" or 114 $_REQUEST['galleryRoot']=="n") 115 ) $_REQUEST['galleryRoot']="y"; 116 117 if(!isset($_REQUEST['tree'])) $_REQUEST['tree']="n"; 118 119 if(!($_REQUEST['tree']=="y" or 120 $_REQUEST['tree']=="n") 121 ) $_REQUEST['tree']="n"; 122 } 123 124 90 125 } 91 } 126 } //checkRequest() 92 127 93 128 … … 102 137 case 'admin.rbuilder.fillCaddie': 103 138 $result=$this->ajax_gpc_admin_rbuilderFillCaddie($_REQUEST['fillMode'], $_REQUEST['requestNumber']); 139 break; 140 case 'admin.categorySelector.getList': 141 $result=$this->ajax_gpc_admin_CategorySelectorGetList($_REQUEST['filter'], $_REQUEST['galleryRoot'], $_REQUEST['tree']); 142 break; 143 case 'public.categorySelector.getList': 144 $result=$this->ajax_gpc_public_CategorySelectorGetList($_REQUEST['filter'], $_REQUEST['galleryRoot'], $_REQUEST['tree']); 104 145 break; 105 146 } … … 141 182 } 142 183 184 185 186 /** 187 * return the list of all categories 188 * 189 * @param String $filter : 'public' or 'accessible' or 'all' 190 * @param String $galleryRoot : 'y' if the gallery root is in the list 191 * @param String $tree : 'y' to obtain a recursive array, 'n' to obtain a flat array 192 * @return String : json string 193 */ 194 private function ajax_gpc_admin_CategorySelectorGetList($filter, $galleryRoot, $tree) 195 { 196 global $user; 197 198 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCategorySelector.class.inc.php'); 199 200 $categorySelector=new GPCCategorySelector( 201 array( 202 'filter' => $filter, 203 'galleryRoot' => ($galleryRoot=='y')?true:false, 204 'tree' => ($tree=='y')?true:false, 205 'userMode' => 'admin' 206 ) 207 ); 208 209 $returned=array( 210 'userId' => $user['id'], 211 'nbCategories' => 0, 212 'categories' => $categorySelector->getCategoryList(), 213 'status' => array( 214 0=>l10n('Private'), 215 1=>l10n('Public') 216 ) 217 ); 218 $returned['nbCategories']=count($returned['categories']); 219 220 return(json_encode($returned)); 221 } //ajax_gpc_admin_CategorySelectorGetList 222 223 224 /** 225 * return the list of all categories 226 * 227 * @param String $filter : 'public' or 'accessible' or 'all' 228 * @param String $galleryRoot : 'y' if the gallery root is in the list 229 * @param String $tree : 'y' to obtain a recursive array, 'n' to obtain a flat array 230 * @param String $userMode : 'public' or 'admin' 231 * @return String : json string 232 */ 233 private function ajax_gpc_public_CategorySelectorGetList($filter, $galleryRoot, $tree) 234 { 235 global $user; 236 237 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCategorySelector.class.inc.php'); 238 239 $categorySelector=new GPCCategorySelector( 240 array( 241 'filter' => $filter, 242 'galleryRoot' => ($galleryRoot=='y')?true:false, 243 'tree' => ($tree=='y')?true:false, 244 'userMode' => 'public' 245 ) 246 ); 247 248 $returned=array( 249 'userId' => $user['id'], 250 'nbCategories' => 0, 251 'categories' => $categorySelector->getCategoryList(), 252 'status' => array( 253 0=>l10n('Private'), 254 1=>l10n('Public') 255 ) 256 ); 257 $returned['nbCategories']=count($returned['categories']); 258 259 return(json_encode($returned)); 260 } //ajax_gpc_public_CategorySelectorGetList 261 262 263 143 264 } //class 144 265 -
extensions/GrumPluginClasses/js/criteriaBuilder.js
r7142 r7175 69 69 { 70 70 var itemsId = { 71 group:'iCbGroup', 72 item:'iCbItem', 73 container:container, 74 } 75 76 var counters = { 77 group:0, 78 item:0, 79 } 80 81 var options = { 82 textAND:'AND', 83 textOR:'OR', 84 textHint:'', 85 classGroup:'', 86 classItem:'', 87 classOperator:'', 88 classHelper:'helper', 89 opacity:0.8, 90 onEdit:null, 91 onDelete:null, 92 onRequestSuccess:null, 93 onRequestError:null, 94 onGetPageSuccess:null, 95 onGetPageError:null, 96 imgEditUrl:'', 97 imgDeleteUrl:'', 98 ajaxUrl:'', 99 }; 100 101 var extraData = new Array(); 71 group:'iCbGroup', 72 item:'iCbItem', 73 container:container, 74 }, 75 counters = { 76 group:0, 77 item:0, 78 }, 79 options = { 80 textAND:'AND', 81 textOR:'OR', 82 textHint:'', 83 classGroup:'', 84 classItem:'', 85 classOperator:'', 86 classHelper:'helper', 87 opacity:0.8, 88 onEdit:null, 89 onDelete:null, 90 onRequestSuccess:null, 91 onRequestError:null, 92 onGetPageSuccess:null, 93 onGetPageError:null, 94 imgEditUrl:'', 95 imgDeleteUrl:'', 96 ajaxUrl:'', 97 }, 98 extraData = new Array(); 102 99 103 100 if(arguments.length==2) … … 213 210 break; 214 211 } 215 } 212 }; 216 213 217 214 /** … … 243 240 244 241 applyNested(); 245 } 242 }; 246 243 247 244 /** … … 253 250 { 254 251 $('#'+groupId).remove(); 255 } 252 }; 256 253 257 254 /** … … 292 289 293 290 extraData[counters.item]=data; 294 } 291 }; 295 292 296 293 /** … … 309 306 manage(); 310 307 } 311 } 308 }; 312 309 313 310 /** … … 327 324 extraData[eval(re.exec(itemId)[0])]=data; 328 325 } 329 } 326 }; 330 327 331 328 /** … … 339 336 counters.group=0; 340 337 extraData=new Array(); 341 } 338 }; 342 339 343 340 /** … … 370 367 } 371 368 return(returned); 372 } 369 }; 373 370 374 371 … … 410 407 411 408 return(serialized); 412 } 409 }; 413 410 414 411 … … 423 420 424 421 return(extraData[extraDataNumber]); 425 } 422 }; 426 423 427 424 … … 433 430 { 434 431 options = jQuery.extend(options, optionsToSet); 435 } 432 }; 436 433 437 434 /** … … 465 462 } 466 463 } 467 } 464 }; 468 465 469 466 /** … … 505 502 } 506 503 ); 507 } 504 }; 508 505 509 506 /** … … 531 528 } 532 529 ); 533 } 530 }; 534 531 535 532 /** … … 554 551 $('#'+groupId+'OpOR').css('display', 'none'); 555 552 } 556 } 553 }; 557 554 558 555 /** … … 580 577 ); 581 578 582 } 579 }; 583 580 584 581 /** … … 606 603 ); 607 604 608 } 605 }; 609 606 610 607 applyNested(); -
extensions/GrumPluginClasses/js/pagesNavigator.js
r7142 r7175 56 56 { 57 57 var itemsId = { 58 first:'iNavFirst', 59 last:'iNavLast', 60 previous:'iNavPrevious', 61 next:'iNavNext', 62 pageNumber:'iNavPage', 63 morePrevious:'iNavPrevMore', 64 moreNext:'iNavNextMore', 65 container:container, 66 }; 67 68 var pages = { 69 num:0, 70 current:1, 71 } 72 73 var options = { 74 numberItem:0, 75 itemPerPage:25, 76 defaultPage:0, 77 displayNumPage:7, 78 displayFirst:true, 79 displayLast:true, 80 displayPrevious:true, 81 displayNext:true, 82 hideMode:'1,<', // "1": hide nav if only 1 page to display, "<": hide nav First, Previous, Next & Last if num of page < displayNumPage 83 textFirst:'<<', 84 textLast:'>>', 85 textPrevious:'<', 86 textNext:'>', 87 textMore:'...', 88 onPageChange:null, 89 classActive:'', 90 classInactive:'', 91 classDisabled:'', 92 }; 58 first:'iNavFirst', 59 last:'iNavLast', 60 previous:'iNavPrevious', 61 next:'iNavNext', 62 pageNumber:'iNavPage', 63 morePrevious:'iNavPrevMore', 64 moreNext:'iNavNextMore', 65 container:container, 66 }, 67 pages = { 68 num:0, 69 current:1, 70 }, 71 options = { 72 numberItem:0, 73 itemPerPage:25, 74 defaultPage:0, 75 displayNumPage:7, 76 displayFirst:true, 77 displayLast:true, 78 displayPrevious:true, 79 displayNext:true, 80 hideMode:'1,<', // "1": hide nav if only 1 page to display, "<": hide nav First, Previous, Next & Last if num of page < displayNumPage 81 textFirst:'<<', 82 textLast:'>>', 83 textPrevious:'<', 84 textNext:'>', 85 textMore:'...', 86 onPageChange:null, 87 classActive:'', 88 classInactive:'', 89 classDisabled:'', 90 }; 93 91 94 92 … … 110 108 break; 111 109 } 112 } 110 }; 113 111 114 112 /** … … 122 120 { 123 121 return(Math.ceil(numItems/numPerPage)); 124 } 122 }; 125 123 126 124 /** … … 143 141 build(); 144 142 } 145 } 143 }; 146 144 147 145 /** … … 195 193 196 194 $('#'+itemsId.container).css('visibility', 'visible'); 197 } 195 }; 198 196 199 197 … … 206 204 prev=pages.current-1; 207 205 } 208 next=options.displayNumPage-1-prev 206 next=options.displayNumPage-1-prev; 207 209 208 if(pages.current+next>=pages.num) 210 209 { … … 283 282 ); 284 283 285 } 284 }; 286 285 287 286 … … 325 324 displayNav(); 326 325 if(options.onPageChange!=null && jQuery.isFunction(options.onPageChange)) options.onPageChange(pages.current); 327 } 326 }; 328 327 329 328 if(arguments.length==2) -
extensions/GrumPluginClasses/js/simpleTip.js
r6732 r7175 81 81 function simpleTip() 82 82 { 83 var items = new Array() ;84 var itemIndexInc = 0;85 varoptions={86 name:'',87 }83 var items = new Array(), 84 itemIndexInc = 0, 85 options={ 86 name:'', 87 }; 88 88 89 89 if(arguments.length>=1) … … 134 134 break; 135 135 } 136 } 136 }; 137 137 138 138 var add = function (item, options) … … 169 169 } 170 170 171 } 171 }; 172 172 173 173 … … 191 191 items.splice(index,1); 192 192 } 193 } 193 }; 194 194 195 195 … … 216 216 } 217 217 itemIndexInc=0; 218 } 218 }; 219 219 220 220 … … 228 228 } 229 229 return(-1); 230 } 230 }; 231 231 232 232 /** … … 255 255 display: 'block', 256 256 } 257 ) 257 ); 258 258 259 259 switch(items[itemIndex].options.targetPos) … … 415 415 .addClass(items[itemIndex].options.classes); 416 416 417 } 417 }; 418 418 419 419 var show = function () 420 420 { 421 421 $('#iSimpleTip'+options.name).css('display', 'block'); 422 } 422 }; 423 423 424 424 var hide = function () 425 425 { 426 426 $('#iSimpleTip'+options.name).css('display', 'none'); 427 } 427 }; 428 428 429 429 … … 435 435 $('body').append(text); 436 436 } 437 } 437 }; 438 438 439 439 -
extensions/GrumPluginClasses/js/ui.iconSelector.js
r7146 r7175 128 128 if(opt) $.extend(options, opt); 129 129 130 if(!data) 131 { 132 $this.data('options', options); 133 options.initialized=false; 134 } 130 $this.data('options', options); 135 131 136 132 if(!properties) … … 239 235 { 240 236 // set images list values 241 this.each(function() 242 { 243 var $this=$(this); 244 privateMethods.setImages($this, list); 245 return($this); 237 return this.each(function() 238 { 239 privateMethods.setImages($(this), list); 246 240 } 247 241 ); … … 250 244 { 251 245 // return images list values 252 var data= this.data('options');253 254 if( data)255 { 256 return( data.images);246 var options = this.data('options'); 247 248 if(options) 249 { 250 return(options.images); 257 251 } 258 252 else … … 267 261 { 268 262 // set numCols values 269 this.each(function() 270 { 271 var $this=$(this); 272 privateMethods.setCols($this, value); 273 return($this); 263 return this.each(function() 264 { 265 privateMethods.setCols($(this), value); 274 266 } 275 267 ); … … 278 270 { 279 271 // return images list values 280 var data= this.data('options');281 282 if( data)283 { 284 return( data.numCols);272 var options = this.data('options'); 273 274 if(options) 275 { 276 return(options.numCols); 285 277 } 286 278 else … … 295 287 { 296 288 // set numRows values 297 this.each(function() 298 { 299 var $this=$(this); 300 privateMethods.setRows($this, value); 301 return($this); 289 return this.each(function() 290 { 291 privateMethods.setRows($(this), value); 302 292 } 303 293 ); … … 306 296 { 307 297 // return images list values 308 var data= this.data('options');309 310 if( data)311 { 312 return( data.numRows);298 var options = this.data('options'); 299 300 if(options) 301 { 302 return(options.numRows); 313 303 } 314 304 else … … 323 313 { 324 314 // set cell width values 325 this.each(function() 326 { 327 var $this=$(this); 328 privateMethods.setCellWidth($this, value); 329 return($this); 315 return this.each(function() 316 { 317 privateMethods.setCellWidth($(this), value); 330 318 } 331 319 ); … … 334 322 { 335 323 // return images list values 336 var data= this.data('options');337 338 if( data)339 { 340 return( data.cellWidth);324 var options = this.data('options'); 325 326 if(options) 327 { 328 return(options.cellWidth); 341 329 } 342 330 else … … 351 339 { 352 340 // set cell width values 353 this.each(function() 354 { 355 var $this=$(this); 356 privateMethods.setCellHeight($this, value); 357 return($this); 341 return this.each(function() 342 { 343 privateMethods.setCellHeight($(this), value); 358 344 } 359 345 ); … … 362 348 { 363 349 // return images list values 364 var data= this.data('options');365 366 if( data)367 { 368 return( data.cellHeight);350 var options = this.data('options'); 351 352 if(options) 353 { 354 return(options.cellHeight); 369 355 } 370 356 else … … 379 365 { 380 366 // set selected value 381 this.each(function() 382 { 383 var $this=$(this); 384 privateMethods.setValue($this, value); 385 return($this); 367 return this.each(function() 368 { 369 privateMethods.setValue($(this), value); 386 370 } 387 371 ); … … 390 374 { 391 375 // return the selected value 392 var data=this.data('options'),376 var options=this.data('options'), 393 377 properties=this.data('properties'); 394 378 395 if( data && properties && properties.index>-1)396 { 397 return( data.images[properties.index]);379 if(options && properties && properties.index>-1 && properties.index<options.images.length) 380 { 381 return(options.images[properties.index]); 398 382 } 399 383 else … … 408 392 { 409 393 // set selected value 410 this.each(function() 411 { 412 var $this=$(this); 413 privateMethods.setEventPopup($this, value); 414 return($this); 394 return this.each(function() 395 { 396 privateMethods.setEventPopup($(this), value); 415 397 } 416 398 ); … … 419 401 { 420 402 // return the selected value 421 var data=this.data('options');422 423 if( data)424 { 425 return( data.popup);403 var options=this.data('options'); 404 405 if(options) 406 { 407 return(options.popup); 426 408 } 427 409 else … … 436 418 { 437 419 // set selected value 438 this.each(function() 439 { 440 var $this=$(this); 441 privateMethods.setEventChange($this, value); 442 return($this); 420 return this.each(function() 421 { 422 privateMethods.setEventChange($(this), value); 443 423 } 444 424 ); … … 447 427 { 448 428 // return the selected value 449 var data=this.data('options');450 451 if( data)452 { 453 return( data.change);429 var options=this.data('options'); 430 431 if(options) 432 { 433 return(options.change); 454 434 } 455 435 else … … 458 438 } 459 439 } 460 } ,// popup461 462 } // methods440 } // popup 441 442 }; // methods 463 443 464 444 … … 470 450 updateListArea : function (object) 471 451 { 472 var data=object.data('options'),452 var options=object.data('options'), 473 453 objects=object.data('objects'), 474 454 icon=objects.list.children().first(), 475 width=icon.outerWidth()* data.numCols,476 height=icon.outerHeight()* data.numRows;455 width=icon.outerWidth()*options.numCols, 456 height=icon.outerHeight()*options.numRows; 477 457 478 458 objects.listContainer.css( … … 492 472 setImages : function (object, value) 493 473 { 494 var data=object.data('options'),474 var options=object.data('options'), 495 475 objects=object.data('objects'), 496 476 properties=object.data('properties'); 497 data.images=value;477 options.images=value; 498 478 499 479 objects.list.children().unbind(); 500 480 objects.list.html(''); 501 for(var i=0;i< data.images.length;i++)481 for(var i=0;i<options.images.length;i++) 502 482 { 503 483 liClass=' ui-icon-selector-icon '; … … 507 487 } 508 488 objects.list.append( 509 $('<li indexValue="'+i+'" class="'+liClass+'" style="display:inline-block;width:'+ data.cellWidth+'px;height:'+data.cellHeight+'px;background-image:url('+data.images[i]+');"></li>')489 $('<li indexValue="'+i+'" class="'+liClass+'" style="display:inline-block;width:'+options.cellWidth+'px;height:'+options.cellHeight+'px;background-image:url('+options.images[i]+');"></li>') 510 490 .bind('click', 511 491 {object:object}, … … 519 499 } 520 500 521 return( data.images);501 return(options.images); 522 502 }, 523 503 setNumCols : function (object, value) 524 504 { 525 var data=object.data('options'),505 var options=object.data('options'), 526 506 properties=object.data('properties'); 527 if((!properties.initialized || data.numCols!=value) && value>0)528 { 529 data.numCols=value;530 } 531 return( data.numCols);507 if((!properties.initialized || options.numCols!=value) && value>0) 508 { 509 options.numCols=value; 510 } 511 return(options.numCols); 532 512 }, 533 513 setNumRows : function (object, value) 534 514 { 535 var data=object.data('options'),515 var options=object.data('options'), 536 516 properties=object.data('properties'); 537 if((!properties.initialized || data.numRows!=value) && value>0)538 { 539 data.numRows=value;540 } 541 return( data.numRows);517 if((!properties.initialized || options.numRows!=value) && value>0) 518 { 519 options.numRows=value; 520 } 521 return(options.numRows); 542 522 }, 543 523 setCellWidth : function (object, value) 544 524 { 545 var data=object.data('options'),525 var options=object.data('options'), 546 526 properties=object.data('properties'), 547 527 objects=object.data('objects'); 548 if((!properties.initialized || data.cellWidth!=value) && value>=0)549 { 550 data.cellWidth=value;528 if((!properties.initialized || options.cellWidth!=value) && value>=0) 529 { 530 options.cellWidth=value; 551 531 objects.container.css('width', value+'px'); 552 532 } 553 return( data.cellWidth);533 return(options.cellWidth); 554 534 }, 555 535 setCellHeight : function (object, value) 556 536 { 557 var data=object.data('options'),537 var options=object.data('options'), 558 538 properties=object.data('properties'), 559 539 objects=object.data('objects'); 560 if((!properties.initialized || data.cellHeight!=value) && value>=0)561 { 562 data.cellHeight=value;540 if((!properties.initialized || options.cellHeight!=value) && value>=0) 541 { 542 options.cellHeight=value; 563 543 objects.container.css('height', value+'px'); 564 544 } 565 return( data.cellHeight);545 return(options.cellHeight); 566 546 }, 567 547 setValue : function (object, value) 568 548 { 569 var data=object.data('options'),549 var options=object.data('options'), 570 550 properties=object.data('properties'), 571 551 index=-1; … … 574 554 { 575 555 case ':first': 576 if( data.images.length>0) index=0;556 if(options.images.length>0) index=0; 577 557 break; 578 558 case ':last': 579 index= data.images.length-1;559 index=options.images.length-1; 580 560 break; 581 561 default: 582 index=$.inArray(value, data.images);562 index=$.inArray(value, options.images); 583 563 break; 584 564 } … … 588 568 privateMethods.setValueByIndex(object, index, false); 589 569 } 590 return( data.images[properties.index]);570 return(options.images[properties.index]); 591 571 }, 592 572 setValueByIndex : function (object, value, trigger) 593 573 { 594 var data=object.data('options'),574 var options=object.data('options'), 595 575 properties=object.data('properties'), 596 576 objects=object.data('objects'); 597 if((!properties.initialized || properties.index!=value) && value>-1 && value< data.images.length)577 if((!properties.initialized || properties.index!=value) && value>-1 && value<options.images.length) 598 578 { 599 579 objects.list.children('.ui-icon-selector-selected-icon').removeClass('ui-icon-selector-selected-icon'); 600 580 objects.list.children('[indexValue="'+value+'"]').addClass('ui-icon-selector-selected-icon'); 601 581 properties.index=value; 602 objects.container.css('background-image', 'url('+ data.images[properties.index]+')');603 if(trigger && data.change) object.trigger('iconSelectorChange', [properties.index]);604 } 605 return( data.images[properties.index]);582 objects.container.css('background-image', 'url('+options.images[properties.index]+')'); 583 if(trigger && options.change) object.trigger('iconSelectorChange', [properties.index]); 584 } 585 return(options.images[properties.index]); 606 586 }, 607 587 displaySelector : function (object, value) 608 588 { 609 var data=object.data('options'),589 var options=object.data('options'), 610 590 properties=object.data('properties'), 611 591 objects=object.data('objects'); … … 625 605 objects.listContainer.css('display', 'none'); 626 606 } 627 if( data.popup) object.trigger('iconSelectorPopup', [properties.selectorVisible]);607 if(options.popup) object.trigger('iconSelectorPopup', [properties.selectorVisible]); 628 608 } 629 609 return(properties.selectorVisible); … … 631 611 setEventPopup : function (object, value) 632 612 { 633 var data=object.data('options');634 data.popup=value;613 var options=object.data('options'); 614 options.popup=value; 635 615 object.unbind('iconSelectorPopup'); 636 if(value) object.bind('iconSelectorPopup', data.popup);637 return( data.popup);616 if(value) object.bind('iconSelectorPopup', options.popup); 617 return(options.popup); 638 618 }, 639 619 setEventChange : function (object, value) 640 620 { 641 var data=object.data('options');642 data.change=value;621 var options=object.data('options'); 622 options.change=value; 643 623 object.unbind('iconSelectorChange'); 644 if(value) object.bind('iconSelectorChange', data.change);645 return( data.change);624 if(value) object.bind('iconSelectorChange', options.change); 625 return(options.change); 646 626 } 647 } 627 }; 648 628 649 629 -
extensions/GrumPluginClasses/language/fr_FR/plugin.lang.php
r6106 r7175 10 10 $lang['Infos'] = 'Informations'; 11 11 $lang['Some plugins are dependent on Grum Plugin Classes: before uninstall, you must first uninstall the plugins dependent'] = 'Certains plugins sont dépendants de Grum Plugin Classes : avant le désinstaller, il faut au préalable désinstaller les plugins dépendants'; 12 13 // gpc > 3.3.0 14 $lang['Public'] = 'Publique'; 15 $lang['Private'] = 'Privée'; 16 $lang['All the gallery'] = 'Toute la galerie'; 17 12 18 ?> -
extensions/GrumPluginClasses/main.inc.php
r7146 r7175 1 1 <?php 2 2 /* 3 Plugin Name: G rum Plugins Classes.34 Version: 3.2.15 Description: Collection de classes partagées entre mes plugins (existants, ou à venir) / Partaged classes between my plugins (actuals or futures)6 Plugin URI: http://p iwigo.org/ext/extension_view.php?eid=1993 Plugin Name: GMaps 4 Version: 0.2.0 5 Description: Display and manage (google) maps 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid= 7 7 Author: grum@piwigo.org 8 Author URI: http://photos.grum.fr /8 Author URI: http://photos.grum.fr 9 9 */ 10 10 … … 12 12 -------------------------------------------------------------------------------- 13 13 Author : Grum 14 email : grum@piwigo. org14 email : grum@piwigo.com 15 15 website : http://photos.grum.fr 16 PWG user : http://forum.phpwebgallery.net/profile.php?id=3706 16 17 17 18 << May the Little SpaceFrog be with you ! >> … … 21 22 22 23 | release | date | 23 | 2.0.0 | 2008/07/20 | * convert classes for piwigo 2.0 24 | 0.1.0 | 2010-08-22 | * first lines of code 25 | | | . release not published 24 26 | | | 25 | 2.0.1 | 2008/12/28 | * convert classe tables.class.inc to php527 | 0.2.0 | 2010-09-30 | * first official release 26 28 | | | 27 | 2.0.2 | 2009/04/26 | * add setOptions/getOptions for GPCPagesNavigation class28 | | | * add option to set first/prev/next/last textes29 29 | | | 30 | 2.0.3 | 2009/07/24 | * modify common_plugin class config loader (r2.0.1)31 30 | | | 32 | 2.0.4 | 2009/11/29 | * modify users class33 31 | | | 34 | 3.0.0 | 2010/03/28 | * Uses piwigo pwg_db_* functions instead of mysql_* functions35 | | | * update classes & functions names36 | | | * include the JpegMetaData class37 32 | | | 38 | 3.0.1 | 2010/04/11 | * little bug on the template (call of an undefined var)39 | | | * Add new languages40 | | | . es_ES41 | | | . hu_HU42 | | | . it_IT43 33 | | | 44 | 3.1.0 | 2010/04/24 | * add the GPCTabSheet class45 | | | * add the GPCRequestBuilder class46 | | | * add the pageNavigator.js47 | | | * update the GPCCore class48 | | | * Add new languages49 | | | . nl_NL50 | | | . de_DE51 | | |52 | 3.1.1 | 2010/05/18 | * fix bug in the install process (CommonPlugin not53 | | | included)54 | | |55 | 3.2.0 | 2010/09/12 | * Enhance GPCTabSheet functionnalities56 | | | - possibility to choose tab classes57 | | | * Add the simpleTip.js58 | | | * Enhance GPCRequestBuilder functionnalities59 | | | - now abble to manage complex request with multi-record60 | | | - result can be stored in the caddie61 | | |62 | 3.2.1 | 2010/10/09 | * Enhance GPCTabSheet functionnalities63 | | | - add 'id' attribute for tabs (<li> items)64 | | |65 | | | * Fix JS & CSS bug with IE866 | | |67 | 3.2.2 | 2010/mm/dd | *68 | | |69 | | | ===== Don't forget to update the plugin version ! =====70 34 | | | 71 35 | | | … … 82 46 :: TO DO 83 47 84 :: WHAT ? WHY ? 85 This plugin doesn't do anything itself. It just provide classes for others plugins. 48 -------------------------------------------------------------------------------- 86 49 87 Classes version for this package 88 CommonPlugin.class.php 89 GPCAjax.class.php 90 GPCCss.class.php 91 GPCPagesNavigation.class.php 92 GPCPublicIntegration.class.php 93 GPCTables.class.php -v1.5 94 GPCTranslate.class.inc.php + google_translate.js 95 GPCUsersGroups.class.inc.php 96 GPCTabSheet.class.inc.php 50 :: NFO 51 GMaps_root : common classe for admin and public classes 52 GMaps_AIM : classe to manage plugin integration into plugin menu 53 GMaps_AIP : classe to manage plugin admin pages 54 GMaps_PIP : classe to manage plugin public pages 97 55 98 genericjs.class.inc.php + genericjs.js99 100 See each file to know more about them101 56 -------------------------------------------------------------------------------- 102 57 */ 103 58 59 // pour faciliter le debug :o) 60 //ini_set('error_reporting', E_ALL); 61 //ini_set('display_errors', true); 62 104 63 if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 105 64 106 define('GPC_DIR' , basename(dirname(__FILE__)));107 define('GPC_PATH' , PHPWG_PLUGINS_PATH . GPC_DIR . '/');108 65 109 include_once('gpc_version.inc.php'); // => Don't forget to update this file !! 110 include_once(GPC_PATH.'classes/GPCCore.class.inc.php'); 66 define('GMAPS_DIR' , basename(dirname(__FILE__))); 67 define('GMAPS_PATH' , PHPWG_PLUGINS_PATH . GMAPS_DIR . '/'); 68 69 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 70 include_once('gmaps_version.inc.php'); // => Don't forget to update this file !! 111 71 112 72 global $prefixeTable; 113 73 114 115 116 $config=Array(); 117 GPCCore::loadConfig('gpc', $config); 118 119 if(!isset($config['installed'])) $config['installed']='03.01.00'; 120 if($config['installed']!=GPC_VERSION2) 74 if(defined('IN_ADMIN')) 121 75 { 122 /* the plugin was updated without being deactivated 123 * deactivate + activate the plugin to process the database upgrade 124 */ 125 include(GPC_PATH."gpc_install.class.inc.php"); 126 $gpc=new GPC_Install($prefixeTable, __FILE__); 127 $gpc->deactivate(); 128 $gpc->activate(); 76 //GMaps admin interface loaded and active only if in admin page 77 include_once("gmaps_aim.class.inc.php"); 78 $obj=new GMaps_AIM($prefixeTable, __FILE__); 79 $obj->initEvents(); 80 } 81 else 82 { 83 if(CommonPlugin::checkGPCRelease(GMAPS_GPC_NEEDED)) 84 { 85 //GMaps public interface loaded and active only if in public page 86 include_once("gmaps_pip.class.inc.php"); 87 $obj=new GMaps_PIP($prefixeTable, __FILE__); 88 } 129 89 } 130 90 131 132 if(defined('IN_ADMIN')) 133 { 134 //GPC admin interface is loaded and active only if in admin page 135 include_once("gpc_aim.class.inc.php"); 136 137 $obj = new GPC_AIM($prefixeTable, __FILE__); 138 $obj->initEvents(); 139 set_plugin_data($plugin['id'], $obj); 140 } 91 set_plugin_data($plugin['id'], $obj); 141 92 142 93 ?> -
extensions/GrumPluginClasses/templates/GPCRequestBuilder_search.tpl
r6894 r7175 3 3 {known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js"} 4 4 5 {known_script id="gpc.pagesNavigator" src=$ROOT_URL|@cat:"plugins/GrumPluginClasses/js/pagesNavigator. js"}5 {known_script id="gpc.pagesNavigator" src=$ROOT_URL|@cat:"plugins/GrumPluginClasses/js/pagesNavigator.packed.js"} 6 6 7 7
Note: See TracChangeset
for help on using the changeset viewer.