Changeset 24182
- Timestamp:
- Aug 18, 2013, 4:08:14 PM (11 years ago)
- Location:
- extensions/skeleton/trunk
- Files:
-
- 1 added
- 1 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/skeleton/trunk/admin.php
r21304 r24182 32 32 // template vars 33 33 $template->assign(array( 34 'SKELETON_PATH'=> get_root_url() .SKELETON_PATH, // used for images, scripts, ... access34 'SKELETON_PATH'=> SKELETON_PATH, // used for images, scripts, ... access 35 35 'SKELETON_ABS_PATH'=> realpath(SKELETON_PATH), // used for template inclusion (Smarty needs a real path) 36 36 'SKELETON_ADMIN' => SKELETON_ADMIN, … … 39 39 // send page content 40 40 $template->assign_var_from_handle('ADMIN_CONTENT', 'skeleton_content'); 41 42 ?> -
extensions/skeleton/trunk/admin/config.php
r23395 r24182 33 33 // define template file 34 34 $template->set_filename('skeleton_content', realpath(SKELETON_PATH . 'admin/template/config.tpl')); 35 36 ?> -
extensions/skeleton/trunk/admin/home.php
r17899 r24182 14 14 // define template file 15 15 $template->set_filename('skeleton_content', realpath(SKELETON_PATH . 'admin/template/home.tpl')); 16 17 ?> -
extensions/skeleton/trunk/admin/photo.php
r21659 r24182 47 47 48 48 $template->set_filename('skeleton_content', realpath(SKELETON_PATH . 'admin/template/photo.tpl')); 49 50 ?> -
extensions/skeleton/trunk/admin/template/config.tpl
r23395 r24182 21 21 <form method="post" action="" class="properties"> 22 22 <fieldset> 23 <legend>{'Common configuration'| @translate}</legend>23 <legend>{'Common configuration'|translate}</legend> 24 24 25 25 <ul> … … 27 27 <label> 28 28 <input type="checkbox" name="option2" value="1" {if $skeleton.option2}checked="checked"{/if}> 29 <b>{'Checkbox'| @translate}</b>29 <b>{'Checkbox'|translate}</b> 30 30 </label> 31 <a class=" showInfo" title="{'Check me!'|@translate}">i</a>31 <a class="icon-info-circled-1 showInfo" title="{'Check me!'|translate}"></a> 32 32 </li> 33 33 <li class="option1" {if not $skeleton.option2}style="display:none;"{/if}> 34 34 <label> 35 <b>{'Integer'| @translate}</b>35 <b>{'Integer'|translate}</b> 36 36 <input type="text" name="option1" value="{$skeleton.option1}" size="4"> 37 37 </label> … … 39 39 <li> 40 40 <label> 41 <b>{'Select'| @translate}</b>41 <b>{'Select'|translate}</b> 42 42 {html_options name=option3 options=$select_options selected=$skeleton.option3} 43 43 </label> … … 46 46 </fieldset> 47 47 48 <p class="formButtons"><input type="submit" name="save_config" value="{'Save Settings'| @translate}"></p>48 <p class="formButtons"><input type="submit" name="save_config" value="{'Save Settings'|translate}"></p> 49 49 50 50 </form> -
extensions/skeleton/trunk/admin/template/home.tpl
r23395 r24182 11 11 <form method="post" action="" class="properties"> 12 12 <fieldset> 13 <legend>{'What Skeleton can do for me?'| @translate}</legend>13 <legend>{'What Skeleton can do for me?'|translate}</legend> 14 14 15 15 {$INTRO_CONTENT} -
extensions/skeleton/trunk/admin/template/photo.tpl
r17899 r24182 1 1 {combine_css path=$SKELETON_PATH|@cat:"admin/template/style.css"} 2 2 3 <h2>{$TITLE} › {'Edit photo'| @translate} {$TABSHEET_TITLE}</h2>3 <h2>{$TITLE} › {'Edit photo'|translate} {$TABSHEET_TITLE}</h2> 4 4 5 5 6 6 <form action="{$F_ACTION}" method="post" id="catModify"> 7 7 <fieldset> 8 <legend>{'My awesome photo tab'| @translate}</legend>8 <legend>{'My awesome photo tab'|translate}</legend> 9 9 10 10 <p> 11 <img src="{$TN_SRC}" alt="{'Thumbnail'| @translate}" class="Thumbnail">11 <img src="{$TN_SRC}" alt="{'Thumbnail'|translate}" class="Thumbnail"> 12 12 </p> 13 13 14 14 <p> 15 <input class="submit" type="submit" value="{'Save'| @translate}" name="save_skeleton">15 <input class="submit" type="submit" value="{'Save'|translate}" name="save_skeleton"> 16 16 </p> 17 17 </fieldset> -
extensions/skeleton/trunk/admin/template/style.css
r17899 r24182 1 .showInfo {2 position:static;3 display:inline-block;4 padding:1px 6px;5 width:4px;6 height:14px;7 line-height:14px;8 font-size:0.8em;9 }10 11 1 .square-list { 12 2 list-style:square !important; -
extensions/skeleton/trunk/include/admin_events.inc.php
r18858 r24182 94 94 } 95 95 } 96 97 ?> -
extensions/skeleton/trunk/include/functions.inc.php
r18858 r24182 2 2 defined('SKELETON_PATH') or die('Hacking attempt!'); 3 3 4 5 6 ?> 4 // you can add something here :-) -
extensions/skeleton/trunk/include/install.inc.php
r23395 r24182 66 66 67 67 } 68 69 ?> -
extensions/skeleton/trunk/include/public_events.inc.php
r23398 r24182 57 57 58 58 /** 59 * add link in existing menu60 */61 function skeleton_blockmanager_apply1($menu_ref_arr)62 {63 $menu = &$menu_ref_arr[0];64 65 if ( ($block = $menu->get_block('mbMenu')) != null )66 {67 array_push($block->data, array(68 'URL' => SKELETON_PUBLIC,69 'TITLE' => l10n('Skeleton'),70 'NAME' => l10n('Skeleton'),71 ));72 }73 }74 75 /**76 * add a nbew menu block77 */78 function skeleton_blockmanager_register_blocks($menu_ref_arr)79 {80 $menu = &$menu_ref_arr[0];81 82 if ($menu->get_id() == 'menubar')83 {84 $menu->register_block(new RegisteredBlock('mbSkeleton', l10n('Skeleton'), 'skeleton'));85 }86 }87 88 /**89 * fill the added menu block90 */91 function skeleton_blockmanager_apply2($menu_ref_arr)92 {93 $menu = &$menu_ref_arr[0];94 95 if ( ($block = $menu->get_block('mbSkeleton')) != null )96 {97 global $template;98 99 $block->set_title(l10n('Skeleton'));100 101 $block->data['link1'] =102 array(103 'URL' => get_absolute_root_url(),104 'TITLE' => l10n('First link'),105 'NAME' => l10n('Link 1'),106 'REL'=> 'rel="nofollow"',107 );108 109 $block->data['link2'] =110 array(111 'URL' => SKELETON_PUBLIC,112 'TITLE' => l10n('Second link'),113 'NAME' => l10n('Link 2'),114 );115 116 $template->set_template_dir(SKELETON_PATH . 'template/');117 $block->template = 'menubar_skeleton.tpl';118 }119 }120 121 /**122 59 * add a prefilter on photo page 123 60 */ … … 140 77 return str_replace($search, $replace, $content); 141 78 } 142 143 144 ?> -
extensions/skeleton/trunk/include/skeleton_page.inc.php
r23398 r24182 16 16 $template->set_filename('skeleton_page', realpath(SKELETON_PATH . 'template/skeleton_page.tpl')); 17 17 $template->assign_var_from_handle('CONTENT', 'skeleton_page'); 18 19 ?> -
extensions/skeleton/trunk/include/ws_functions.inc.php
r23395 r24182 26 26 return phpinfo(constant($params['what'])); 27 27 } 28 29 30 ?> -
extensions/skeleton/trunk/main.inc.php
r21307 r24182 19 19 global $prefixeTable; 20 20 21 21 22 // +-----------------------------------------------------------------------+ 22 23 // | Define plugin constants | … … 32 33 33 34 35 34 36 // +-----------------------------------------------------------------------+ 35 37 // | Add event handlers | … … 38 40 add_event_handler('init', 'skeleton_init'); 39 41 42 /* 43 * this is the common way to define event functions: create a new function for each event you want to handle 44 */ 40 45 if (defined('IN_ADMIN')) 41 46 { 47 // file containing all admin handlers functions 48 include_once(SKELETON_PATH . 'include/admin_events.inc.php'); 49 42 50 // admin plugins menu link 43 51 add_event_handler('get_admin_plugin_menu_links', 'skeleton_admin_plugin_menu_links'); … … 53 61 add_event_handler('loc_end_element_set_global', 'skeleton_loc_end_element_set_global'); 54 62 add_event_handler('element_set_global_action', 'skeleton_element_set_global_action', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 55 56 // file containing all previous handlers functions57 include_once(SKELETON_PATH . 'include/admin_events.inc.php');58 63 } 59 64 else 60 65 { 66 // file containing all public handlers functions 67 include_once(SKELETON_PATH . 'include/public_events.inc.php'); 68 61 69 // add a public section 62 70 add_event_handler('loc_end_section_init', 'skeleton_loc_end_section_init'); 63 71 add_event_handler('loc_end_index', 'skeleton_loc_end_page'); 64 65 // add item to existing menu (EVENT_HANDLER_PRIORITY_NEUTRAL+10 is for compatibility with Advanced Menu Manager)66 add_event_handler('blockmanager_apply', 'skeleton_blockmanager_apply1', EVENT_HANDLER_PRIORITY_NEUTRAL+10);67 68 // add a new menu block69 add_event_handler('blockmanager_register_blocks', 'skeleton_blockmanager_register_blocks');70 add_event_handler('blockmanager_apply', 'skeleton_blockmanager_apply2');71 // NOTE: skeleton_blockmanager_apply1() and skeleton_blockmanager_apply2() can (should) be merged72 72 73 73 // add button on album and photos pages … … 77 77 // prefilter on photo page 78 78 add_event_handler('loc_end_picture', 'skeleton_loc_end_picture'); 79 80 // file containing all previous handlers functions81 include_once(SKELETON_PATH . 'include/public_events.inc.php');82 79 } 83 80 84 81 // add API function 85 82 add_event_handler('ws_add_methods', 'skeleton_ws_add_methods'); 83 84 85 /* 86 * event functions can also be wrapped in a class 87 */ 88 89 // file containing the class for menu handlers functions 90 include_once(SKELETON_PATH . 'include/menu_events.class.php'); 91 92 // add item to existing menu (EVENT_HANDLER_PRIORITY_NEUTRAL+10 is for compatibility with Advanced Menu Manager plugin) 93 add_event_handler('blockmanager_apply', array('SkeletonMenu', 'blockmanager_apply1'), EVENT_HANDLER_PRIORITY_NEUTRAL+10); 94 95 // add a new menu block (the declaration must be done every time, in order to be able to manage the menu block in "Menus" screen and Advanced Menu Manager) 96 add_event_handler('blockmanager_register_blocks', array('SkeletonMenu', 'blockmanager_register_blocks')); 97 add_event_handler('blockmanager_apply', array('SkeletonMenu', 'blockmanager_apply2')); 98 // NOTE: blockmanager_apply1() and blockmanager_apply2() can (must) be merged 99 86 100 87 101 … … 104 118 105 119 // apply upgrade if needed 106 if ( 107 SKELETON_VERSION == 'auto' or 108 $pwg_loaded_plugins[SKELETON_ID]['version'] == 'auto' or 109 version_compare($pwg_loaded_plugins[SKELETON_ID]['version'], SKELETON_VERSION, '<') 110 ) 111 { 112 // call install function 113 include_once(SKELETON_PATH . 'include/install.inc.php'); 114 skeleton_install(); 115 116 // update plugin version in database 117 if ( $pwg_loaded_plugins[SKELETON_ID]['version'] != 'auto' and SKELETON_VERSION != 'auto' ) 118 { 119 $query = ' 120 UPDATE '. PLUGINS_TABLE .' 121 SET version = "'. SKELETON_VERSION .'" 122 WHERE id = "'. SKELETON_ID .'"'; 123 pwg_query($query); 124 125 $pwg_loaded_plugins[SKELETON_ID]['version'] = SKELETON_VERSION; 126 127 if (defined('IN_ADMIN')) 128 { 129 $_SESSION['page_infos'][] = 'Skeleton updated to version '. SKELETON_VERSION; 130 } 131 } 132 } 120 include_once(SKELETON_PATH . 'include/install.inc.php'); 121 request_plugin_update(SKELETON_ID, SKELETON_VERSION, 'skeleton_install'); 133 122 134 123 // load plugin language file … … 138 127 $conf['skeleton'] = unserialize($conf['skeleton']); 139 128 } 140 141 ?> -
extensions/skeleton/trunk/maintain.inc.php
r21304 r24182 70 70 rmdir($dir); 71 71 } 72 73 ?> -
extensions/skeleton/trunk/template/menubar_skeleton.tpl
r23395 r24182 1 1 <dt>{$block->get_title()}</dt> 2 2 <dd> 3 {'Menublock added by Skeleton plugin'| @translate}3 {'Menublock added by Skeleton plugin'|translate} 4 4 <ul>{strip} 5 5 {foreach from=$block->data item=link} -
extensions/skeleton/trunk/template/my_button.tpl
r21307 r24182 1 1 {strip} 2 <a href="javascript:alert('Hello world!');" title="{'This is not the button you are looking for'| @translate}" class="pwg-state-default pwg-button" rel="nofollow">2 <a href="javascript:alert('Hello world!');" title="{'This is not the button you are looking for'|translate}" class="pwg-state-default pwg-button" rel="nofollow"> 3 3 <span class="pwg-icon" style="background:url('{$ROOT_URL}{$SKELETON_PATH}template/head.png') center center no-repeat;"> </span> 4 <span class="pwg-button-text">{'Skeleton'| @translate}</span>4 <span class="pwg-button-text">{'Skeleton'|translate}</span> 5 5 </a> 6 6 {/strip} -
extensions/skeleton/trunk/template/skeleton_page.tpl
r23398 r24182 20 20 21 21 {* <!-- add page content here --> *} 22 <h1>{'What Skeleton can do for me?'| @translate}</h1>22 <h1>{'What Skeleton can do for me?'|translate}</h1> 23 23 <blockquote> 24 24 {$INTRO_CONTENT} 25 25 </blockquote> 26 26 27 <div id="test"> Click for fun</div>27 <div id="test">{'Click for fun'|translate}</div> -
extensions/skeleton/trunk/template/style.css
r17899 r24182 19 19 -webkit-transform:rotate(5deg); 20 20 -o-transform:rotate(5deg); 21 transform:rotate(5deg); 21 22 letter-spacing:10px; 22 23 box-shadow:10px 10px 10px rgba(0,0,0,0.5); … … 27 28 -webkit-transform:rotate(175deg); 28 29 -o-transform:rotate(175deg); 30 transform:rotate(175deg); 29 31 }
Note: See TracChangeset
for help on using the changeset viewer.