Changeset 12215 for extensions
- Timestamp:
- Sep 24, 2011, 1:00:36 PM (13 years ago)
- Location:
- extensions/GrumPluginClasses
- Files:
-
- 8 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/classes/GPCCategorySelector.class.inc.php
r7310 r12215 301 301 $row['rank']=implode('.', $row['rank']); 302 302 303 $row['name']=GPCCore::getUserLanguageDesc($row['name']); 304 303 305 $returned[]=$row; 304 306 } -
extensions/GrumPluginClasses/classes/GPCCore.class.inc.php
r10246 r12215 3 3 /* ----------------------------------------------------------------------------- 4 4 class name : GPCCore 5 class version : 1.4. 06 plugin version : 3.5. 07 date : 2011-0 4-105 class version : 1.4.1 6 plugin version : 3.5.2 7 date : 2011-09-19 8 8 ------------------------------------------------------------------------------ 9 9 author: grum at piwigo.org … … 55 55 | 1.4.0 | 2011/04/10 | * Updated for piwigo 2.2 56 56 | | | 57 | 1.4.1 | 2011/09/19 | * Add [var] and [form_mail] markup interpreter 57 58 | | | 58 59 | | | … … 69 70 - static function unregister 70 71 - static function BBtoHTML 72 - static function VarToHTML 73 - static function FormMailToHTML 71 74 - static function addHeaderCSS 72 75 - static function addHeaderJS … … 78 81 - static function formatOctet 79 82 - static function rmDir 83 - static function applyMarkups 80 84 ---------------------------------------------------------------------- */ 81 85 … … 95 99 static public function init() 96 100 { 101 global $conf; 102 97 103 self::$piwigoSystemPath=dirname(dirname(dirname(dirname(__FILE__)))); 104 105 if(isset($conf['gpc.script.minify'])) self::setMinifiedState($conf['gpc.script.minify']); 106 107 if((isset($conf['gpc.markup.bb']) && $conf['gpc.markup.bb']) || 108 (isset($conf['gpc.markup.var']) && $conf['gpc.markup.var']) || 109 (isset($conf['gpc.markup.form']) && $conf['gpc.markup.form']) 110 ) 111 { 112 add_event_handler('render_category_name', array('GPCCore', 'applyMarkups'), EVENT_HANDLER_PRIORITY_NEUTRAL+5); 113 add_event_handler('render_category_description', array('GPCCore', 'applyMarkups'), EVENT_HANDLER_PRIORITY_NEUTRAL+5, 2); 114 add_event_handler('render_element_description', array('GPCCore', 'applyMarkups'), EVENT_HANDLER_PRIORITY_NEUTRAL+5); 115 add_event_handler('AP_render_content', array('GPCCore', 'applyMarkups'), EVENT_HANDLER_PRIORITY_NEUTRAL+5); 116 } 98 117 } 99 118 … … 108 127 Array('name' => "GPCAjax", 'version' => "3.0.0"), 109 128 Array('name' => "GPCCategorySelector", 'version' => "1.0.1"), 110 Array('name' => "GPCCore", 'version' => "1.4. 0"),129 Array('name' => "GPCCore", 'version' => "1.4.1"), 111 130 Array('name' => "GPCCss", 'version' => "3.1.0"), 112 131 Array('name' => "GPCPagesNavigation", 'version' => "2.0.0"), … … 362 381 363 382 return(preg_replace($patterns, $replacements, $text)); 383 } 384 385 /** 386 * apply [var] tag 387 * 388 * [var=<name>] 389 * with <name> : 390 * - USER 391 * - GALLERY_TITLE 392 * - NB_PHOTOS 393 * - CATEGORY 394 * - TOKEN 395 * - IP 396 * 397 * @param String $text : text to convert 398 * @return String : processed text 399 */ 400 static public function VarToHTML($text) 401 { 402 global $user, $page, $conf; 403 404 $patterns = Array( 405 '/\[var=user\]/im', 406 '/\[var=gallery_title\]/im', 407 '/\[var=nb_photos\]/im', 408 '/\[var=category\]/im', 409 '/\[var=token\]/im', 410 '/\[var=ip\]/im' 411 ); 412 $replacements = Array( 413 isset($user['username'])?$user['username']:'', 414 isset($conf['gallery_title'])?$conf['gallery_title']:'', 415 isset($user['nb_total_images'])?$user['nb_total_images']:'', 416 isset($page['category']['name'])?$page['category']['name']:'', 417 get_pwg_token(), 418 $_SERVER['REMOTE_ADDR'] 419 ); 420 421 return(preg_replace($patterns, $replacements, $text)); 422 } 423 424 /** 425 * apply [form_mail] tag 426 * 427 * @param String $text : text to convert 428 * @return String : processed text 429 */ 430 static public function FormMailToHTML($text) 431 { 432 global $template; 433 434 $file=GPCCore::getPiwigoSystemPath().'/'.PWG_LOCAL_DIR.'templates/GPCFormMsg.tpl'; 435 if(!file_exists($file)) $file=dirname(dirname(__FILE__))."/templates/GPCFormMsg.tpl"; 436 437 $template->set_filename('gpc_form', $file); 438 439 $template->assign('token', get_pwg_token() ); 440 441 $patterns = Array( 442 '/\[form_mail\]/im' 443 ); 444 $replacements = Array( 445 $template->parse('gpc_form', true) 446 ); 447 448 if(preg_match($patterns[0], $text)>0) 449 { 450 GPCCore::addHeaderJS('gpc.markup.formMail', GPC_PATH.'js/markup.formMail'.self::$minified.'.js', array('jquery')); 451 return(preg_replace($patterns, $replacements, $text)); 452 } 453 return($text); 454 } 455 456 /** 457 * apply [tab], [/tab] and [tabs] tags 458 * 459 * @param String $text : text to convert 460 * @return String : processed text 461 */ 462 static public function TabsToHTML($text) 463 { 464 $result=array(); 465 466 $tabs=''; 467 if(preg_match_all('/\[tab=([^(;\]).]*)(?:;(default))?;([^\].]*)\]/im', $text, $result, PREG_SET_ORDER)>0) 468 { 469 foreach($result as $val) 470 { 471 $tabs.="<li class='gpcTabSeparator'><a id='iGpcTab".$val[1]."' class='".($val[2]=='default'?'gpcTabSelected':'gpcTabNotSelected')."' tabId='#iGpcTabContent".$val[1]."'>".$val[3]."</a></li>"; 472 } 473 $tabs="<div id='iGpcTabs'><ul>".$tabs."</ul></div>"; 474 } 475 else return($text); 476 477 $patterns = Array( 478 '/\[tabs\]/im', 479 '/\[tab=([^(;\]).]*)(?!;default);.*\]/im', 480 '/\[tab=([^(;\]).]*);default;(.*)\]/im', 481 '/\[\/tab\]/im' 482 ); 483 $replacements = Array( 484 $tabs, 485 '<div id="iGpcTabContent\1" class="gpcTabContent" style="display:none;">', 486 '<div id="iGpcTabContent\1" class="gpcTabContent">', 487 '</div>' 488 ); 489 490 if(preg_match($patterns[0], $text)>0) 491 { 492 GPCCore::addHeaderJS('gpc.markup.tabs', GPC_PATH.'js/markup.tabs'.self::$minified.'.js', array('jquery')); 493 GPCCore::addHeaderCSS('gpc.markup.tabs', GPC_PATH.'css/gpcTabs.css'); 494 return(preg_replace($patterns, $replacements, $text)); 495 } 496 return($text); 497 } 498 499 static public function applyMarkups($text) 500 { 501 global $conf; 502 503 if(isset($conf['gpc.markup.form']) && $conf['gpc.markup.form']) 504 { 505 $text=GPCCore::FormMailToHTML($text); 506 } 507 508 if(isset($conf['gpc.markup.tabs']) && $conf['gpc.markup.tabs']) 509 { 510 $text=GPCCore::TabsToHTML($text); 511 } 512 513 if(isset($conf['gpc.markup.var']) && $conf['gpc.markup.var']) 514 { 515 $text=GPCCore::VarToHTML($text); 516 } 517 518 if(isset($conf['gpc.markup.bb']) && $conf['gpc.markup.bb']) 519 { 520 $text=GPCCore::BBtoHTML($text); 521 } 522 523 524 return($text); 364 525 } 365 526 -
extensions/GrumPluginClasses/gpc_ajax.php
r7451 r12215 25 25 * - public.tagSelector.get 26 26 * - admin.tagSelector.get 27 * - public.contact.sendMsg 27 28 * 28 29 * … … 31 32 32 33 define('PHPWG_ROOT_PATH',dirname(dirname(dirname(__FILE__))).'/'); 34 33 35 34 36 /* … … 43 45 // the common.inc.php file loads all the main.inc.php plugins files 44 46 include_once(PHPWG_ROOT_PATH.'include/common.inc.php' ); 47 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php' ); 45 48 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 46 49 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); … … 98 101 $_REQUEST['ajaxfct']=='public.categorySelector.getList' or 99 102 $_REQUEST['ajaxfct']=='public.tagSelector.get' or 100 $_REQUEST['ajaxfct']=='admin.tagSelector.get' 103 $_REQUEST['ajaxfct']=='admin.tagSelector.get' or 104 $_REQUEST['ajaxfct']=='public.contact.sendMsg' 101 105 ) 102 106 ) $_REQUEST['ajaxfct']=''; … … 192 196 } 193 197 198 /* 199 * check public.contact.sendMsg 200 */ 201 if($_REQUEST['ajaxfct']=="public.contact.sendMsg") 202 { 203 if(!isset($_REQUEST['email'])) $_REQUEST['email']=''; 204 if(!isset($_REQUEST['subject'])) $_REQUEST['subject']=''; 205 if(!isset($_REQUEST['msg'])) $_REQUEST['msg']=''; 206 if(!isset($_REQUEST['token'])) $_REQUEST['token']=''; 207 208 if($_REQUEST['token']!=get_pwg_token()) $_REQUEST['ajaxfct']=''; 209 } 210 194 211 } 195 212 } //checkRequest() … … 225 242 $result=$this->ajax_gpc_both_TagSelectorGet('public', $_REQUEST['letters'], $_REQUEST['filter'], $_REQUEST['maxTags'], $_REQUEST['ignoreCase']); 226 243 break; 244 case 'public.contact.sendMsg': 245 $result=$this->ajax_gpc_public_contactSendMsg($_REQUEST['email'], $_REQUEST['subject'], $_REQUEST['msg']); 246 break; 227 247 } 228 248 GPCAjax::returnResult($result); 229 249 } 230 250 251 252 /** 253 * check validity of an email address 254 * 255 * @param String $email : email to check 256 * @returned Boolean : 257 */ 258 private function emailAdressValid($email) 259 { 260 return(preg_match('#^[_a-z0-9\.\-]*[_a-z0-9\-]+@[_a-z0-9\.\-]+\.[a-z0-9\-]{2,}$#im', $email)>0); 261 } 231 262 232 263 … … 454 485 455 486 487 /** 488 * 489 * 490 * @param String $email : 491 * @param String $subject : 492 * @param String $msg : 493 * @param Integer $token : 494 * @return String : json string 495 */ 496 private function ajax_gpc_public_contactSendMsg($email, $subject, $msg) 497 { 498 global $user, $conf; 499 500 $returned=array('result' => false, 'msg' => ''); 501 502 if($email==null or trim($email)=='') 503 { 504 $returned['msg']=l10n('Email is mandatory'); 505 return(json_encode($returned)); 506 } 507 508 if(!$this->emailAdressValid($email)) 509 { 510 $returned['msg']=l10n('Email is not valid'); 511 return(json_encode($returned)); 512 } 513 514 if($subject==null or trim($subject)=='') 515 { 516 $returned['msg']=l10n('Subject is mandatory'); 517 return(json_encode($returned)); 518 } 519 520 if($msg==null or trim($msg)=='') 521 { 522 $returned['msg']=l10n('Message is mandatory'); 523 return(json_encode($returned)); 524 } 525 526 527 528 $admins=array(); 529 $sql="SELECT put.".$conf['user_fields']['username']." AS username, 530 put.".$conf['user_fields']['email']." AS mail_address 531 FROM ".USERS_TABLE." AS put 532 JOIN ".USER_INFOS_TABLE." AS puit 533 ON puit.user_id = put.".$conf['user_fields']['id']." 534 WHERE puit.status IN ('webmaster', 'admin') 535 AND ".$conf['user_fields']['email']." IS NOT NULL 536 AND puit.user_id <> ".$user['id']." 537 ORDER BY username;"; 538 539 $result = pwg_query($sql); 540 if($result) 541 { 542 while ($row = pwg_db_fetch_assoc($result)) 543 { 544 if(!empty($row['mail_address'])) 545 { 546 array_push($admins, format_email($row['username'], $row['mail_address'])); 547 } 548 } 549 } 550 551 $args=array( 552 'subject' => sprintf(l10n('[%s][Message from %s] %s'), $conf['gallery_title'], $email, $subject), 553 'content' => sprintf("[%s]\n%s\n%s\n--------\n%s", $_SERVER['REMOTE_ADDR'], $email, $subject, stripslashes($msg)) 554 ); 555 556 $send=pwg_mail(implode(',', $admins), $args); 557 558 if(!$send) 559 { 560 $returned['msg']=l10n('Sorry, an error has occured while sending the message to the webmaster'); 561 } 562 else 563 { 564 $returned['result']=true; 565 $returned['msg']=l10n('Your message was sent to the webmaster!'); 566 } 567 568 return(json_encode($returned)); 569 570 } 571 572 456 573 } //class 457 574 -
extensions/GrumPluginClasses/gpc_version.inc.php
r10884 r12215 15 15 if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 16 16 17 if(!defined('GPC_VERSION')) define('GPC_VERSION', '3.5. 1');18 if(!defined('GPC_VERSION2')) define('GPC_VERSION2', '03.05.0 1');17 if(!defined('GPC_VERSION')) define('GPC_VERSION', '3.5.2'); 18 if(!defined('GPC_VERSION2')) define('GPC_VERSION2', '03.05.02'); 19 19 ?> -
extensions/GrumPluginClasses/js/ui.inputConsole.js
r8961 r12215 2 2 * ----------------------------------------------------------------------------- 3 3 * file: ui.inputConsole.js 4 * file version: 1.0. 04 * file version: 1.0.1 5 5 * date: 2010-11-05 6 6 * … … 58 58 historyHeight:60, 59 59 change:null, 60 submit:null 60 submit:null, 61 submited:null, 62 focusChanged:null 61 63 }; 62 64 … … 76 78 mouseIsOver:false, 77 79 historyIsVisible:false, 78 inputMargins:0 80 inputMargins:0, 81 focus:false 79 82 } 80 83 ); … … 153 156 } 154 157 ), 158 historyBackground:$('<div/>', 159 { 160 'class':'ui-inputConsole-historyBg' 161 } 162 ), 163 historyListContainer:$('<div/>', 164 { 165 'class':'ui-inputConsole-historyListContainer' 166 } 167 ), 155 168 historyList:$('<ul/>') 156 169 … … 162 175 objects.container 163 176 .append( 164 objects.historyContainer.append(objects.historyList) 177 objects.historyContainer 178 .append(objects.historyBackground) 179 .append(objects.historyListContainer.append(objects.historyList)) 165 180 ) 166 181 .append( … … 334 349 }, // value 335 350 336 history: function (value )351 history: function (value, param) 337 352 { 338 353 var objects=this.data('objects'); … … 343 358 return this.each(function() 344 359 { 345 if(value=='clear')360 switch(value) 346 361 { 347 objects.historyList.html(''); 362 case 'clear': 363 objects.historyList.html(''); 364 break; 365 case 'addResult': 366 privateMethods.updateHistoryResult($(this), param); 367 break; 348 368 } 349 369 } … … 383 403 }, // isValid 384 404 405 focus: function (value) 406 { 407 if(value!=null) 408 { 409 // set selected value 410 return this.each(function() 411 { 412 privateMethods.setFocus($(this), value); 413 } 414 ); 415 } 416 else 417 { 418 // return the selected tags 419 var properties=this.data('properties'); 420 return(properties.focus); 421 } 422 }, // isValid 423 385 424 change: function (value) 386 425 { … … 436 475 } 437 476 } 438 } // submit 477 }, // submit 478 479 submited: function (value) 480 { 481 if(value!=null && $.isFunction(value)) 482 { 483 // set selected value 484 return this.each(function() 485 { 486 privateMethods.setEventSubmited($(this), value); 487 } 488 ); 489 } 490 else 491 { 492 // return the selected value 493 var options=this.data('options'); 494 495 if(options) 496 { 497 return(options.submited); 498 } 499 else 500 { 501 return(null); 502 } 503 } 504 }, // submited 505 506 focusChanged: function (value) 507 { 508 if(value!=null && $.isFunction(value)) 509 { 510 // set selected value 511 return this.each(function() 512 { 513 privateMethods.setEventFocusChanged($(this), value); 514 } 515 ); 516 } 517 else 518 { 519 // return the selected value 520 var options=this.data('options'); 521 522 if(options) 523 { 524 return(options.focusChanged); 525 } 526 else 527 { 528 return(null); 529 } 530 } 531 }, // focusChanged 532 439 533 440 534 … … 464 558 privateMethods.setEventChange(object, (value.change!=null)?value.change:options.change); 465 559 privateMethods.setEventSubmit(object, (value.submit!=null)?value.submit:options.submit); 560 privateMethods.setEventSubmited(object, (value.submited!=null)?value.submited:options.submited); 561 privateMethods.setEventFocusChanged(object, (value.focusChanged!=null)?value.focusChanged:options.focusChanged); 466 562 467 563 properties.initialized=true; … … 566 662 567 663 664 setFocus : function (object, value) 665 { 666 var objects=object.data('objects'), 667 options=object.data('options'), 668 properties=object.data('properties'); 669 670 if(value===true||value===false) 671 { 672 if(value) 673 { 674 objects.input.focus(); 675 } 676 else 677 { 678 objects.input.blur(); 679 } 680 681 properties.focus=value; 682 if(options.focusChanged) object.trigger('inputConsoleFocusChanged', properties.focus); 683 } 684 685 return(properties.focus); 686 }, 687 568 688 getFocus : function (object) 569 689 { 570 var objects=object.data('objects'); 571 690 var objects=object.data('objects'), 691 options=object.data('options'), 692 properties=object.data('properties'); 693 694 properties.focus=true; 572 695 objects.historyContainer.css('display', 'block'); 573 696 privateMethods.setObjectsWidth(object); 697 if(options.focusChanged) object.trigger('inputConsoleFocusChanged', properties.focus); 574 698 }, 575 699 576 700 lostFocus : function (object) 577 701 { 578 var objects=object.data('objects'); 579 702 var objects=object.data('objects'), 703 options=object.data('options'), 704 properties=object.data('properties'); 705 706 properties.focus=false; 580 707 objects.historyContainer.css('display', 'none'); 708 if(options.focusChanged) object.trigger('inputConsoleFocusChanged', properties.focus); 581 709 }, 582 710 … … 601 729 }, 602 730 731 setEventSubmited : function (object, value) 732 { 733 var options=object.data('options'); 734 735 options.submited=value; 736 object.unbind('inputConsoleSubmited'); 737 if(value) object.bind('inputConsoleSubmited', options.submited); 738 return(options.submited); 739 }, 740 741 setEventFocusChanged : function (object, value) 742 { 743 var options=object.data('options'); 744 745 options.focusChanged=value; 746 object.unbind('inputConsoleFocusChanged'); 747 if(value) object.bind('inputConsoleFocusChanged', options.focusChanged); 748 return(options.focusChanged); 749 }, 750 603 751 keyUp : function (object, event) 604 752 { … … 612 760 if(options.submit) object.trigger('inputConsoleSubmit', properties.value); 613 761 privateMethods.updateHistory(object, properties.value); 762 if(options.submited) object.trigger('inputConsoleSubmited', properties.value); 614 763 privateMethods.setValue(object, '', true); 615 764 } … … 625 774 objects=object.data('objects'); 626 775 627 if(item!='' && item!=null) objects.historyList.append($('<li/>', { html: item })); 776 if(item!='' && item!=null) 777 objects.historyList.append( 778 $('<li/>', { html: '<span class="ui-inputConsole-historyCmd">'+item+'</span>' } ) 779 .bind('click', object, 780 function (event) 781 { 782 privateMethods.setValue(event.data, $(this).children('.ui-inputConsole-historyCmd').html(), true); 783 } 784 ) 785 ); 628 786 629 787 while(objects.historyList.children().length>options.historySize) … … 632 790 } 633 791 objects.historyContainer.scrollTop(objects.historyList.height()); 792 }, 793 794 updateHistoryResult : function (object, item) 795 { 796 var options=object.data('options'), 797 objects=object.data('objects'); 798 799 if(item!='' && item!=null) 800 { 801 objects.historyList.children(':last').html( 802 objects.historyList.children(':last').html() + "<span class='ui-inputConsole-historyResult'>"+item+"</span>" 803 ); 804 } 805 806 objects.historyListContainer.scrollTop(objects.historyList.height()); 634 807 }, 635 808 … … 674 847 } 675 848 )(jQuery); 676 677 -
extensions/GrumPluginClasses/js/ui.inputConsole.min.js
r8961 r12215 1 /* file: ui.inputColorsFB.js - v1.0.0 | minified on 2011/01/27 with http://jscompress.com/ */ 2 (function($) 3 {var publicMethods={init:function(opt) 4 {return this.each(function() 5 {var $this=$(this),data=$this.data('options'),objects=$this.data('objects'),properties=$this.data('properties'),options={disabled:false,prompt:'>',historySize:8,historyHeight:60,change:null,submit:null};$this.data('options',options);if(!properties) 6 {$this.data('properties',{initialized:false,value:'',isValid:true,mouseIsOver:false,historyIsVisible:false,inputMargins:0});properties=$this.data('properties');} 7 if(!objects) 8 {objects={container:$('<div/>',{'class':'ui-inputConsole',css:{width:'100%'}}).bind('click.inputConsole',function() 9 {objects.input.focus();}).bind('mouseenter',function() 10 {properties.mouseIsOver=true;}).bind('mouseleave',function() 11 {properties.mouseIsOver=false;}),inputContainer:$('<div/>',{'class':'ui-inputConsole-input'}),input:$('<input>',{type:"text",value:''}).bind('focusout.inputConsole',function() 12 {privateMethods.lostFocus($this);}).bind('focus.inputConsole',function() 13 {privateMethods.getFocus($this);}).bind('keyup.inputConsole',function(event) 14 {privateMethods.keyUp($this,event);}),prompt:$('<div/>',{html:options.prompt,'class':'ui-inputConsole-prompt'}),historyContainer:$('<div/>',{'class':'ui-inputConsole-history',css:{display:'none'}}),historyList:$('<ul/>')};$this.html('').append(objects.container.append(objects.historyContainer.append(objects.historyList)).append(objects.inputContainer.append(objects.prompt).append(objects.input))).bind('resize.inputConsole',function() 15 {privateMethods.setObjectsWidth($this);});properties.inputMargins=objects.input.outerWidth(true)-objects.input.width();$this.data('objects',objects);} 16 privateMethods.setOptions($this,opt);});},destroy:function() 17 {return this.each(function() 18 {var $this=$(this),objects=$this.data('objects');objects.input.unbind().remove();objects.container.unbind().remove();$this.unbind('.inputConsole').css({width:'',height:''});});},options:function(value) 19 {return this.each(function() 20 {privateMethods.setOptions($(this),value);});},disabled:function(value) 21 {if(value!=null) 22 {return this.each(function() 23 {privateMethods.setDisabled($(this),value);});} 24 else 25 {var options=this.data('options');if(options) 26 {return(options.disabled);} 27 else 28 {return('');}}},prompt:function(value) 29 {if(value!=null) 30 {return this.each(function() 31 {privateMethods.setPrompt($(this),value);});} 32 else 33 {var options=this.data('options');if(options) 34 {return(options.prompt);} 35 else 36 {return('');}}},historySize:function(value) 37 {if(value!=null) 38 {return this.each(function() 39 {privateMethods.setHistorySize($(this),value);});} 40 else 41 {var options=this.data('options');if(options) 42 {return(options.historySize);} 43 else 44 {return('');}}},historyHeight:function(value) 45 {if(value!=null) 46 {return this.each(function() 47 {privateMethods.setHistoryHeight($(this),value);});} 48 else 49 {var options=this.data('options');if(options) 50 {return(options.historyHeight);} 51 else 52 {return('');}}},value:function(value) 53 {if(value!=null) 54 {return this.each(function() 55 {privateMethods.setValue($(this),value,true);});} 56 else 57 {var properties=this.data('properties');return(properties.value);}},history:function(value) 58 {var objects=this.data('objects');if(value!=null) 59 {return this.each(function() 60 {if(value=='clear') 61 {objects.historyList.html('');}});} 62 else 63 {var returned=[];objects.historyList.children().each(function(index,item) 64 {returned.push($(item).text());});return(returned);}},isValid:function(value) 65 {if(value!=null) 66 {return this.each(function() 67 {privateMethods.setIsValid($(this),value);});} 68 else 69 {var properties=this.data('properties');return(properties.isValid);}},change:function(value) 70 {if(value!=null&&$.isFunction(value)) 71 {return this.each(function() 72 {privateMethods.setEventChange($(this),value);});} 73 else 74 {var options=this.data('options');if(options) 75 {return(options.change);} 76 else 77 {return(null);}}},submit:function(value) 78 {if(value!=null&&$.isFunction(value)) 79 {return this.each(function() 80 {privateMethods.setEventSubmit($(this),value);});} 81 else 82 {var options=this.data('options');if(options) 83 {return(options.submit);} 84 else 85 {return(null);}}}};var privateMethods={setOptions:function(object,value) 86 {var properties=object.data('properties'),options=object.data('options');if(!$.isPlainObject(value))return(false);properties.initialized=false;privateMethods.setHistoryHeight(object,(value.historyHeight!=null)?value.historyHeight:options.historyHeight);privateMethods.setHistorySize(object,(value.historySize!=null)?value.historySize:options.historySize);privateMethods.setPrompt(object,(value.prompt!=null)?value.prompt:options.prompt);privateMethods.setValue(object,(value.value!=null)?value.value:options.value,true);privateMethods.setDisabled(object,(value.disabled!=null)?value.disabled:options.disabled);privateMethods.setEventChange(object,(value.change!=null)?value.change:options.change);privateMethods.setEventSubmit(object,(value.submit!=null)?value.submit:options.submit);properties.initialized=true;},setPrompt:function(object,value) 87 {var objects=object.data('objects'),options=object.data('options'),properties=object.data('properties');if(!properties.initialized||options.prompt!=value) 88 {options.prompt=value;objects.prompt.html(options.prompt);privateMethods.setObjectsWidth(object);} 89 return(options.prompt);},setHistorySize:function(object,value) 90 {var options=object.data('options'),properties=object.data('properties');if(!properties.initialized||options.historySize!=value) 91 {options.historySize=value;privateMethods.updateHistory(object,null);} 92 return(options.historySize);},setHistoryHeight:function(object,value) 93 {var objects=object.data('objects'),options=object.data('options'),properties=object.data('properties');if(!properties.initialized||options.historyHeight!=value) 94 {options.historyHeight=value;objects.historyContainer.css({height:options.historyHeight+'px','margin-top':(-options.historyHeight)+'px'});} 95 return(options.historyHeight);},setIsValid:function(object,value) 96 {var objects=object.data('objects'),properties=object.data('properties');if(properties.isValid!=value) 97 {properties.isValid=value;if(properties.isValid) 98 {objects.container.removeClass('ui-error');objects.input.removeClass('ui-error');} 99 else 100 {objects.container.addClass('ui-error');objects.input.addClass('ui-error');}} 101 return(properties.isValid);},setDisabled:function(object,value) 102 {var options=object.data('options'),properties=object.data('properties');if((!properties.initialized||options.disabled!=value)&&(value==true||value==false)) 103 {options.disabled=value;} 104 return(options.disabled);},setValue:function(object,value,apply) 105 {var options=object.data('options'),properties=object.data('properties'),objects=object.data('objects');properties.value=value;if(apply)objects.input.val(properties.value);if(options.change)object.trigger('inputConsoleChange',properties.value);return(true);},getFocus:function(object) 106 {var objects=object.data('objects');objects.historyContainer.css('display','block');privateMethods.setObjectsWidth(object);},lostFocus:function(object) 107 {var objects=object.data('objects');objects.historyContainer.css('display','none');},setEventChange:function(object,value) 108 {var options=object.data('options');options.change=value;object.unbind('inputConsoleChange');if(value)object.bind('inputConsoleChange',options.change);return(options.change);},setEventSubmit:function(object,value) 109 {var options=object.data('options');options.submit=value;object.unbind('inputConsoleSubmit');if(value)object.bind('inputConsoleSubmit',options.submit);return(options.submit);},keyUp:function(object,event) 110 {var properties=object.data('properties'),options=object.data('options'),objects=object.data('objects');if(event.keyCode==13&&properties.isValid) 111 {if(options.submit)object.trigger('inputConsoleSubmit',properties.value);privateMethods.updateHistory(object,properties.value);privateMethods.setValue(object,'',true);} 112 else 113 {privateMethods.setValue(object,objects.input.val(),false);}},updateHistory:function(object,item) 114 {var options=object.data('options'),objects=object.data('objects');if(item!=''&&item!=null)objects.historyList.append($('<li/>',{html:item}));while(objects.historyList.children().length>options.historySize) 115 {objects.historyList.children(':first').remove();} 116 objects.historyContainer.scrollTop(objects.historyList.height());},setObjectsWidth:function(object) 117 {var objects=object.data('objects') 118 properties=object.data('properties');if(objects.inputContainer.width()>0) 119 {objects.input.css('width',(objects.inputContainer.innerWidth()-objects.prompt.outerWidth(true)-properties.inputMargins)+'px');objects.historyContainer.css({width:objects.inputContainer.innerWidth()+'px','margin-left':((objects.historyContainer.width()-objects.historyContainer.outerWidth())/2)+'px'});}}};$.fn.inputConsole=function(method) 120 {if(publicMethods[method]) 121 {return publicMethods[method].apply(this,Array.prototype.slice.call(arguments,1));} 122 else if(typeof method==='object'||!method) 123 {return publicMethods.init.apply(this,arguments);} 124 else 125 {$.error('Method '+method+' does not exist on jQuery.inputConsole');}}})(jQuery); 1 /* file: ui.inputConsole.js - v1.0.1 | minified on 2011/09/21 with http://jscompress.com/ */ 2 (function(a){var b={init:function(b){return this.each(function(){var d=a(this),e=d.data("options"),f=d.data("objects"),g=d.data("properties"),h={disabled:false,prompt:">",historySize:8,historyHeight:60,change:null,submit:null,submited:null,focusChanged:null};d.data("options",h);if(!g){d.data("properties",{initialized:false,value:"",isValid:true,mouseIsOver:false,historyIsVisible:false,inputMargins:0,focus:false});g=d.data("properties")}if(!f){f={container:a("<div/>",{"class":"ui-inputConsole",css:{width:"100%"}}).bind("click.inputConsole",function(){f.input.focus()}).bind("mouseenter",function(){g.mouseIsOver=true}).bind("mouseleave",function(){g.mouseIsOver=false}),inputContainer:a("<div/>",{"class":"ui-inputConsole-input"}),input:a("<input>",{type:"text",value:""}).bind("focusout.inputConsole",function(){c.lostFocus(d)}).bind("focus.inputConsole",function(){c.getFocus(d)}).bind("keyup.inputConsole",function(a){c.keyUp(d,a)}),prompt:a("<div/>",{html:h.prompt,"class":"ui-inputConsole-prompt"}),historyContainer:a("<div/>",{"class":"ui-inputConsole-history",css:{display:"none"}}),historyBackground:a("<div/>",{"class":"ui-inputConsole-historyBg"}),historyListContainer:a("<div/>",{"class":"ui-inputConsole-historyListContainer"}),historyList:a("<ul/>")};d.html("").append(f.container.append(f.historyContainer.append(f.historyBackground).append(f.historyListContainer.append(f.historyList))).append(f.inputContainer.append(f.prompt).append(f.input))).bind("resize.inputConsole",function(){c.setObjectsWidth(d)});g.inputMargins=f.input.outerWidth(true)-f.input.width();d.data("objects",f)}c.setOptions(d,b)})},destroy:function(){return this.each(function(){var b=a(this),c=b.data("objects");c.input.unbind().remove();c.container.unbind().remove();b.unbind(".inputConsole").css({width:"",height:""})})},options:function(b){return this.each(function(){c.setOptions(a(this),b)})},disabled:function(b){if(b!=null){return this.each(function(){c.setDisabled(a(this),b)})}else{var d=this.data("options");if(d){return d.disabled}else{return""}}},prompt:function(b){if(b!=null){return this.each(function(){c.setPrompt(a(this),b)})}else{var d=this.data("options");if(d){return d.prompt}else{return""}}},historySize:function(b){if(b!=null){return this.each(function(){c.setHistorySize(a(this),b)})}else{var d=this.data("options");if(d){return d.historySize}else{return""}}},historyHeight:function(b){if(b!=null){return this.each(function(){c.setHistoryHeight(a(this),b)})}else{var d=this.data("options");if(d){return d.historyHeight}else{return""}}},value:function(b){if(b!=null){return this.each(function(){c.setValue(a(this),b,true)})}else{var d=this.data("properties");return d.value}},history:function(b,d){var e=this.data("objects");if(b!=null){return this.each(function(){switch(b){case"clear":e.historyList.html("");break;case"addResult":c.updateHistoryResult(a(this),d);break}})}else{var f=[];e.historyList.children().each(function(b,c){f.push(a(c).text())});return f}},isValid:function(b){if(b!=null){return this.each(function(){c.setIsValid(a(this),b)})}else{var d=this.data("properties");return d.isValid}},focus:function(b){if(b!=null){return this.each(function(){c.setFocus(a(this),b)})}else{var d=this.data("properties");return d.focus}},change:function(b){if(b!=null&&a.isFunction(b)){return this.each(function(){c.setEventChange(a(this),b)})}else{var d=this.data("options");if(d){return d.change}else{return null}}},submit:function(b){if(b!=null&&a.isFunction(b)){return this.each(function(){c.setEventSubmit(a(this),b)})}else{var d=this.data("options");if(d){return d.submit}else{return null}}},submited:function(b){if(b!=null&&a.isFunction(b)){return this.each(function(){c.setEventSubmited(a(this),b)})}else{var d=this.data("options");if(d){return d.submited}else{return null}}},focusChanged:function(b){if(b!=null&&a.isFunction(b)){return this.each(function(){c.setEventFocusChanged(a(this),b)})}else{var d=this.data("options");if(d){return d.focusChanged}else{return null}}}};var c={setOptions:function(b,d){var e=b.data("properties"),f=b.data("options");if(!a.isPlainObject(d))return false;e.initialized=false;c.setHistoryHeight(b,d.historyHeight!=null?d.historyHeight:f.historyHeight);c.setHistorySize(b,d.historySize!=null?d.historySize:f.historySize);c.setPrompt(b,d.prompt!=null?d.prompt:f.prompt);c.setValue(b,d.value!=null?d.value:f.value,true);c.setDisabled(b,d.disabled!=null?d.disabled:f.disabled);c.setEventChange(b,d.change!=null?d.change:f.change);c.setEventSubmit(b,d.submit!=null?d.submit:f.submit);c.setEventSubmited(b,d.submited!=null?d.submited:f.submited);c.setEventFocusChanged(b,d.focusChanged!=null?d.focusChanged:f.focusChanged);e.initialized=true},setPrompt:function(a,b){var d=a.data("objects"),e=a.data("options"),f=a.data("properties");if(!f.initialized||e.prompt!=b){e.prompt=b;d.prompt.html(e.prompt);c.setObjectsWidth(a)}return e.prompt},setHistorySize:function(a,b){var d=a.data("options"),e=a.data("properties");if(!e.initialized||d.historySize!=b){d.historySize=b;c.updateHistory(a,null)}return d.historySize},setHistoryHeight:function(a,b){var c=a.data("objects"),d=a.data("options"),e=a.data("properties");if(!e.initialized||d.historyHeight!=b){d.historyHeight=b;c.historyContainer.css({height:d.historyHeight+"px","margin-top":-d.historyHeight+"px"})}return d.historyHeight},setIsValid:function(a,b){var c=a.data("objects"),d=a.data("properties");if(d.isValid!=b){d.isValid=b;if(d.isValid){c.container.removeClass("ui-error");c.input.removeClass("ui-error")}else{c.container.addClass("ui-error");c.input.addClass("ui-error")}}return d.isValid},setDisabled:function(a,b){var c=a.data("options"),d=a.data("properties");if((!d.initialized||c.disabled!=b)&&(b==true||b==false)){c.disabled=b}return c.disabled},setValue:function(a,b,c){var d=a.data("options"),e=a.data("properties"),f=a.data("objects");e.value=b;if(c)f.input.val(e.value);if(d.change)a.trigger("inputConsoleChange",e.value);return true},setFocus:function(a,b){var c=a.data("objects"),d=a.data("options"),e=a.data("properties");if(b===true||b===false){if(b){c.input.focus()}else{c.input.blur()}e.focus=b;if(d.focusChanged)a.trigger("inputConsoleFocusChanged",e.focus)}return e.focus},getFocus:function(a){var b=a.data("objects"),d=a.data("options"),e=a.data("properties");e.focus=true;b.historyContainer.css("display","block");c.setObjectsWidth(a);if(d.focusChanged)a.trigger("inputConsoleFocusChanged",e.focus)},lostFocus:function(a){var b=a.data("objects"),c=a.data("options"),d=a.data("properties");d.focus=false;b.historyContainer.css("display","none");if(c.focusChanged)a.trigger("inputConsoleFocusChanged",d.focus)},setEventChange:function(a,b){var c=a.data("options");c.change=b;a.unbind("inputConsoleChange");if(b)a.bind("inputConsoleChange",c.change);return c.change},setEventSubmit:function(a,b){var c=a.data("options");c.submit=b;a.unbind("inputConsoleSubmit");if(b)a.bind("inputConsoleSubmit",c.submit);return c.submit},setEventSubmited:function(a,b){var c=a.data("options");c.submited=b;a.unbind("inputConsoleSubmited");if(b)a.bind("inputConsoleSubmited",c.submited);return c.submited},setEventFocusChanged:function(a,b){var c=a.data("options");c.focusChanged=b;a.unbind("inputConsoleFocusChanged");if(b)a.bind("inputConsoleFocusChanged",c.focusChanged);return c.focusChanged},keyUp:function(a,b){var d=a.data("properties"),e=a.data("options"),f=a.data("objects");if(b.keyCode==13&&d.isValid){if(e.submit)a.trigger("inputConsoleSubmit",d.value);c.updateHistory(a,d.value);if(e.submited)a.trigger("inputConsoleSubmited",d.value);c.setValue(a,"",true)}else{c.setValue(a,f.input.val(),false)}},updateHistory:function(b,d){var e=b.data("options"),f=b.data("objects");if(d!=""&&d!=null)f.historyList.append(a("<li/>",{html:'<span class="ui-inputConsole-historyCmd">'+d+"</span>"}).bind("click",b,function(b){c.setValue(b.data,a(this).children(".ui-inputConsole-historyCmd").html(),true)}));while(f.historyList.children().length>e.historySize){f.historyList.children(":first").remove()}f.historyContainer.scrollTop(f.historyList.height())},updateHistoryResult:function(a,b){var c=a.data("options"),d=a.data("objects");if(b!=""&&b!=null){d.historyList.children(":last").html(d.historyList.children(":last").html()+"<span class='ui-inputConsole-historyResult'>"+b+"</span>")}d.historyListContainer.scrollTop(d.historyList.height())},setObjectsWidth:function(a){var b=a.data("objects");properties=a.data("properties");if(b.inputContainer.width()>0){b.input.css("width",b.inputContainer.innerWidth()-b.prompt.outerWidth(true)-properties.inputMargins+"px");b.historyContainer.css({width:b.inputContainer.innerWidth()+"px","margin-left":(b.historyContainer.width()-b.historyContainer.outerWidth())/2+"px"})}}};a.fn.inputConsole=function(c){if(b[c]){return b[c].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof c==="object"||!c){return b.init.apply(this,arguments)}else{a.error("Method "+c+" does not exist on jQuery.inputConsole")}}})(jQuery) -
extensions/GrumPluginClasses/language/fr_FR/plugin.lang.php
r7199 r12215 16 16 $lang['All the gallery'] = 'Toute la galerie'; 17 17 18 19 // gpc 3.5.2 20 $lang['Your email']='Adresse email'; 21 $lang['Subject']='Sujet'; 22 $lang['Message']='Message'; 23 $lang['Submit']='Soumettre'; 24 $lang['Email is mandatory']='L\'adresse email est obligatoire'; 25 $lang['Email is not valid']='L\'adresse email est invalide'; 26 $lang['Subject is mandatory']='Le sujet du message est obligatoire'; 27 $lang['Message is mandatory']='Le message ne peut pas être vide !'; 28 $lang['[%s][Message from %s] %s']='[%s][Message de %s] %s'; 29 $lang['Sorry, an error has occured while sending the message to the webmaster']='Désolé, une erreur est survenue lors de l\'envoi du message au webmaster'; 30 $lang['Your message was sent to the webmaster!']='Votre message a bien été transmis !'; 31 18 32 ?> -
extensions/GrumPluginClasses/main.inc.php
r10884 r12215 2 2 /* 3 3 Plugin Name: Grum Plugins Classes.3 4 Version: 3.5. 14 Version: 3.5.2 5 5 Description: Collection de classes partagées entre mes plugins (existants, ou à venir) / Partaged classes between my plugins (actuals or futures) 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=199 … … 163 163 | | | . Request builder interface don't work 164 164 | | | 165 | 3.5.2 | 2011/05/15 | * Add function to manage special markup 166 | | | . BB like markup [b],[i],[url]... 167 | | | . [var=<name>] markup 168 | | | . [tabs],[tab=id(;default);<tab title>] 169 | | | . [form_mail] 170 | | | 171 | | | * mantis bug:2160 172 | | | . CategorySelector : extended description are not 173 | | | managed 165 174 | | | 166 175 | | | … … 168 177 | | | 169 178 | | | ===== Don't forget to update the plugin version ! ===== 170 | | |171 | | |172 179 | | | 173 180 | | |
Note: See TracChangeset
for help on using the changeset viewer.