source: extensions/AMetaData/amd_root.class.inc.php @ 5040

Revision 5040, 5.4 KB checked in by grum, 10 years ago (diff)

Install process make a default config (select metadata, add a predefined group, set default values for filters)

  • Property svn:executable set to *
Line 
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
21if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
22
23include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
24include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
25
26include_once('JpegMetaData/JpegMetaData.class.php');
27include_once(JPEG_METADATA_DIR."Common/L10n.class.php");
28
29class 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' => "magic",
56      'amd_GetListTags_ExcludeUnusedTag' => "y",
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; margin-top:3px; }
92      #iListTags, #iListImages { width:100%; border:1px solid; height:120px; border-top:0px; overflow:auto;}
93      #iListTagsNb, #iListImagesNb { width:100%; text-align:right; margin-bottom:20px; padding:2px; font-size:80%; }
94      #iListTags table, #iListImages table, table.listTags { width:100%; text-align:left; border-collapse: collapse; }
95      #iListTags table tr:hover { cursor:pointer; background:#303030; }
96      #iListImages table tr:hover, table.listTags tr:hover { background:#303030; cursor:default; }
97      #iHeaderListImages { width:100%; border:1px solid; margin-top:3px; }
98      .warning { color:#dd0000; border:1px solid #dd0000; margin-bottom:8px; margin-top:8px; padding:8px; }
99      .warning p { margin-top:0.5em; margin-bottom:0em; }
100      .warning ul { margin-top:0em; margin-bottom:0.5em; }
101      .pctBar { height:6px; background:#FF7700; }
102      li.groupItems { border:1px solid #666666; margin-bottom:5px; padding:0 5px; width:90%; cursor:move; padding:4px; }
103      div.addGroup { padding-left:40px; text-align:left; }
104      #iGroups { list-style: none; }
105      .ui-dialog { background: #222222; border:2px solid #FF3363; }
106      .ui-dialog-buttonpane { padding:4px; }
107      .ui-dialog-buttonpane button { margin-right:8px; }
108      .ui-dialog-titlebar { background:#111111; font-weight:bold; }
109      .ui-dialog-title-dialog { text-align: left; }
110      .ui-dialog-titlebar-close { float: right; }
111      .ui-dialog-content { overflow:auto; }
112      .ui-dialog-container { }
113      .ui-dialog-titlebar-close { display:none; }
114      .tagListOrder { list-style: none; padding:0px; margin-right:8px; margin-left:35px; }
115      .tagListOrder li { border:none; background:#333333; padding:1px; margin-bottom:2px; width:100%; }
116      .groupTags { padding-top:8px; }
117      .editGroupListButton { margin-left:8px; position:absolute; z-index:1000; }
118      table.tagListOrderItem { width:100%; border-collapse:collapse; }
119      .dialogForm { text-align:left; margin:8px; }
120      #ianalyzestatus { background: #333333; margin:8px; padding:8px; }
121      #ianalyzestatus ul { margin:0px; padding:0 0 0 20px; }
122      #iamd_nb_item_per_request_display { display:inline-block; width:70px; }
123      #iamd_nb_item_per_request_slider { display:inline-block; width:350px; }
124      #iDialogProgress { margin:16px 8px 8px; }
125    ";
126
127    return($text);
128  }
129
130} // amd_root  class
131
132
133
134?>
Note: See TracBrowser for help on using the repository browser.