Changeset 30702 for extensions


Ignore:
Timestamp:
Dec 6, 2014, 8:32:09 AM (10 years ago)
Author:
ddtddt
Message:

[extensions] - manage_properties_photos -beta 4

Location:
extensions/manage_properties_photos
Files:
11 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/manage_properties_photos/admin.php

    r30676 r30702  
    55global $template, $conf, $user;
    66include_once(PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php');
    7 load_language('plugin.lang', ADD_INFO_PHOTO_PATH);
     7load_language('plugin.lang', ADD_PROP_PHOTO_PATH);
    88$my_base_url = get_admin_plugin_menu_link(__FILE__);
    99
     
    1515//-------------------------------------------------------- sections definitions
    1616if (!isset($_GET['tab']))
    17     $page['tab'] = 'define_information';
     17    $page['tab'] = 'define_properties';
    1818else
    1919    $page['tab'] = $_GET['tab'];
     
    2222if ($page['tab'] != 'iap') {
    2323    $tabsheet = new tabsheet();
    24     $tabsheet->add('addip', l10n('Information\'s organization'), ADD_INFO_PHOTO_ADMIN . '-define_information');
    25     //$tabsheet->add('configuration', l10n('Configuration'), ADD_INFO_PHOTO_ADMIN . '-configuration');
     24    $tabsheet->add('addip', l10n('Property'), ADD_PROP_PHOTO_ADMIN . '-define_properties');
    2625    $tabsheet->select($page['tab']);
    2726    $tabsheet->assign();
     
    6261        while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) {
    6362
    64             $d = data_info_photos($id_img, $info_photos['id_info_pho']);
     63            $d = data_info_photos($id_img, $info_photos['id_prop_pho']);
    6564            $row = pwg_db_fetch_assoc($d);
    6665
    6766            $items = array(
    6867                'IDPHO' => $_GET['image_id'],
    69                 'IDINFOPHO' => $info_photos['id_info_pho'],
    70                 'AIPDESIGNATION' => trigger_change('AP_render_content',$info_photos['designation']),
     68                'IDINFOPHO' => $info_photos['id_prop_pho'],
     69                'AIPWORDING' => trigger_change('AP_render_content',$info_photos['wording']),
    7170                'AIPDATA' => $row['data'],
    7271            );
     
    7776
    7877    if (isset($_POST['submitaddinfoimg'])) {
    79         foreach ($_POST['data'] AS $id_info_pho => $data) {
    80             $q = 'SELECT 1 FROM ' . ADD_INFO_PHOTO_DATA_TABLE . ' WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;
     78        foreach ($_POST['data'] AS $id_prop_pho => $data) {
     79            $q = 'SELECT 1 FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' WHERE id_img=' . $id_img . ' AND id_prop_pho=' . $id_prop_pho;
    8180            $test = pwg_query($q);
    8281            $row = pwg_db_fetch_assoc($test);
    8382            if (count($row) > 0) {
    8483                if ($data != '') {
    85                     $query = 'UPDATE ' . $prefixeTable . 'add_info_photos_data SET data="' . $data . '" WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;
     84                    $query = 'UPDATE ' . $prefixeTable . 'add_properties_photos_data SET data="' . $data . '" WHERE id_img=' . $id_img . ' AND id_prop_pho=' . $id_prop_pho;
    8685                    pwg_query($query);
    8786                } else {
    88                     $query = 'DELETE FROM ' . $prefixeTable . 'add_info_photos_data WHERE id_img=' . $id_img . ' AND id_info_pho=' . $id_info_pho;
     87                    $query = 'DELETE FROM ' . $prefixeTable . 'add_properties_photos_data WHERE id_img=' . $id_img . ' AND id_prop_pho=' . $id_prop_pho;
    8988                    pwg_query($query);
    9089                }
    9190            } else if ($data != '') {
    92                 $query = 'INSERT ' . $prefixeTable . 'add_info_photos_data(id_img,id_info_pho,data) VALUES (' . $id_img . ',' . $id_info_pho . ',"' . $data . '");';
     91                $query = 'INSERT ' . $prefixeTable . 'add_properties_photos_data(id_img,id_prop_pho,data) VALUES (' . $id_img . ',' . $id_prop_pho . ',"' . $data . '");';
    9392                pwg_query($query);
    9493            }
    9594           
    9695        }
    97         $redirect_url = ADD_INFO_PHOTO_ADMIN . '-iap&image_id=' . $id_img;
    98         $_SESSION['page_infos'] = array(l10n('Personal info photo update'));
     96        $redirect_url = ADD_PROP_PHOTO_ADMIN . '-iap&image_id=' . $id_img;
     97        $_SESSION['page_infos'] = array(l10n('Properties update'));
    9998        redirect($redirect_url);
    10099    }
     
    102101
    103102switch ($page['tab']) {
    104     case 'define_information':
    105         $admin_base_url = ADD_INFO_PHOTO_ADMIN . '-define_information';
     103    case 'define_properties':
     104        $admin_base_url = ADD_PROP_PHOTO_ADMIN . '-define_properties';
    106105        $template->assign(
    107106                'addinfotemplate', array(
    108107            'addinfo' => l10n('addinfo'),
    109             'U_HOMEP' => $admin_base_url,
    110                    
    111         ));
     108       ));
    112109       
    113110    $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
     
    119116    }
    120117       
    121         $admin_base_url = ADD_INFO_PHOTO_ADMIN . '-define_information';
     118        $admin_base_url = ADD_PROP_PHOTO_ADMIN . '-define_properties';
    122119        $tab_info_photos = tab_info_photos();
    123120
    124121        if (pwg_db_num_rows($tab_info_photos)) {
    125122            while ($info_photos = pwg_db_fetch_assoc($tab_info_photos)) {
    126                 if($info_photos['id_info_pho']==1){
    127                     $items = array(
    128                         'IDINFOPHO' => $info_photos['id_info_pho'],
    129                         'AIPDESIGNATION' => l10n('Author'),
    130                         'AIPORDER' => $info_photos['orderinfo'],
    131                         'AIPACTIVE' => $info_photos['active'],
    132                         'AIPEDIT' => $info_photos['edit'],
    133                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    134                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    135                     );
    136                 }else if($info_photos['id_info_pho']==2){
    137                     $items = array(
    138                         'IDINFOPHO' => $info_photos['id_info_pho'],
    139                         'AIPDESIGNATION' => l10n('Created on'),
    140                         'AIPORDER' => $info_photos['orderinfo'],
    141                         'AIPACTIVE' => $info_photos['active'],
    142                         'AIPEDIT' => $info_photos['edit'],
    143                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    144                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    145                     );
    146                 }else if($info_photos['id_info_pho']==3){
    147                     $items = array(
    148                         'IDINFOPHO' => $info_photos['id_info_pho'],
    149                         'AIPDESIGNATION' => l10n('Posted on'),
    150                         'AIPORDER' => $info_photos['orderinfo'],
    151                         'AIPACTIVE' => $info_photos['active'],
    152                         'AIPEDIT' => $info_photos['edit'],
    153                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    154                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    155                     );
    156                 }else if($info_photos['id_info_pho']==4){
    157                     $items = array(
    158                         'IDINFOPHO' => $info_photos['id_info_pho'],
    159                         'AIPDESIGNATION' => l10n('Dimensions'),
    160                         'AIPORDER' => $info_photos['orderinfo'],
    161                         'AIPACTIVE' => $info_photos['active'],
    162                         'AIPEDIT' => $info_photos['edit'],
    163                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    164                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    165                     );
    166                 }else if($info_photos['id_info_pho']==5){
    167                     $items = array(
    168                         'IDINFOPHO' => $info_photos['id_info_pho'],
    169                         'AIPDESIGNATION' => l10n('File'),
    170                         'AIPORDER' => $info_photos['orderinfo'],
    171                         'AIPACTIVE' => $info_photos['active'],
    172                         'AIPEDIT' => $info_photos['edit'],
    173                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    174                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    175                     );
    176                 }else if($info_photos['id_info_pho']==6){
    177                     $items = array(
    178                         'IDINFOPHO' => $info_photos['id_info_pho'],
    179                         'AIPDESIGNATION' => l10n('Filesize'),
    180                         'AIPORDER' => $info_photos['orderinfo'],
    181                         'AIPACTIVE' => $info_photos['active'],
    182                         'AIPEDIT' => $info_photos['edit'],
    183                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    184                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    185                     );
    186                 }else if($info_photos['id_info_pho']==7){
    187                     $items = array(
    188                         'IDINFOPHO' => $info_photos['id_info_pho'],
    189                         'AIPDESIGNATION' => l10n('Tags'),
    190                         'AIPORDER' => $info_photos['orderinfo'],
    191                         'AIPACTIVE' => $info_photos['active'],
    192                         'AIPEDIT' => $info_photos['edit'],
    193                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    194                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    195                     );
    196                 }else if($info_photos['id_info_pho']==8){
    197                     $items = array(
    198                         'IDINFOPHO' => $info_photos['id_info_pho'],
    199                         'AIPDESIGNATION' => l10n('Albums'),
    200                         'AIPORDER' => $info_photos['orderinfo'],
    201                         'AIPACTIVE' => $info_photos['active'],
    202                         'AIPEDIT' => $info_photos['edit'],
    203                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    204                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    205                     );
    206                 }else if($info_photos['id_info_pho']==9){
    207                     $items = array(
    208                         'IDINFOPHO' => $info_photos['id_info_pho'],
    209                         'AIPDESIGNATION' => l10n('Visits'),
    210                         'AIPORDER' => $info_photos['orderinfo'],
    211                         'AIPACTIVE' => $info_photos['active'],
    212                         'AIPEDIT' => $info_photos['edit'],
    213                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    214                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    215                     );
    216                 }else if($info_photos['id_info_pho']==10){
    217                     $items = array(
    218                         'IDINFOPHO' => $info_photos['id_info_pho'],
    219                         'AIPDESIGNATION' => l10n('Average'),
    220                         'AIPORDER' => $info_photos['orderinfo'],
    221                         'AIPACTIVE' => $info_photos['active'],
    222                         'AIPEDIT' => $info_photos['edit'],
    223                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    224                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
    225                     );
    226                 }else if($info_photos['id_info_pho']==11){
    227                     $items = array(
    228                         'IDINFOPHO' => $info_photos['id_info_pho'],
    229                         'AIPDESIGNATION' => l10n('Who can see this photo?'),
    230                         'AIPORDER' => $info_photos['orderinfo'],
    231                         'AIPACTIVE' => $info_photos['active'],
    232                         'AIPEDIT' => $info_photos['edit'],
    233                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    234                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
     123                if($info_photos['id_prop_pho']==1){
     124                    $items = array(
     125                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     126                        'AIPWORDING' => l10n('Author'),
     127                        'AIPORDER' => $info_photos['orderprop'],
     128                        'AIPACTIVE' => $info_photos['active'],
     129                        'AIPEDIT' => $info_photos['edit'],
     130                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     131                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     132                    );
     133                }else if($info_photos['id_prop_pho']==2){
     134                    $items = array(
     135                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     136                        'AIPWORDING' => l10n('Created on'),
     137                        'AIPORDER' => $info_photos['orderprop'],
     138                        'AIPACTIVE' => $info_photos['active'],
     139                        'AIPEDIT' => $info_photos['edit'],
     140                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     141                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     142                    );
     143                }else if($info_photos['id_prop_pho']==3){
     144                    $items = array(
     145                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     146                        'AIPWORDING' => l10n('Posted on'),
     147                        'AIPORDER' => $info_photos['orderprop'],
     148                        'AIPACTIVE' => $info_photos['active'],
     149                        'AIPEDIT' => $info_photos['edit'],
     150                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     151                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     152                    );
     153                }else if($info_photos['id_prop_pho']==4){
     154                    $items = array(
     155                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     156                        'AIPWORDING' => l10n('Dimensions'),
     157                        'AIPORDER' => $info_photos['orderprop'],
     158                        'AIPACTIVE' => $info_photos['active'],
     159                        'AIPEDIT' => $info_photos['edit'],
     160                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     161                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     162                    );
     163                }else if($info_photos['id_prop_pho']==5){
     164                    $items = array(
     165                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     166                        'AIPWORDING' => l10n('File'),
     167                        'AIPORDER' => $info_photos['orderprop'],
     168                        'AIPACTIVE' => $info_photos['active'],
     169                        'AIPEDIT' => $info_photos['edit'],
     170                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     171                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     172                    );
     173                }else if($info_photos['id_prop_pho']==6){
     174                    $items = array(
     175                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     176                        'AIPWORDING' => l10n('Filesize'),
     177                        'AIPORDER' => $info_photos['orderprop'],
     178                        'AIPACTIVE' => $info_photos['active'],
     179                        'AIPEDIT' => $info_photos['edit'],
     180                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     181                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     182                    );
     183                }else if($info_photos['id_prop_pho']==7){
     184                    $items = array(
     185                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     186                        'AIPWORDING' => l10n('Tags'),
     187                        'AIPORDER' => $info_photos['orderprop'],
     188                        'AIPACTIVE' => $info_photos['active'],
     189                        'AIPEDIT' => $info_photos['edit'],
     190                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     191                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     192                    );
     193                }else if($info_photos['id_prop_pho']==8){
     194                    $items = array(
     195                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     196                        'AIPWORDING' => l10n('Albums'),
     197                        'AIPORDER' => $info_photos['orderprop'],
     198                        'AIPACTIVE' => $info_photos['active'],
     199                        'AIPEDIT' => $info_photos['edit'],
     200                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     201                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     202                    );
     203                }else if($info_photos['id_prop_pho']==9){
     204                    $items = array(
     205                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     206                        'AIPWORDING' => l10n('Visits'),
     207                        'AIPORDER' => $info_photos['orderprop'],
     208                        'AIPACTIVE' => $info_photos['active'],
     209                        'AIPEDIT' => $info_photos['edit'],
     210                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     211                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     212                    );
     213                }else if($info_photos['id_prop_pho']==10){
     214                    $items = array(
     215                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     216                        'AIPWORDING' => l10n('Average'),
     217                        'AIPORDER' => $info_photos['orderprop'],
     218                        'AIPACTIVE' => $info_photos['active'],
     219                        'AIPEDIT' => $info_photos['edit'],
     220                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     221                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
     222                    );
     223                }else if($info_photos['id_prop_pho']==11){
     224                    $items = array(
     225                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     226                        'AIPWORDING' => l10n('Who can see this photo?'),
     227                        'AIPORDER' => $info_photos['orderprop'],
     228                        'AIPACTIVE' => $info_photos['active'],
     229                        'AIPEDIT' => $info_photos['edit'],
     230                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     231                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
    235232                    );
    236233                }else{
    237234                    $items = array(
    238                         'IDINFOPHO' => $info_photos['id_info_pho'],
    239                         'AIPDESIGNATION' => trigger_change('AP_render_content',$info_photos['designation']),
    240                         'AIPORDER' => $info_photos['orderinfo'],
    241                         'AIPACTIVE' => $info_photos['active'],
    242                         'AIPEDIT' => $info_photos['edit'],
    243                         'U_DELETE' => $admin_base_url . '&delete=' . $info_photos['id_info_pho'],
    244                         'U_EDIT' => $admin_base_url . '&edit=' . $info_photos['id_info_pho'],
    245                         'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_info_pho'],
    246                         'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_info_pho'],
     235                        'IDINFOPHO' => $info_photos['id_prop_pho'],
     236                        'AIPWORDING' => trigger_change('AP_render_content',$info_photos['wording']),
     237                        'AIPWORDING2' => $info_photos['wording'],
     238                        'AIPORDER' => $info_photos['orderprop'],
     239                        'AIPACTIVE' => $info_photos['active'],
     240                        'AIPEDIT' => $info_photos['edit'],
     241                        'U_DELETE' => $admin_base_url . '&delete=' . $info_photos['id_prop_pho'],
     242                        'U_HIDE' => $admin_base_url . '&hide=' . $info_photos['id_prop_pho'],
     243                        'U_SHOW' => $admin_base_url . '&show=' . $info_photos['id_prop_pho'],
    247244                    );
    248245                }       
     
    258255            foreach ($_POST['infoOrd'] as $id =>$val){
    259256           
    260             $data[] = array('id_info_pho' => $id, 'orderinfo' => $val+1);
    261             }
    262             $fields = array('primary' => array('id_info_pho'), 'update' => array('orderinfo'));
    263             mass_updates(ADD_INFO_PHOTO_TABLE, $fields, $data);
    264 
    265           $page['infos'][] = l10n('Info manual order was saved');
     257            $data[] = array('id_prop_pho' => $id, 'orderprop' => $val+1);
     258            }
     259            $fields = array('primary' => array('id_prop_pho'), 'update' => array('orderprop'));
     260            mass_updates(ADD_PROP_PHOTO_TABLE, $fields, $data);
     261
     262          $page['infos'][] = l10n('Properties manual order was saved');
    266263          redirect($admin_base_url);
    267264        }
    268        
    269         if (isset($_POST['submitaddinfo'])) {
    270             $template->assign(
    271                     'addinfo_edit2', array(
    272                 'AIPID' => 0,
    273                 'AIPDESC' => null,
    274                 'AIPACTIF' => 0,
    275             ));
    276 
    277         }
     265
    278266        if (isset($_POST['submitaddAIP'])) {
    279267            if (!isset($_POST['inseractive'])) {
     
    281269            }
    282270            if ($_POST['invisibleID'] == 0) {
    283                 $result = pwg_query('SELECT MAX(orderinfo) FROM piwigo_add_info_photos');
     271                $result = pwg_query('SELECT MAX(orderprop) FROM '. ADD_PROP_PHOTO_TABLE );
    284272                $row = pwg_db_fetch_assoc($result);
    285                 $or = ($row['MAX(orderinfo)'] + 1);
     273                $or = ($row['MAX(orderprop)'] + 1);
    286274
    287275                $q = '
    288                 INSERT INTO ' . $prefixeTable . 'add_Info_photos(designation,orderinfo,active,edit)VALUES ("' . $_POST['inserdesignation'] . '","' . $or . '","' . $_POST['inseractive'] . '",1);';
     276                INSERT INTO ' . $prefixeTable . 'add_properties_photos(wording,orderprop,active,edit)VALUES ("' . $_POST['inserwording'] . '","' . $or . '","' . $_POST['inseractive'] . '",1);';
    289277                pwg_query($q);
    290                 $_SESSION['page_infos'] = array(l10n('Personal info photo add'));
     278                $_SESSION['page_infos'] = array(l10n('Property photo add'));
    291279            } else {
    292280                $q = '
    293                 UPDATE ' . $prefixeTable . 'add_Info_photos'
    294                         . ' set designation ="' . $_POST['inserdesignation'] . '" '
     281                UPDATE ' . $prefixeTable . 'add_properties_photos'
     282                        . ' set wording ="' . $_POST['inserwording'] . '" '
    295283                        . ' ,active=' . $_POST['inseractive']
    296                         . ' WHERE id_info_pho=' . $_POST['invisibleID'] . ';';
     284                        . ' WHERE id_prop_pho=' . $_POST['invisibleID'] . ';';
    297285                pwg_query($q);
    298                 $_SESSION['page_infos'] = array(l10n('Personal info photo update'));
     286                $_SESSION['page_infos'] = array(l10n('Property photo update'));
    299287            }
    300288            redirect($admin_base_url);
    301         }
    302 
    303         if (isset($_GET['edit'])) {
    304             check_input_parameter('edit', $_GET, false, PATTERN_ID);
    305 
    306             $result = tab_info_photos($_GET['edit']);
    307             $row = pwg_db_fetch_assoc($result);
    308             $template->assign(
    309                     'addinfo_edit2', array(
    310                 'AIPID' => $row['id_info_pho'],
    311                 'AIPDESC' => $row['designation'],
    312                 'AIPACTIF' => $row['active'],
    313             ));
    314289        }
    315290
    316291        if (isset($_GET['delete'])) {
    317292            check_input_parameter('delete', $_GET, false, PATTERN_ID);
    318             $query = 'DELETE FROM ' . ADD_INFO_PHOTO_TABLE . ' WHERE id_info_pho = ' . $_GET['delete'] . ';';
     293            $query = 'DELETE FROM ' . ADD_PROP_PHOTO_TABLE . ' WHERE id_prop_pho = ' . $_GET['delete'] . ';';
    319294            pwg_query($query);
    320             $query = 'DELETE FROM ' . ADD_INFO_PHOTO_DATA_TABLE . ' WHERE id_info_pho = ' . $_GET['delete'] . ';';
     295            $query = 'DELETE FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' WHERE id_prop_pho = ' . $_GET['delete'] . ';';
    321296            pwg_query($query);
    322297
    323             $_SESSION['page_infos'] = array(l10n('Personal info delete'));
     298            $_SESSION['page_infos'] = array(l10n('Property delete'));
    324299            redirect($admin_base_url);
    325300        }
     
    327302        if (isset($_GET['hide'])) {
    328303            check_input_parameter('hide', $_GET, false, PATTERN_ID);
    329             $query = 'UPDATE ' . ADD_INFO_PHOTO_TABLE . ' SET active = 1 WHERE id_info_pho=' . $_GET['hide'] . ';';
     304            $query = 'UPDATE ' . ADD_PROP_PHOTO_TABLE . ' SET active = 1 WHERE id_prop_pho=' . $_GET['hide'] . ';';
    330305            pwg_query($query);
    331 
    332             $_SESSION['page_infos'] = array(l10n('Info hide'));
    333             redirect($admin_base_url);
    334306        }
    335307       
    336308        if (isset($_GET['show'])) {
    337309            check_input_parameter('show', $_GET, false, PATTERN_ID);
    338             $query = 'UPDATE ' . ADD_INFO_PHOTO_TABLE . ' SET active = 0 WHERE id_info_pho=' . $_GET['show'] . ';';
     310            $query = 'UPDATE ' . ADD_PROP_PHOTO_TABLE . ' SET active = 0 WHERE id_prop_pho=' . $_GET['show'] . ';';
    339311            pwg_query($query);
    340 
    341             $_SESSION['page_infos'] = array(l10n('Info show'));
    342             redirect($admin_base_url);
    343312        }
    344313
    345314        break;
    346     case 'configuration':
    347         global $conf;
    348 
    349         $selected = $conf['add_Info_photos'];
    350         $options['Author'] = l10n('Author');
    351         $options['datecreate'] = l10n('Created on');
    352         $options['datepost'] = l10n('Posted on');
    353         $options['Dimensions'] = l10n('Dimensions');
    354         $options['File'] = l10n('File');
    355         $options['Filesize'] = l10n('Filesize');
    356         $options['Tags'] = l10n('tags');
    357         $options['Categories'] = l10n('Albums');
    358         $options['Visits'] = l10n('Visits');
    359         $options['Average'] = l10n('Rating score');
    360 
    361         $template->assign(
    362                 'gestionA', array(
    363             'OPTIONS' => $options,
    364             'SELECTED' => $selected
    365         ));
    366 
    367 
    368         if (isset($_POST['add_Info_photos'])) {
    369             conf_update_param('add_Info_photos', $_POST['add_Info_photos'], true);
    370             $template->delete_compiled_templates();
    371             array_push($page['infos'], l10n('Your configuration settings are saved'));
    372 
    373             $selected = $_POST['add_Info_photos'];
    374             $template->assign(
    375                     'gestionA', array(
    376                 'OPTIONS' => $options,
    377                 'SELECTED' => $selected
    378             ));
    379         }
    380         break;
    381 
    382     case 'addinfo':
    383 
    384 
    385 
    386         break;
    387 }
     315 }
    388316
    389317
  • extensions/manage_properties_photos/admin/admin.tpl

    r30676 r30702  
    3333  });
    3434 
     35  jQuery('#aip_sumit').click(function(){
     36    jQuery("#add_info_edit").show();
     37    jQuery("#leg_add").show();
     38    jQuery("#leg_edit").hide();
     39    jQuery('#aip_add').empty();
     40    jQuery('#aip_hide').attr('checked', false);
     41    jQuery('#hideid').val(0);
     42    jQuery("textarea[name=inserwording]").focus();
     43  });
     44 
     45  jQuery("#addinfoClose").click(function(){
     46    jQuery("#add_info_edit").hide();
     47  });
     48 
     49  jQuery('.edit_libinfo').click(function(){
     50    var id_prop_photo=$(this).data('id');
     51    var lib=$(this).data('lib');
     52    var hide=$(this).data('hide');
     53    jQuery("#add_info_edit").show();
     54    jQuery("#leg_add").hide();
     55    jQuery("#leg_edit").show();
     56    jQuery('#hideid').val(id_prop_photo);
     57    jQuery('#aip_add').text(lib);
     58        if(hide==0){
     59            jQuery('#aip_hide').prop('checked', false);
     60        }else{
     61            jQuery('#aip_hide').prop('checked', true);
     62        }
     63    jQuery("textarea[name=inserwording]").focus();
     64  });
     65  jQuery('.pphide').click(function(){
     66    var id= $(this).data('id');
     67    var link= $(this).data('link2');
     68    $.ajax({
     69        method: 'POST',
     70        url: link,
     71        success: function(Datalc,textStatus,jqXHR) {
     72          jQuery('#pphide'+id).hide();
     73          jQuery('#ppshow'+id).show();
     74          jQuery('#iord_'+id).css("opacity","0.4");
     75        }
     76      });
     77    });
     78  jQuery('.ppshow').click(function(){
     79    var id= $(this).data('id');
     80    var link= $(this).data('link2');
     81    $.ajax({
     82        method: 'POST',
     83        url: link,
     84        success: function(Datalc,textStatus,jqXHR) {
     85          jQuery('#pphide'+id).show();
     86          jQuery('#ppshow'+id).hide();
     87          jQuery('#iord_'+id).css("opacity","1");
     88         }
     89      });
     90    });
    3591});
    3692{/footer_script}
    37 
     93{html_style}
     94.mouse:hover{
     95    cursor:pointer;
     96}
     97{/html_style}
    3898
    3999
    40100<div class="titrePage">
    41   <h2>{'Management information on picture page'|@translate}</h2>
     101  <h2>{'Manage properties photos'|@translate}</h2>
    42102</div>
    43103{if isset ($addinfotemplate)}
    44     <form method="post" action="{$addinfotemplate.U_HOMEP}" >
    45         <fieldset>
    46             <input class="submit" name="submitaddinfo" type="submit" value="{'Add info photo'|@translate}" />
    47         </fieldset>
    48     </form>
    49     {if isset ($addinfo_edit2)}
     104        <p class="showCreateAlbum">
     105            <a href="#" id="aip_sumit" >{'Create new Property photo'|@translate} </a>
     106        </p>
     107    <div id="add_info_edit" style="display: none;">
    50108        <form method="post" >
    51109            <fieldset>
    52             <legend>{'Info add/edit'|@translate}</legend>
    53                 <input type="hidden" name="invisibleID" value="{$addinfo_edit2.AIPID}">
     110                <legend><span id="leg_add">{'Create new Property photo'|@translate}</span><span id="leg_edit">{'Edit Property photo'|@translate}</span></legend>
     111                <input id="hideid" type="hidden" name="invisibleID" value="{$addinfo_edit2.AIPID}">
    54112                <p class="input">
    55                     <label for="inserdesignation">{'Designation'|@translate}</label><br />
    56                     <textarea {if $useED==1}placeholder="{'Use Extended Description tags...'|@translate}"{/if} style="margin-left:50px" rows="5" cols="50" class="description" name="inserdesignation" id="aip_add">{$addinfo_edit2.AIPDESC}</textarea>
     113                    <label for="inserwording">{'Wording'|@translate}</label><br />
     114                    <textarea {if $useED==1}placeholder="{'Use Extended Description tags...'|@translate}"{/if} style="margin-left:50px" rows="5" cols="50" class="description" name="inserwording" id="aip_add">{$addinfo_edit2.AIPDESC}</textarea>
    57115                    {if $useED==1}
    58116                    <a href="{$ROOT_URL}admin/popuphelp.php?page=extended_desc" onclick="popuphelp(this.href); return false;" title="{'Use Extended Description tags...'|translate}" style="vertical-align: middle; border: 0; margin: 0.5em;"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class="button" alt="{'Use Extended Description tags...'|translate}'"></a>
     
    61119                <p class="input" style="width: 700px;">
    62120                    <label for="inseractive">{'Hide'|@translate}</label>
    63                     <input type="checkbox" name="inseractive" {if {$addinfo_edit2.AIPACTIF}==1}checked{/if} value="1">
    64                 <div style="text-align:center;">
     121                    <input id="aip_hide" type="checkbox" name="inseractive" {if {$addinfo_edit2.AIPACTIF}==1}checked{/if} value="1">
     122                <p class="actionButtons">
    65123                    <input class="submit" name="submitaddAIP" type="submit" value="{'Submit'|@translate}" />
    66                 </div>
     124                    <a href="#" id="addinfoClose">{'Cancel'|@translate}</a>
     125                </p>
    67126            </fieldset>
    68127        </form>
    69     {/if}
     128    </div>
    70129    <form id="infoOrdering" method="post" >
    71         <p id="manualOrderInfo" style="display:none">
     130        <p id="manualOrderInfo" style="display:none; text-align: left">
    72131          <input class="submit" name="submitManualOrderInfo" type="submit" value="{'Save order'|@translate}">
    73132          {'... or '|@translate} <a href="#" id="cancelManualOrderInfo">{'cancel manual order'|@translate}</a>
    74133        </p>
    75134        <fieldset>
    76         <legend>{'List info'|@translate}</legend>
     135        <legend>{'Properties List'|@translate}</legend>
    77136          <ul class="categoryUl">
    78137            {foreach from=$info_photos item=infophoto}
    79               <li class="categoryLi{if ($infophoto.AIPEDIT==1)} virtual_cat{/if}" id="iord_{$infophoto.IDINFOPHO}">
     138              <li {if ($infophoto.AIPACTIVE==0)}style="opacity: 1;"{else}style="opacity: 0.4;"{/if}class="categoryLi{if ($infophoto.AIPEDIT==1)} virtual_cat{/if}" id="iord_{$infophoto.IDINFOPHO}">
    80139                <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}">
    81                 {$infophoto.AIPDESIGNATION}
     140                {$infophoto.AIPWORDING}
    82141                <input type="hidden" name="infoOrd[{$infophoto.IDINFOPHO}]" value="{$infophoto.AIPORDER}">
    83142                <br />
    84143                <span class="actiononphoto" style="display: none">
    85                     <label>{'Hide'|@translate}</label>
    86                     {if ($infophoto.AIPACTIVE==0)}
    87                         <a href="{$infophoto.U_HIDE}"><span class="graphicalCheckbox icon-check-empty"></span></a>
    88                     {/if}
    89                     {if ($infophoto.AIPACTIVE==1)}
    90                         <a href="{$infophoto.U_SHOW}"><span class="graphicalCheckbox icon-check"></span></a>
    91                     {/if}
     144                    <span id="pphide{$infophoto.IDINFOPHO}" {if ($infophoto.AIPACTIVE==1)}style="display: none"{/if}class="graphicalCheckbox icon-check-empty mouse pphide" data-id="{$infophoto.IDINFOPHO}" data-link2="{$infophoto.U_HIDE}">{'Hide'|@translate}</span>
     145                    <span id="ppshow{$infophoto.IDINFOPHO}" {if ($infophoto.AIPACTIVE==0)}style="display: none"{/if}class="graphicalCheckbox icon-check mouse ppshow" data-id="{$infophoto.IDINFOPHO}" data-link2="{$infophoto.U_SHOW}">{'Hide'|@translate}</span>
    92146                    {if ($infophoto.AIPEDIT==1)}
    93                     <a href="{$infophoto.U_EDIT}">
    94                       <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" alt="{'edit'|@translate}" title="{'edit'|@translate}" />
    95                     </a>
     147                    <img class="edit_libinfo mouse" src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" data-id="{$infophoto.IDINFOPHO}" data-lib="{$infophoto.AIPWORDING2}" data-hide="{$infophoto.AIPACTIVE}" alt="{'edit'|@translate}" title="{'edit'|@translate}" />
    96148                    <a href="{$infophoto.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
    97149                      <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete'|@translate}" />
     
    106158    </form>
    107159{/if}
    108 {if isset ($gestionA)}
    109         <div>
    110                 <form method="post" >
    111                         <fieldset>
    112                                 <legend>{'Add information before'|@translate}</legend>
    113                 {html_options name="add_Info_photos" options=$gestionA.OPTIONS selected=$gestionA.SELECTED}
    114                                 <br>   
    115                                 <br>
    116                                         <div style="text-align:center;">
    117                                         <input class="submit" name="submitpab" type="submit" value="{'Save Settings'|@translate}">
    118                                         </div>
    119                         </fieldset>
    120                 </form>
    121         </div>
    122 {/if}
    123160{if isset ($gestionD)}
    124161<div>
    125162    <form method="post" >
    126163        <fieldset>
    127         <legend>{'List info'|@translate}</legend>
     164        <legend>{'Properties additionals'|@translate}</legend>
    128165        <table>
    129166            {foreach from=$info_photos item=infophoto}
    130167            <tr>
    131                 <td style="width: 100px;"><span style="font-weight: bold; text-align: right;" >{$infophoto.AIPDESIGNATION}</span></td>
     168                <td style="width: 100px;"><span style="font-weight: bold; text-align: right;" >{$infophoto.AIPWORDING}</span></td>
    132169                <td><input type="text" size="150" maxlength="250" {if $useED==1}placeholder="{'Use Extended Description tags...'|@translate}"{/if} name="data[{$infophoto.IDINFOPHO}]" value="{$infophoto.AIPDATA}" /></td>
    133170            </tr> 
  • extensions/manage_properties_photos/include/function.aip.inc.php

    r30631 r30702  
    11<?php
     2/*picture*/
    23function tab_add_info_one_photo($id_img){
    34$query = '
    4     SELECT aip.id_info_pho,aip.designation,aipd.data,aip.orderinfo
    5     FROM ' . ADD_INFO_PHOTO_TABLE . ' AS aip
    6     LEFT JOIN ' . ADD_INFO_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_info_pho=aipd.id_info_pho
     5    SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop
     6    FROM ' . ADD_PROP_PHOTO_TABLE . ' AS aip
     7    LEFT JOIN ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_prop_pho=aipd.id_prop_pho
    78    WHERE aipd.id_img = \'' . $id_img . '\'
    89    AND aip.active = 0
    9     ORDER BY aip.orderinfo ASC
     10    ORDER BY aip.orderprop ASC
    1011    ;';
    1112
    1213return pwg_query($query);
    1314}
    14 
     15/*
    1516function tab_add_info_one_photo2($id_img){
    1617$query = '
    17     SELECT aip.id_info_pho,aip.designation,aipd.data,aip.orderinfo
    18     FROM ' . ADD_INFO_PHOTO_DATA_TABLE . ' AS aipd
    19     RIGHT JOIN ' . ADD_INFO_PHOTO_TABLE . ' AS aip ON aip.id_info_pho=aipd.id_info_pho
     18    SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop
     19    FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd
     20    RIGHT JOIN ' . ADD_PROP_PHOTO_TABLE . ' AS aip ON aip.id_prop_pho=aipd.id_prop_pho
    2021    WHERE aipd.id_img = \'' . $id_img . '\'
    2122    AND aip.active = 0
    22     ORDER BY aip.orderinfo ASC
     23    ORDER BY aip.orderprop ASC
    2324    ;';
    2425
    2526return pwg_query($query);
    2627}
    27 
     28*/
     29/*Admin*/
    2830function tab_add_info_by_photo(){
    2931$query = '
    30     SELECT id_info_pho,designation
    31     FROM ' . ADD_INFO_PHOTO_TABLE . '
     32    SELECT id_prop_pho,wording
     33    FROM ' . ADD_PROP_PHOTO_TABLE . '
    3234    WHERE active = 0
    3335    AND edit = 1
    34     ORDER BY orderinfo ASC
     36    ORDER BY orderprop ASC
    3537    ;';
    3638return pwg_query($query);
    3739}
    3840
     41
     42/*initpicture*/
    3943function tab_add_info_by_photo_show(){
    4044$query = '
    41     SELECT id_info_pho,designation,orderinfo
    42     FROM ' . ADD_INFO_PHOTO_TABLE . '
     45    SELECT id_prop_pho,wording,orderprop
     46    FROM ' . ADD_PROP_PHOTO_TABLE . '
    4347    WHERE active = 0
    44     ORDER BY orderinfo ASC
     48    ORDER BY orderprop ASC
    4549    ;';
    4650return pwg_query($query);
    4751}
    4852
    49 function data_info_photos($id_img=null,$id_info_pho=NULL){
     53/*initpicture et admin*/
     54function data_info_photos($id_img=null,$id_prop_pho=NULL){
    5055$query = '
    5156    SELECT data
    52     FROM ' . ADD_INFO_PHOTO_DATA_TABLE;
     57    FROM ' . ADD_PROP_PHOTO_DATA_TABLE;
    5358    $wa='WHERE';
    5459    if($id_img!=null){
    5560        $query .=' '.$wa.' id_img='.$id_img;$wa='AND';
    5661    }
    57     if($id_info_pho!=null){
    58         $query .=' '.$wa.' id_info_pho='.$id_info_pho;$wa='AND';
     62    if($id_prop_pho!=null){
     63        $query .=' '.$wa.' id_prop_pho='.$id_prop_pho;$wa='AND';
    5964    }
    6065$query .= ';';
     
    6267}
    6368
    64 
    65 function tab_info_photos($id_info_pho=NULL){
     69/*Admin*/
     70function tab_info_photos($id_prop_pho=NULL){
    6671$query = '
    67     SELECT id_info_pho,designation,orderinfo,active,edit
    68     FROM ' . ADD_INFO_PHOTO_TABLE;
    69     if($id_info_pho!=null){
    70         $query .= ' WHERE id_info_pho='.$id_info_pho;
     72    SELECT id_prop_pho,wording,orderprop,active,edit
     73    FROM ' . ADD_PROP_PHOTO_TABLE;
     74    if($id_prop_pho!=null){
     75        $query .= ' WHERE id_prop_pho='.$id_prop_pho;
    7176    }
    7277
    73 $query .= ' ORDER BY orderinfo ASC
     78$query .= ' ORDER BY orderprop ASC
    7479    ;';
    7580return pwg_query($query);
  • extensions/manage_properties_photos/initadmin.php

    r30631 r30702  
    55
    66function add_info_photo_admin_menu($menu) {
    7     load_language('plugin.lang', ADD_INFO_PHOTO_PATH);
     7    load_language('plugin.lang', ADD_PROP_PHOTO_PATH);
    88    $menu[] = array(
    9         'NAME' => l10n('Manage infos photos'),
    10         'URL' => ADD_INFO_PHOTO_ADMIN,
     9        'NAME' => l10n('Manage properties photos'),
     10        'URL' => ADD_PROP_PHOTO_ADMIN,
    1111    );
    1212     return $menu;
     
    2222  {
    2323    $sheets['iap'] = array(
    24       'caption' => l10n('Info photos'),
    25       'url' => ADD_INFO_PHOTO_ADMIN.'-iap&amp;image_id='.$_GET['image_id'],
     24      'caption' => l10n('Properties additionals'),
     25      'url' => ADD_PROP_PHOTO_ADMIN.'-iap&amp;image_id='.$_GET['image_id'],
    2626      );
    2727  }
  • extensions/manage_properties_photos/initpicture.php

    r30642 r30702  
    22
    33//Ajout du prefiltre
    4 add_event_handler('loc_begin_picture', 'add_info_photo_pre', 56);
     4add_event_handler('loc_begin_picture', 'add_info_photo_pre', 05);
    55
    66function add_info_photo_pre() {
     
    155155        </div>
    156156    {else if $addinfophotos.AIPDATA}
    157         <div id="add_info class="imageInfo">
    158           <dt class="label">{$addinfophotos.AIPDESIGNATION}</dt>
     157        <div id="add_info" class="imageInfo">
     158          <dt class="label">{$addinfophotos.AIPWORDING}</dt>
    159159          <dd class="value">{$addinfophotos.AIPDATA}</dd>
    160160        </div>
     
    185185            while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) {
    186186
    187                 $d = data_info_photos($page['image_id'], $info_photos['id_info_pho']);
     187                $d = data_info_photos($page['image_id'], $info_photos['id_prop_pho']);
    188188                $row = pwg_db_fetch_assoc($d);
    189189
    190190                $items = array(
    191                     'AIPID' => $info_photos['id_info_pho'],
    192                     'AIPORDER' => $info_photos['orderinfo'],
    193                     'AIPDESIGNATION' => trigger_change('AP_render_content', $info_photos['designation']),
     191                    'AIPID' => $info_photos['id_prop_pho'],
     192                    'AIPORDER' => $info_photos['orderprop'],
     193                    'AIPWORDING' => trigger_change('AP_render_content', $info_photos['wording']),
    194194                    'AIPDATA' => trigger_change('AP_render_content', $row['data']),
    195195                );
  • extensions/manage_properties_photos/language/en_UK/description.txt

    r30631 r30702  
    1 Add information about the photo page and organize information
     1Add properties on photo page and organize this
  • extensions/manage_properties_photos/language/en_UK/plugin.lang.php

    r30652 r30702  
    11<?php
    22//admin
    3 $lang['Manage infos photos'] = 'Manage infos photos';
    4 $lang['Info photos'] = 'Info photos';
    5 $lang['Information\'s organization'] = 'Information\'s organization';
    6 $lang['Personal info photo update'] = 'Personal info photo update';
    7 $lang['Info manual order was saved'] = 'Info manual order was saved';
    8 $lang['Personal info photo add'] = 'Personal info photo add';
    9 $lang['Personal info delete'] = 'Personal info delete';
    10 $lang['Info hide'] = 'Hidden info';
    11 $lang['Info show'] = 'Info show';
    12 $lang['Management information on picture page'] = 'Management information on picture page';
    13 $lang['Add info photo'] = 'Add info photo';
    14 $lang['Info add/edit'] = 'Add/Edit info';
    15 $lang['Designation'] = 'Designation';
    16 $lang['List info'] = 'Info list';
     3$lang['Manage properties photos'] = 'Manage properties photos';
     4$lang['Properties additionals'] = 'Properties additionals';
     5$lang['Property'] = 'Property';
     6$lang['Properties update'] = 'Properties update';
     7$lang['Properties manual order was saved'] = 'Properties manual order was saved';
     8$lang['Property photo add'] = 'Property photo add';
     9$lang['Property photo update'] = 'Property photo update';
     10$lang['Property delete'] = 'Property delete';
     11$lang['Create new Property photo'] = 'Create new Property photo';
     12$lang['Edit Property photo'] = 'Edit Property photo';
     13$lang['Wording'] = 'Wording';
     14$lang['Properties List'] = 'Properties List';
     15$lang['Properties additionals'] = 'Properties additionals';
  • extensions/manage_properties_photos/main.inc.php

    r30641 r30702  
    11<?php
    22/*
    3 Plugin Name: Manage Infos Photos
     3Plugin Name: Manage Properties Photos
    44Version: auto
    5 Description: Can add information on photos
     5Description: Add properties on photo page and organize this
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=783
    77Author: ddtddt
     
    1313global $prefixeTable;
    1414
    15 define('ADD_INFO_PHOTO_DIR' , basename(dirname(__FILE__)));
    16 define('ADD_INFO_PHOTO_PATH' , PHPWG_PLUGINS_PATH . ADD_INFO_PHOTO_DIR . '/');
    17 if (!defined('ADD_INFO_PHOTO_TABLE')) define('ADD_INFO_PHOTO_TABLE', $prefixeTable.'add_Info_photos');
    18 if (!defined('ADD_INFO_PHOTO_DATA_TABLE')) define('ADD_INFO_PHOTO_DATA_TABLE', $prefixeTable.'add_Info_photos_data');
    19 define('ADD_INFO_PHOTO_ADMIN',get_root_url().'admin.php?page=plugin-'.ADD_INFO_PHOTO_DIR);
     15define('ADD_PROP_PHOTO_DIR' , basename(dirname(__FILE__)));
     16define('ADD_PROP_PHOTO_PATH' , PHPWG_PLUGINS_PATH . ADD_PROP_PHOTO_DIR . '/');
     17if (!defined('ADD_PROP_PHOTO_TABLE')) define('ADD_PROP_PHOTO_TABLE', $prefixeTable.'add_properties_photos');
     18if (!defined('ADD_PROP_PHOTO_DATA_TABLE')) define('ADD_PROP_PHOTO_DATA_TABLE', $prefixeTable.'add_properties_photos_data');
     19define('ADD_PROP_PHOTO_ADMIN',get_root_url().'admin.php?page=plugin-'.ADD_PROP_PHOTO_DIR);
    2020
    21 include_once(ADD_INFO_PHOTO_PATH . 'include/function.aip.inc.php');
     21include_once(ADD_PROP_PHOTO_PATH . 'include/function.aip.inc.php');
    2222
    2323 // Plugin on picture page
  • extensions/manage_properties_photos/maintain.class.php

    r30676 r30702  
    22defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    33
    4 class manage_info_photos_maintain extends PluginMaintain
     4class manage_properties_photos_maintain extends PluginMaintain
    55{
    66  private $installed = false;
     
    1313       global $prefixeTable;
    1414
    15 if (!defined('ADD_INFO_PHOTO_TABLE')) define('ADD_INFO_PHOTO_TABLE', $prefixeTable.'add_Info_photos');
    16         $query = "CREATE TABLE IF NOT EXISTS ". ADD_INFO_PHOTO_TABLE ." (
    17 id_info_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment,
    18 designation VARCHAR(255) NOT NULL ,
    19 orderinfo SMALLINT(5) UNSIGNED NOT NULL ,
     15if (!defined('ADD_PROP_PHOTO_TABLE')) define('ADD_PROP_PHOTO_TABLE', $prefixeTable.'add_properties_photos');
     16        $query = "CREATE TABLE IF NOT EXISTS ". ADD_PROP_PHOTO_TABLE ." (
     17id_prop_pho SMALLINT(5) UNSIGNED NOT NULL auto_increment,
     18wording VARCHAR(255) NOT NULL ,
     19orderprop SMALLINT(5) UNSIGNED NOT NULL ,
    2020active SMALLINT(5) UNSIGNED NOT NULL ,
    2121edit SMALLINT(5) UNSIGNED NOT NULL ,
    22 PRIMARY KEY (id_info_pho))DEFAULT CHARSET=utf8;";
     22PRIMARY KEY (id_prop_pho))DEFAULT CHARSET=utf8;";
    2323        $result = pwg_query($query);
    2424
    25 if (!defined('ADD_INFO_PHOTO_DATA_TABLE')) define('ADD_INFO_PHOTO_DATA_TABLE', $prefixeTable.'add_Info_photos_data');
    26         $query = "CREATE TABLE IF NOT EXISTS ". ADD_INFO_PHOTO_DATA_TABLE ." (
     25if (!defined('ADD_PROP_PHOTO_DATA_TABLE')) define('ADD_PROP_PHOTO_DATA_TABLE', $prefixeTable.'add_properties_photos_data');
     26        $query = "CREATE TABLE IF NOT EXISTS ". ADD_PROP_PHOTO_DATA_TABLE ." (
    2727id_img SMALLINT(5) UNSIGNED NOT NULL ,
    28 id_info_pho SMALLINT(5) UNSIGNED NOT NULL ,
     28id_prop_pho SMALLINT(5) UNSIGNED NOT NULL ,
    2929data VARCHAR(255) NOT NULL ,
    30 PRIMARY KEY (id_img,id_info_pho))DEFAULT CHARSET=utf8;";
     30PRIMARY KEY (id_img,id_prop_pho))DEFAULT CHARSET=utf8;";
    3131        $result = pwg_query($query);
    3232       
    33 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (1,"author",1,0,0);';
     33$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (1,"author",1,0,0);';
    3434    pwg_query($q);
    35 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (2,"Created on",2,0,0);';
     35$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (2,"Created on",2,0,0);';
    3636    pwg_query($q);
    37 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (3,"Posted on",3,0,0);';
     37$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (3,"Posted on",3,0,0);';
    3838    pwg_query($q);
    39 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (4,"Dimensions",4,0,0);';
     39$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (4,"Dimensions",4,0,0);';
    4040    pwg_query($q);   
    41 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (5,"File",5,0,0);';
     41$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (5,"File",5,0,0);';
    4242    pwg_query($q);         
    43 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (6,"Filesize",6,0,0);';
     43$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (6,"Filesize",6,0,0);';
    4444    pwg_query($q);
    45 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (7,"Tags",7,0,0);';
     45$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (7,"Tags",7,0,0);';
    4646    pwg_query($q);   
    47 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (8,"Albums",8,0,0);';
     47$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (8,"Albums",8,0,0);';
    4848    pwg_query($q);     
    49 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (9,"Visits",9,0,0);';
     49$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (9,"Visits",9,0,0);';
    5050    pwg_query($q);       
    51 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (10,"Average",10,0,0);';
     51$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (10,"Average",10,0,0);';
    5252    pwg_query($q);
    53 $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES (11,"Who can see this photo?",11,0,0);';
     53$q = 'INSERT INTO ' . $prefixeTable . 'add_properties_photos(id_prop_pho,wording,orderprop,active,edit)VALUES (11,"Who can see this photo?",11,0,0);';
    5454    pwg_query($q);
    5555   
     
    6161
    6262  function update($old_version, $new_version, &$errors=array()){
    63     global $conf;
    64     if (!isset($conf['add_Info_photos'])) {
    65         conf_update_param('add_Info_photos','Categories',true);
    66     }
     63
    6764  }
    6865 
     
    7168
    7269  function uninstall(){
    73     conf_delete_param('add_Info_photos');
    74     $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos;';
     70    $q = 'DROP TABLE ' . $prefixeTable . 'add_properties_photos;';
    7571    pwg_query($q);
    76     $q = 'DROP TABLE ' . $prefixeTable . 'add_Info_photos_data;';
     72    $q = 'DROP TABLE ' . $prefixeTable . 'add_properties_photos_data;';
    7773    pwg_query($q);
    7874  }
Note: See TracChangeset for help on using the changeset viewer.