[4905] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * ----------------------------------------------------------------------------- |
---|
| 4 | * Plugin Name: Advanced MetaData |
---|
| 5 | * ----------------------------------------------------------------------------- |
---|
| 6 | * Author : Grum |
---|
| 7 | * email : grum@piwigo.org |
---|
| 8 | * website : http://photos.grum.fr |
---|
| 9 | * PWG user : http://forum.piwigo.org/profile.php?id=3706 |
---|
| 10 | * |
---|
| 11 | * << May the Little SpaceFrog be with you ! >> |
---|
| 12 | * |
---|
| 13 | * ----------------------------------------------------------------------------- |
---|
| 14 | * |
---|
| 15 | * See main.inc.php for release information |
---|
| 16 | * |
---|
| 17 | * AMD_install : classe to manage plugin install |
---|
| 18 | * --------------------------------------------------------------------------- |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } |
---|
| 22 | |
---|
| 23 | include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'); |
---|
| 24 | include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php'); |
---|
| 25 | |
---|
| 26 | include_once('JpegMetaData/JpegMetaData.class.php'); |
---|
| 27 | include_once(JPEG_METADATA_DIR."Common/L10n.class.php"); |
---|
| 28 | |
---|
| 29 | class AMD_root extends common_plugin |
---|
| 30 | { |
---|
| 31 | protected $css; //the css object |
---|
| 32 | |
---|
| 33 | function AMD_root($prefixeTable, $filelocation) |
---|
| 34 | { |
---|
| 35 | $this->plugin_name="AMetaData"; |
---|
| 36 | $this->plugin_name_files="amd"; |
---|
| 37 | parent::__construct($prefixeTable, $filelocation); |
---|
| 38 | |
---|
| 39 | $tableList=array('used_tags', 'images_tags', 'images', 'selected_tags', 'groups_names', 'groups'); |
---|
| 40 | $this->set_tables_list($tableList); |
---|
| 41 | |
---|
| 42 | $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css"); |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | /* --------------------------------------------------------------------------- |
---|
| 46 | common AIP & PIP functions |
---|
| 47 | --------------------------------------------------------------------------- */ |
---|
| 48 | |
---|
| 49 | /* this function initialize var $my_config with default values */ |
---|
| 50 | public function init_config() |
---|
| 51 | { |
---|
| 52 | $this->my_config=array( |
---|
| 53 | 'amd_NumberOfItemsPerRequest' => 25, |
---|
| 54 | 'amd_GetListTags_OrderType' => "tag", |
---|
| 55 | 'amd_GetListTags_FilterType' => "", |
---|
| 56 | 'amd_GetListTags_ExcludeUnusedTag' => "n", |
---|
| 57 | 'amd_GetListTags_SelectedTagOnly' => "n", |
---|
| 58 | 'amd_GetListImages_OrderType' => "value" |
---|
| 59 | ); |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | public function load_config() |
---|
| 63 | { |
---|
| 64 | parent::load_config(); |
---|
| 65 | if(!$this->css->css_file_exists()) |
---|
| 66 | { |
---|
| 67 | $this->css->make_CSS($this->generate_CSS()); |
---|
| 68 | } |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | public function init_events() |
---|
| 72 | { |
---|
| 73 | parent::init_events(); |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | /* |
---|
| 77 | * generate the css code |
---|
| 78 | */ |
---|
| 79 | function generate_CSS() |
---|
| 80 | { |
---|
| 81 | $text = " |
---|
| 82 | .formtable, .formtable P { text-align:left; display:block; } |
---|
| 83 | .formtable tr { vertical-align:top; } |
---|
| 84 | .littlefont { font-size:90%; } |
---|
| 85 | .littlefont td { padding:1px; } |
---|
| 86 | table.littlefont th { padding:3px; text-align:left;} |
---|
| 87 | table.littlefont td { padding:1px 3px; } |
---|
| 88 | #iprogressbar_contener { border:1px solid #606060; margin:0px; padding:0px; display:block; height:20px; } |
---|
| 89 | #iprogressbar_bg { background:#606060; display:block; z-index:100; position:relative; height:20px; } |
---|
| 90 | #iprogressbar_fg { color:#FF3363; width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px; } |
---|
| 91 | #iHeaderListTags { width:100%; border:1px solid; border-collapse: collapse; } |
---|
| 92 | #iListTags, #iListImages { width:100%; border:1px solid; margin-bottom:20px; height:120px; border-top:0px; overflow:auto;} |
---|
| 93 | #iListTags table, #iListImages table, table.listTags { width:100%; text-align:left; border-collapse: collapse; } |
---|
| 94 | #iListTags table tr:hover { cursor:pointer; background:#303030; } |
---|
| 95 | #iListImages table tr:hover, table.listTags tr:hover { background:#303030; cursor:default; } |
---|
| 96 | #iHeaderListImages { width:100%; border:1px solid; } |
---|
| 97 | .warning { color:#dd0000; border:1px solid #dd0000; margin-bottom:8px; margin-top:8px; padding:8px; } |
---|
| 98 | .warning p { margin-top:0.5em; margin-bottom:0em; } |
---|
| 99 | .warning ul { margin-top:0em; margin-bottom:0.5em; } |
---|
| 100 | .pctBar { height:6px; background:#FF7700; } |
---|
| 101 | li.groupItems { border:1px solid #666666; margin-bottom:5px; padding:0 5px; width:90%; cursor:move; padding:4px; } |
---|
| 102 | div.addGroup { padding-left:40px; text-align:left; } |
---|
| 103 | #iGroups { list-style: none; } |
---|
| 104 | .ui-dialog { background: #222222; border:2px solid #FF3363; } |
---|
| 105 | .ui-dialog-buttonpane { padding:4px; } |
---|
| 106 | .ui-dialog-buttonpane button { margin-right:8px; } |
---|
| 107 | .ui-dialog-titlebar { background:#111111; font-weight:bold; } |
---|
| 108 | .ui-dialog-title-dialog { text-align: left; } |
---|
| 109 | .ui-dialog-titlebar-close { float: right; } |
---|
| 110 | .ui-dialog-content { overflow:auto; } |
---|
| 111 | .ui-dialog-container { } |
---|
| 112 | .ui-dialog-titlebar-close { display:none; } |
---|
| 113 | .tagListOrder { list-style: none; padding:0px; margin-right:8px; margin-left:35px; } |
---|
| 114 | .tagListOrder li { border:none; background:#333333; padding:1px; margin-bottom:2px; width:100%; } |
---|
| 115 | .groupTags { padding-top:8px; } |
---|
| 116 | .editGroupListButton { margin-left:8px; position:absolute; z-index:1000; } |
---|
| 117 | table.tagListOrderItem { width:100%; border-collapse:collapse; } |
---|
| 118 | .dialogForm { text-align:left; margin:8px; } |
---|
| 119 | #ianalyzestatus { background: #333333; margin:8px; padding:8px; } |
---|
| 120 | #ianalyzestatus ul { margin:0px; padding:0 0 0 20px; } |
---|
| 121 | #iamd_nb_item_per_request_display { display:inline-block; width:70px; } |
---|
| 122 | #iamd_nb_item_per_request_slider { display:inline-block; width:350px; } |
---|
| 123 | #iDialogProgress { margin:16px 8px 8px; } |
---|
| 124 | "; |
---|
| 125 | |
---|
| 126 | return($text); |
---|
| 127 | } |
---|
| 128 | |
---|
| 129 | } // amd_root class |
---|
| 130 | |
---|
| 131 | |
---|
| 132 | |
---|
| 133 | ?> |
---|