Changeset 17924 for extensions/skeleton
- Timestamp:
- Sep 15, 2012, 1:16:46 PM (12 years ago)
- Location:
- extensions/skeleton
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/skeleton/include/install.inc.php
r17899 r17924 9 9 * - use "if empty" for configuration vars 10 10 * - use "IF NOT EXISTS" for table creation 11 * 12 * Unlike the functions in maintain.inc.php, the name of this function must be unique 13 * and not enter in conflict with other plugins. 11 14 */ 12 15 … … 29 32 // add a new table 30 33 pwg_query(' 31 CREATE TABLE IF NOT EXISTS `'. $prefixeTable.'skeleton` (34 CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'skeleton` ( 32 35 `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 33 36 `field1` mediumint(8) DEFAULT NULL, 34 37 `field2` varchar(64) NOT NULL, 35 38 PRIMARY KEY (`id`) 36 ) DEFAULT CHARSET=utf839 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 37 40 ;'); 38 41 -
extensions/skeleton/include/public_events.inc.php
r17899 r17924 94 94 } 95 95 96 /** 97 * add a prefilter on photo page 98 */ 99 function skeleton_loc_end_picture() 100 { 101 global $template; 102 103 $template->set_prefilter('picture', 'skeleton_picture_prefilter'); 104 } 105 106 function skeleton_picture_prefilter($content) 107 { 108 $search = '{if $display_info.author and isset($INFO_AUTHOR)}'; 109 $replace = '<div id="Skeleton" class="imageInfo"> 110 <dt>{\'Skeleton\'|@translate}</dt> 111 <dd style="color:orange;">{\'Piwigo rocks\'|@translate}</dd> 112 </div> 113 '.$search; 114 115 return str_replace($search, $replace, $content); 116 } 117 118 96 119 ?> -
extensions/skeleton/language/en_UK/intro.html
r17899 r17924 14 14 <li>New tabs for core admin pages</li> 15 15 <li>New filters and actions in the Batch Manager</li> 16 <li>Simple template prefilter (on picture.php page)</li> 16 17 </ul> 17 18 </p> -
extensions/skeleton/language/fr_FR/intro.html
r17899 r17924 14 14 <li>Ajout d'onglet sur les pages d'administration existantes</li> 15 15 <li>Nouveaux filtres et actions pour le gestionnaire de lots</li> 16 <li>Préfiltre de template simple (sur page picture.php)</li> 16 17 </ul> 17 18 </p> -
extensions/skeleton/main.inc.php
r17899 r17924 22 22 // | Define plugin constants | 23 23 // +-----------------------------------------------------------------------+ 24 define('SKELETON_PATH' , PHPWG_PLUGINS_PATH . 'skeleton/'); 24 defined('SKELETON_ID') or define('SKELETON_ID', basename(dirname(__FILE__))); 25 define('SKELETON_PATH' , PHPWG_PLUGINS_PATH . SKELETON_ID . '/'); 25 26 define('SKELETON_TABLE', $prefixeTable . 'skeleton'); 26 define('SKELETON_ADMIN', get_root_url() . 'admin.php?page=plugin- skeleton');27 define('SKELETON_ADMIN', get_root_url() . 'admin.php?page=plugin-' . SKELETON_ID); 27 28 define('SKELETON_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'skeleton')) . '/'); 28 29 define('SKELETON_DIR', PWG_LOCAL_DIR . 'skeleton/'); 29 define('SKELETON_VERSION', '2.4.0'); // <= don't forget to manually update this constant! 30 define('SKELETON_VERSION', 'auto'); 31 // this is automatically updated by PEM if you publish your plugin with SVN, otherwise you musn't forget to change it, as well as "Version" in the plugin header 30 32 31 33 … … 42 44 43 45 // new tab on photo page 44 add_event_handler('tabsheet_before_select', 'skeleton_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);46 add_event_handler('tabsheet_before_select', 'skeleton_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 45 47 46 48 // new prefiler in Batch Manager … … 69 71 // NOTE: skeleton_blockmanager_apply1() and skeleton_blockmanager_apply2() can (should) be merged 70 72 73 // prefilter on photo page 74 add_event_handler('loc_end_picture', 'skeleton_loc_end_picture'); 75 71 76 // file containing all previous handlers functions 72 77 include_once(SKELETON_PATH . 'include/public_events.inc.php'); … … 92 97 // apply upgrade if needed 93 98 if ( 94 $pwg_loaded_plugins[ 'skeleton']['version'] == 'auto' or95 version_compare($pwg_loaded_plugins[ 'skeleton']['version'], SKELETON_VERSION, '<')99 $pwg_loaded_plugins[SKELETON_ID]['version'] == 'auto' or 100 version_compare($pwg_loaded_plugins[SKELETON_ID]['version'], SKELETON_VERSION, '<') 96 101 ) 97 102 { … … 101 106 102 107 // update plugin version in database 103 if ($pwg_loaded_plugins[ 'skeleton']['version'] != 'auto')108 if ($pwg_loaded_plugins[SKELETON_ID]['version'] != 'auto') 104 109 { 105 110 $query = ' 106 111 UPDATE '. PLUGINS_TABLE .' 107 112 SET version = "'. SKELETON_VERSION .'" 108 WHERE id = " skeleton"';113 WHERE id = "'. SKELETON_ID .'"'; 109 114 pwg_query($query); 110 115 111 $pwg_loaded_plugins[ 'skeleton']['version'] = SKELETON_VERSION;116 $pwg_loaded_plugins[SKELETON_ID]['version'] = SKELETON_VERSION; 112 117 113 118 if (defined('IN_ADMIN')) -
extensions/skeleton/maintain.inc.php
r17899 r17924 2 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 include_once(PHPWG_PLUGINS_PATH . 'skeleton/include/install.inc.php'); 4 defined('SKELETON_ID') or define('SKELETON_ID', basename(dirname(__FILE__))); 5 include_once(PHPWG_PLUGINS_PATH . SKELETON_ID . '/include/install.inc.php'); 5 6 6 7 /** … … 55 56 56 57 // delete table 57 pwg_query('DROP TABLE `'. $prefixeTable.'skeleton`;');58 pwg_query('DROP TABLE `'. $prefixeTable .'skeleton`;'); 58 59 59 60 // delete field
Note: See TracChangeset
for help on using the changeset viewer.