Changeset 9449 for extensions/PWG_Stuffs
- Timestamp:
- Mar 1, 2011, 1:00:44 PM (13 years ago)
- Location:
- extensions/PWG_Stuffs
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PWG_Stuffs/admin/manage.inc.php
r9410 r9449 30 30 pwg_query(' 31 31 UPDATE ' . STUFFS_TABLE . ' 32 SET datas = "'.addslashes(serialize( array('hide' => isset($_POST['hidemb'])))).'"32 SET datas = "'.addslashes(serialize(!isset($_POST['hidemb']))).'" 33 33 WHERE id=0;'); 34 34 … … 60 60 $module['name'] = !empty($module['path']) ? $module['name'] : l10n('stuffs_main_block'); 61 61 62 $missing = false; 62 $missing_message = ''; 63 if ($module['path'] == PHPWG_PLUGINS_PATH.'piclens/stuffs_module/' and !file_exists(PICLENS_PATH.'stuffs_module/main.inc.php')) 64 { 65 $missing_message = l10n('stuffs_piclens_need_upgrade'); 66 } 63 67 if (!empty($module['path'])) 64 68 { 65 69 preg_match('#^'.preg_quote(PHPWG_PLUGINS_PATH).'([^/]*?)/#', $module['path'], $match); 66 $missing = !isset($pwg_loaded_plugins[$match[1]]); 70 if (!isset($pwg_loaded_plugins[$match[1]])) 71 { 72 $missing_message = l10n('stuffs_parent_plugin_is_missing'); 73 } 67 74 } 68 75 … … 80 87 'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&tab=edit_module&edit='.$module['id'], 81 88 'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '', 82 'MISSING' => $missing ,89 'MISSING' => $missing_message, 83 90 ) 84 91 ); 85 92 86 if (empty($module['path']) and !empty($module['datas']))93 if (empty($module['path'])) 87 94 { 88 $ datas= unserialize($module['datas']);89 $template->assign('HIDEMB', $datas['hide']);95 $show = unserialize($module['datas']); 96 $template->assign('HIDEMB', !$show); 90 97 } 91 98 } -
extensions/PWG_Stuffs/admin/template/manage.tpl
r9369 r9449 63 63 <input type="text" size="2" maxlength="2" value="{$module.WIDTH}" name="width[{$module.ID}]" > % 64 64 </li> 65 {if !$module.MISSING}65 {if empty($module.MISSING)} 66 66 <li><a href="{$module.U_EDIT}" title="{'stuffs_edit'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'stuffs_edit'|@translate}"/></a></li> 67 67 {/if} … … 78 78 </p> 79 79 80 {if $module.MISSING}81 <p style="margin-left: 30px;">{ 'stuffs_parent_plugin_is_missing'|@translate}</p>80 {if !empty($module.MISSING)} 81 <p style="margin-left: 30px;">{$module.MISSING}</p> 82 82 {elseif !empty($module.DESC)} 83 83 <p style="margin-left: 30px;"><i>{$module.DESC}</i></p> -
extensions/PWG_Stuffs/admin/template/new.tpl
r9369 r9449 3 3 </div> 4 4 5 <form method="post" action="" class=" general">5 <form method="post" action="" class="properties"> 6 6 7 <fieldset> 8 <legend>{'stuffs_add_mod'|@translate}</legend> 9 10 <table> 11 {foreach from=$add_module item=module} 12 <tr> 13 <td><input type="radio" value="{$module.MODULE_PATH}" name="module"/> 14 <b>{$module.NAME}</b> : {$module.DESC}</td> 15 </tr> 16 {/foreach} 17 </table> 18 <br> 19 <div style="text-align:center;"> 20 <input class="submit" name="addModule" type="submit" value="{'stuffs_add_mod'|@translate}" {$TAG_INPUT_ENABLED} /> 21 </div> 22 7 <fieldset id="indexDisplayConf" style="padding-top:25px;"> 8 <legend>{'stuffs_add_mod'|@translate}</legend> 9 <ul> 10 {foreach from=$add_module item=module} 11 <li> 12 <label> 13 <span class="property">{$module.NAME} <span style="font-weight:normal;">: {$module.DESC}</span></span> 14 <input type="radio" value="{$module.MODULE_PATH}" name="module"/> 15 </label> 16 </li> 17 {/foreach} 18 </ul> 23 19 </fieldset> 24 20 <p><input class="submit" name="addModule" type="submit" value="{'stuffs_add_mod'|@translate}"/></p> 25 21 </form> -
extensions/PWG_Stuffs/admin/upgrade.inc.php
r9410 r9449 5 5 global $prefixeTable, $conf; 6 6 7 $query = 'SHOW FULL COLUMNS FROM ' . $prefixeTable . 'stuffs;';7 $query = 'SHOW FULL COLUMNS FROM '.STUFFS_TABLE.';'; 8 8 $result = array_from_query($query, 'Field'); 9 9 if ($result[5] == 'params') 10 10 { 11 $query = 'ALTER TABLE ' . $prefixeTable . 'stuffs11 $query = 'ALTER TABLE '.STUFFS_TABLE.' 12 12 MODIFY COLUMN name TEXT CHARACTER SET utf8 NOT NULL, 13 13 MODIFY COLUMN descr VARCHAR(255) CHARACTER SET utf8 default NULL, … … 30 30 pwg_query($query); 31 31 32 $query = 'SELECT id, name, type, params, datas FROM ' . $prefixeTable . 'stuffs;';32 $query = 'SELECT id, name, type, params, datas FROM '.STUFFS_TABLE.';'; 33 33 $result = pwg_query($query); 34 34 … … 76 76 } 77 77 78 $query = 'ALTER TABLE ' . $prefixeTable . 'stuffsDROP params;';78 $query = 'ALTER TABLE '.STUFFS_TABLE.' DROP params;'; 79 79 pwg_query($query); 80 80 … … 86 86 } 87 87 88 $query = 'SHOW FULL COLUMNS FROM ' . $prefixeTable . 'stuffs;';88 $query = 'SHOW FULL COLUMNS FROM '.STUFFS_TABLE.';'; 89 89 $result = array_from_query($query, 'Field'); 90 90 if ($result[4] != 'path') 91 91 { 92 $query = 'ALTER TABLE ' . $prefixeTable . 'stuffs 92 $path = $plugin['id']; 93 $conf['Stuffs'] = array(); 94 95 $query = 'ALTER TABLE '.STUFFS_TABLE.' 93 96 CHANGE `type` `path` VARCHAR( 255 ) NULL DEFAULT NULL, 94 97 ADD `level` TINYINT( 3 ) NOT NULL default "0" AFTER `groups`, … … 97 100 pwg_query($query); 98 101 99 $query = 'UPDATE ' . $prefixeTable . 'stuffs102 $query = 'UPDATE '.STUFFS_TABLE.' 100 103 SET on_root = "false" 101 WHERE on_cats = "false"104 WHERE on_cats <> "true" 102 105 ;'; 103 106 pwg_query($query); 104 107 105 $query = 'UPDATE ' . $prefixeTable . 'stuffs 106 SET path = CONCAT("'.PHPWG_ROOT_PATH.'", "plugins/PWG_Stuffs/", path, "/") 107 WHERE path <> "MainBlock" 108 $query = 'SELECT * FROM '.STUFFS_TABLE.';'; 109 $result = pwg_query($query); 110 111 while ($row = pwg_db_fetch_assoc($result)) 112 { 113 if ($row['path'] == 'Personal') 114 { 115 $data = unserialize($row['datas']); 116 $row['datas'] = serialize($data[0]); 117 } 118 if ($row['path'] == 'piclenswall') 119 { 120 $row['path'] = PHPWG_PLUGINS_PATH.'piclens/stuffs_module/'; 121 $conf['Stuffs']['piclens_upgrade'] = true; 122 } 123 elseif ($row['path'] != 'MainBlock') 124 { 125 $row['path'] = PHPWG_PLUGINS_PATH.$path.'/modules/'.$row['path'].'/'; 126 } 127 else 128 { 129 // Main Block 130 $row['path'] = null; 131 if (!empty($row['datas'])) 132 { 133 $data = unserialize($row['datas']); 134 $row['datas'] = serialize(!$data['hide']); 135 } 136 else 137 { 138 $row['datas'] = serialize(true); 139 } 140 } 141 142 $query = 'UPDATE '.STUFFS_TABLE.' 143 SET path = '.(is_null($row['path']) ? 'NULL' : '"'.$row['path'].'"').', 144 datas = "'.addslashes($row['datas']).'" 145 WHERE id = '.$row['id'].' 108 146 ;'; 109 pwg_query($query); 147 pwg_query($query); 148 } 110 149 111 $query = 'UPDATE ' . $prefixeTable . 'stuffs 112 SET path = NULL 113 WHERE path = "MainBlock" 114 ;'; 115 pwg_query($query); 116 117 $conf['Stuffs'] = array('level_perm' => false); 150 $conf['Stuffs']['level_perm'] = false; 118 151 119 152 $query = 'SELECT id 120 FROM '. $prefixeTable.'stuffs153 FROM '.STUFFS_TABLE.' 121 154 WHERE users <> "guest,generic,normal,admin,webmaster" 122 155 ;'; … … 125 158 126 159 $query = 'SELECT id 127 FROM '. $prefixeTable.'stuffs160 FROM '.STUFFS_TABLE.' 128 161 WHERE groups IS NOT NULL 129 162 ;'; … … 132 165 133 166 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 134 VALUES ("PWG_Stuffs" , "'.pwg_db_real_escape_string(serialize($conf['Stuffs'])).'" , "PWG Stuffs configuration");'; 135 pwg_query($query); 167 VALUES ("PWG_Stuffs" , "'.pwg_db_real_escape_string(serialize($conf['Stuffs'])).'" , "PWG Stuffs plugin configuration");'; 168 pwg_query($query); 169 } 170 171 // Display Piclens upgrade message 172 if (isset($conf['Stuffs']['piclens_upgrade']) and isset($menu)) 173 { 174 if (file_exists(PHPWG_PLUGINS_PATH.'piclens/stuffs_module/main.inc.php')) 175 { 176 unset($conf['Stuffs']['piclens_upgrade']); 177 } 178 else 179 { 180 if (get_db_plugins('active','piclens')) 181 { 182 global $page; 183 load_language('plugin.lang', STUFFS_PATH); 184 array_push($page['errors'], l10n('stuffs_piclens_need_upgrade')); 185 } 186 } 187 conf_update_param('PWG_Stuffs', pwg_db_real_escape_string(serialize($conf['Stuffs']))); 136 188 } 137 189 -
extensions/PWG_Stuffs/class.inc.php
r9410 r9449 81 81 { 82 82 $this->pos = 'end'; 83 if (!empty($module['datas']) 84 and $datas = unserialize($module['datas']) 85 and $datas['hide']) 83 $show = unserialize($module['datas']); 84 if (!$show) 86 85 { 87 86 add_event_handler('loc_end_index', 'hide_main_block'); … … 189 188 { 190 189 $css = array( 191 '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/ PWG_Stuffs/theme/stuffs_index.css">'190 '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/'.STUFFS_DIR.'/theme/stuffs_index.css">' 192 191 ); 193 192 … … 208 207 { 209 208 $css = array( 210 '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/ PWG_Stuffs/theme/stuffs_picture.css">'209 '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/'.STUFFS_DIR.'/theme/stuffs_picture.css">' 211 210 ); 212 211 -
extensions/PWG_Stuffs/language/en_UK/plugin.lang.php
r9383 r9449 17 17 $lang['stuffs_confirm_delete'] = 'Are you sure you want to delete module %s?'; 18 18 $lang['stuffs_main_block'] = 'Main block'; 19 $lang['Hide on home page'] = 'Hide on home page'; 19 20 20 21 $lang['stuffs_add_module'] = 'Add new module'; … … 28 29 $lang['stuffs_show_module_on'] = 'Show module :'; 29 30 $lang['stuffs_show_on_home'] = 'On main page'; 31 $lang['stuffs_show_on_root'] = 'On categories root page'; 30 32 $lang['stuffs_show_on_cats'] = 'On all categories pages'; 31 33 $lang['stuffs_show_on_picture'] = 'On picture pages'; 32 34 $lang['stuffs_no_options'] = 'No options for this module'; 33 $lang['Hide on home page'] = 'Hide on home page';34 35 35 36 $lang['stuffs_perm'] = 'Activate authorization management:'; … … 37 38 $lang['stuffs_user_perm'] = 'by user type'; 38 39 $lang['stuffs_level_perm'] = 'by privacy level'; 39 $lang['stuffs_show_on_root'] = 'On root categories'; 40 41 $lang['stuffs_select_all'] = 'Select all'; 42 $lang['stuffs_unselect_all'] = 'Unselect all'; 40 43 41 44 //Messages d'infos 42 45 $lang['stuffs_order_saved'] = 'Order successfully saved.'; 43 46 $lang['stuffs_upgrade_message'] = 'PWG Stuffs plugin as been renamed. It is now called "Blocks".'; 44 47 45 48 // Messages d'erreurs … … 47 50 $lang['stuffs_no_name'] = 'You must specify name module'; 48 51 $lang['stuffs_parent_plugin_is_missing'] = 'PARENT PLUGIN IS NOT ACTIVATED. You should remove this module or re-activate parent plugin.'; 52 $lang['stuffs_piclens_need_upgrade'] = 'PICLENS PLUGIN MUST BE UPDATED. PWG Stuffs is not compatible with this version of Piclens.'; 49 53 50 54 //------------------------------------------------------------------------------ … … 65 69 $lang['lastcoms_taille_cadres'] = 'Frame height'; 66 70 67 68 71 //------------------------------------------------------------------------------ 69 72 // Module Logon … … 75 78 $lang['logon_remove_menubar_block'] = 'Remove "Quick connect" block from menubar'; 76 79 77 78 80 //------------------------------------------------------------------------------ 79 81 // Module Personal … … 84 86 85 87 $lang['personal_content'] = 'content'; 86 87 88 88 89 //------------------------------------------------------------------------------ … … 97 98 $lang['stuffs_tags_letters'] = 'Group by lettters'; 98 99 $lang['stuffs_tags_cumulus'] = 'Use cumulus mode (plugin <a href=http://piwigo.org/ext/extension_view.php?eid=263 target="_blank">Cumulus Tags Cloud</a> must be installed)'; 99 100 101 //------------------------------------------------------------------------------102 // Module Piclenswall103 //------------------------------------------------------------------------------104 105 $lang['module_name_piclenswall'] = 'Piclens 3DWall';106 $lang['module_desc_piclenswall'] = 'Display piclens 3D wall (plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234" target="_blank">Cooliris/piclens</a> must be installed)';107 108 $lang['piclenswall_height'] = 'Wall height';109 $lang['piclenswall_background_color'] = 'Background color';110 $lang['piclenswall_black'] = 'Black';111 $lang['piclenswall_white'] = 'White';112 $lang['piclenswall_info'] = 'So that the wall is working properly';113 $lang['piclenswall_info_piclens'] = 'You must install and activate <a href="http://piwigo.org/ext/extension_view.php?eid=234">Cooliris/piclens</a> plugin.';114 $lang['piclenswall_info_crossdomain'] = 'You must copy <a href="%s">crossdomain.xml</a> file to the root of your site (or moddify existing file).';115 $lang['piclenswall_info_param'] = '3D Wall Settings must be modified in <b>Cooliris-piclens/b> plugin configuration page.';116 100 117 101 //------------------------------------------------------------------------------ -
extensions/PWG_Stuffs/language/fr_FR/plugin.lang.php
r9383 r9449 29 29 $lang['stuffs_show_module_on'] = 'Afficher le module :'; 30 30 $lang['stuffs_show_on_home'] = 'Sur la page d\'accueil du site'; 31 $lang['stuffs_show_on_root'] = 'A la racine des catégories'; 31 32 $lang['stuffs_show_on_cats'] = 'Sur toutes les pages des catégories'; 32 33 $lang['stuffs_show_on_picture'] = 'Sur les pages des images'; … … 37 38 $lang['stuffs_user_perm'] = 'par type d\'utilisateurs'; 38 39 $lang['stuffs_level_perm'] = 'par niveau de confidentialité'; 39 $lang['stuffs_show_on_root'] = 'A la racine des catégories'; 40 41 $lang['stuffs_select_all'] = 'Sélectionner tout'; 42 $lang['stuffs_unselect_all'] = 'Déselectionner tout'; 40 43 41 44 //Messages d'infos 42 45 $lang['stuffs_order_saved'] = 'L\'ordre a été sauvegardé.'; 43 46 $lang['stuffs_upgrade_message'] = 'Le plugin PWG Stuffs a été renommé. Il s\'appelle désormais "Blocks".'; 44 47 45 48 // Messages d'erreurs … … 47 50 $lang['stuffs_no_name'] = 'Vous devez indiquer un nom pour le module'; 48 51 $lang['stuffs_parent_plugin_is_missing'] = 'LE PLUGIN PARENT N\'EST PLUS ACTIVÉ. Veuillez supprimer ce module ou réactiver le plugin parent.'; 52 $lang['stuffs_piclens_need_upgrade'] = 'LE PLUGIN PICLENS DOIT ÊTRE MIS À JOUR. PWG Stuffs n\'est pas compatible avec cette version de Piclens.'; 49 53 50 54 //------------------------------------------------------------------------------ … … 65 69 $lang['lastcoms_taille_cadres'] = 'Hauteur des cadres'; 66 70 67 68 71 //------------------------------------------------------------------------------ 69 72 // Module Logon … … 75 78 $lang['logon_remove_menubar_block'] = 'Retirer le bloc "identification rapide" du menubar'; 76 79 77 78 80 //------------------------------------------------------------------------------ 79 81 // Module Personal … … 84 86 85 87 $lang['personal_content'] = 'contenu'; 86 87 88 88 89 //------------------------------------------------------------------------------ … … 97 98 $lang['stuffs_tags_letters'] = 'Regrouper par lettres'; 98 99 $lang['stuffs_tags_cumulus'] = 'Utiliser le mode Cumulus (le plugin <a href=http://piwigo.org/ext/extension_view.php?eid=263 target="_blank">Cumulus Tags Cloud</a> doit etre installé)'; 99 100 101 //------------------------------------------------------------------------------102 // Module Piclenswall103 //------------------------------------------------------------------------------104 105 $lang['module_name_piclenswall'] = 'Piclens 3DWall';106 $lang['module_desc_piclenswall'] = 'Affiche un mur 3D piclens (le plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234" target="_blank">Cooliris/piclens</a> doit etre installé)';107 108 $lang['piclenswall_height'] = 'Hauteur du mur Cooliris';109 $lang['piclenswall_background_color'] = 'Couleur de l\'arrière plan';110 $lang['piclenswall_black'] = 'Noir';111 $lang['piclenswall_white'] = 'Blanc';112 $lang['piclenswall_info'] = 'Important pour que 3DWall fonctionne';113 $lang['piclenswall_info_piclens'] = 'Vous devez installer et activer le plugin <a href="http://piwigo.org/ext/extension_view.php?eid=234">Cooliris/piclens</a>.';114 $lang['piclenswall_info_crossdomain'] = 'Vous devez copier le fichier <a href="%s">crossdomain.xml</a> à la racine du site (ou modifier le fichier existant).';115 $lang['piclenswall_info_param'] = 'Les paramètres du mur sont à modifier directement dans la page de configuration du plugin <b>Cooliris-piclens</b>';116 100 117 101 //------------------------------------------------------------------------------ -
extensions/PWG_Stuffs/main.inc.php
r9410 r9449 13 13 global $prefixeTable, $conf; 14 14 15 $conf['Stuffs'] = @unserialize($conf['PWG_Stuffs']); 16 15 17 define('STUFFS_DIR' , basename(dirname(__FILE__))); 16 18 define('STUFFS_PATH' , PHPWG_PLUGINS_PATH . STUFFS_DIR . '/'); 17 19 define('STUFFS_TABLE' , $prefixeTable . 'stuffs'); 18 19 $conf['Stuffs'] = @unserialize($conf['PWG_Stuffs']);20 20 21 21 // Need upgrade? … … 25 25 function stuffs_admin_menu($menu) 26 26 { 27 global $conf; 28 29 if (isset($conf['Stuffs']['piclens_upgrade'])) 30 include('admin/upgrade.inc.php'); 31 27 32 array_push($menu, array( 28 33 'NAME' => 'PWG Stuffs', -
extensions/PWG_Stuffs/maintain.inc.php
r9410 r9449 35 35 pwg_query($q); 36 36 37 $q = "INSERT INTO `" . $prefixeTable . "stuffs` (`id`, `pos`, `name`, ` users`, `show_title`, `on_home`, `on_cats`, `on_picture`)38 VALUES (0, 1, 'MainBlock', ' guest,generic,normal,admin,webmaster', 'true', 'true', 'true', 'true');";37 $q = "INSERT INTO `" . $prefixeTable . "stuffs` (`id`, `pos`, `name`, `datas`, `users`, `show_title`, `on_home`, `on_cats`, `on_picture`) 38 VALUES (0, 1, 'MainBlock', '".addslashes(serialize(true))."', 'guest,generic,normal,admin,webmaster', 'true', 'true', 'true', 'true');"; 39 39 pwg_query($q); 40 40 } … … 49 49 50 50 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 51 VALUES ("PWG_Stuffs" , "'.pwg_db_real_escape_string(serialize($config)).'" , "PWG Stuffs configuration");';51 VALUES ("PWG_Stuffs" , "'.pwg_db_real_escape_string(serialize($config)).'" , "PWG Stuffs plugin configuration");'; 52 52 pwg_query($query); 53 53 } -
extensions/PWG_Stuffs/modules/Personal/config.inc.php
r9369 r9449 7 7 // Enregistrement de la configuration 8 8 if (isset($_POST['submit']) and !is_adviser()) { 9 $datas = array(stripslashes($_POST['personal_content']));9 $datas = stripslashes($_POST['personal_content']); 10 10 } 11 11 12 12 // Parametrage du template 13 13 $template->assign('cat_style', array()); 14 $template->assign(array('PERSONAL_CONTENT' => $datas[0])); 15 16 // TinyMCE 17 trigger_action('tinymce', 'pwgstuffs'); 14 $template->assign(array('PERSONAL_CONTENT' => $datas)); 18 15 19 16 $template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl')); -
extensions/PWG_Stuffs/modules/Personal/main.inc.php
r9369 r9449 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 5 $block['CONTENT'] = $datas [0];5 $block['CONTENT'] = $datas; 6 6 7 7 // Extended description
Note: See TracChangeset
for help on using the changeset viewer.