Changeset 28650


Ignore:
Timestamp:
06/09/14 19:11:17 (5 years ago)
Author:
mistic100
Message:

update for 2.7

Location:
extensions/skeleton/trunk
Files:
1 added
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • extensions/skeleton/trunk/admin.php

    r24182 r28650  
    11<?php 
    22/** 
    3  * This is the main administration page, if you have only one admin page you can put  
     3 * This is the main administration page, if you have only one admin page you can put 
    44 * directly its code here or using the tabsheet system like bellow 
    55 */ 
    66 
    77defined('SKELETON_PATH') or die('Hacking attempt!'); 
    8   
     8 
    99global $template, $page, $conf; 
    1010 
    1111 
    1212// get current tab 
    13 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'home'; 
     13$page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : $page['tab'] = 'home'; 
    1414 
    1515// plugin tabsheet is not present on photo page 
     
    2020  $tabsheet = new tabsheet(); 
    2121  $tabsheet->set_id('skeleton'); 
    22    
     22 
    2323  $tabsheet->add('home', l10n('Welcome'), SKELETON_ADMIN . '-home'); 
    2424  $tabsheet->add('config', l10n('Configuration'), SKELETON_ADMIN . '-config'); 
     
    3333$template->assign(array( 
    3434  'SKELETON_PATH'=> SKELETON_PATH, // used for images, scripts, ... access 
    35   'SKELETON_ABS_PATH'=> realpath(SKELETON_PATH),    // used for template inclusion (Smarty needs a real path) 
     35  'SKELETON_ABS_PATH'=> realpath(SKELETON_PATH), // used for template inclusion (Smarty needs a real path) 
    3636  'SKELETON_ADMIN' => SKELETON_ADMIN, 
    3737  )); 
    38    
     38 
    3939// send page content 
    4040$template->assign_var_from_handle('ADMIN_CONTENT', 'skeleton_content'); 
  • extensions/skeleton/trunk/admin/config.php

    r24182 r28650  
    1414    'option3' => $_POST['option3'], 
    1515    ); 
    16        
    17   conf_update_param('skeleton', serialize($conf['skeleton'])); 
    18   array_push($page['infos'], l10n('Information data registered in database')); 
     16 
     17  conf_update_param('skeleton', $conf['skeleton']); 
     18  $page['infos'][] = l10n('Information data registered in database'); 
    1919} 
    2020 
     
    2424  'three' => l10n('Three'), 
    2525  ); 
    26    
     26 
    2727// send config to template 
    2828$template->assign(array( 
  • extensions/skeleton/trunk/admin/photo.php

    r24182 r28650  
    3535$picture = pwg_db_fetch_assoc(pwg_query($query)); 
    3636 
     37 
    3738# DO SOME STUFF HERE... or not ! 
    3839 
  • extensions/skeleton/trunk/admin/template/config.tpl

    r24182 r28650  
    11{combine_css path=$SKELETON_PATH|@cat:"admin/template/style.css"} 
    22 
    3 {footer_script}{literal} 
     3{footer_script} 
    44jQuery('input[name="option2"]').change(function() { 
    55  $('.option1').toggle(); 
     
    1313  defaultPosition: 'bottom' 
    1414}); 
    15 {/literal}{/footer_script} 
     15{/footer_script} 
     16 
    1617 
    1718<div class="titrePage"> 
     
    2223<fieldset> 
    2324  <legend>{'Common configuration'|translate}</legend> 
    24    
     25 
    2526  <ul> 
    2627    <li> 
  • extensions/skeleton/trunk/admin/template/home.tpl

    r24182 r28650  
    11{combine_css path=$SKELETON_PATH|@cat:"admin/template/style.css"} 
    22 
    3 {html_style}{literal} 
    4 h4 { text-align:left !important; } 
    5 {/literal}{/html_style} 
     3{html_style} 
     4  h4 { 
     5    text-align:left !important; 
     6  } 
     7{/html_style} 
     8 
    69 
    710<div class="titrePage"> 
     
    1215<fieldset> 
    1316  <legend>{'What Skeleton can do for me?'|translate}</legend> 
    14    
     17 
    1518  {$INTRO_CONTENT} 
    1619</fieldset> 
    17    
     20 
    1821</form> 
  • extensions/skeleton/trunk/include/admin_events.inc.php

    r26137 r28650  
    55 * admin plugins menu link 
    66 */ 
    7 function skeleton_admin_plugin_menu_links($menu)  
     7function skeleton_admin_plugin_menu_links($menu) 
    88{ 
    99  $menu[] = array( 
     
    2727      ); 
    2828  } 
    29    
     29 
    3030  return $sheets; 
    3131} 
     
    3636function skeleton_add_batch_manager_prefilters($prefilters) 
    3737{ 
    38         array_push($prefilters, array( 
     38  $prefilters[] = array( 
    3939    'ID' => 'skeleton', 
    4040    'NAME' => l10n('Skeleton'), 
    41   )); 
    42         return $prefilters; 
     41    ); 
     42 
     43  return $prefilters; 
    4344} 
    4445 
     
    5657  LIMIT 20 
    5758;'; 
    58     $filter_sets[] = array_from_query($query, 'id'); 
     59    $filter_sets[] = query2array($query, null, 'id'); 
    5960  } 
    60    
    61         return $filter_sets; 
     61 
     62  return $filter_sets; 
    6263} 
    6364 
     
    6768function skeleton_loc_end_element_set_global() 
    6869{ 
    69         global $template; 
    70    
    71         $template->append('element_set_global_plugins_actions', array( 
    72     'ID' => 'skeleton',  
    73     'NAME' => l10n('Skeleton'),  
    74     'CONTENT' => '<label><input type="checkbox" name="check_skeleton"> '.l10n('Check me!').'</label>', // this is optional 
     70  global $template; 
     71 
     72  /* 
     73    CONTENT is optional 
     74    for big contents it is advised to use a template file 
     75 
     76    $template->set_filename('skeleton_batchmanager_action', realpath(SKELETON_PATH.'template/batchmanager_action.tpl')); 
     77    $content = $template->parse('skeleton_batchmanager_action', true); 
     78   */ 
     79  $template->append('element_set_global_plugins_actions', array( 
     80    'ID' => 'skeleton', 
     81    'NAME' => l10n('Skeleton'), 
     82    'CONTENT' => '<label><input type="checkbox" name="check_skeleton"> '.l10n('Check me!').'</label>', 
    7583    )); 
    7684} 
     
    8189function skeleton_element_set_global_action($action, $collection) 
    8290{ 
    83         if ($action == 'skeleton') 
     91  global $page; 
     92 
     93  if ($action == 'skeleton') 
    8494  { 
    85     global $page; 
    86      
    8795    if (empty($_POST['check_skeleton'])) 
    8896    { 
    89       array_push($page['warnings'], l10n('Nothing appened, but you didn\'t check the box!')); 
     97      $page['warnings'][] = l10n('Nothing appened, but you didn\'t check the box!'); 
    9098    } 
    9199    else 
    92100    { 
    93       array_push($page['infos'], l10n('Nothing appened, but you checked the box!')); 
     101      $page['infos'][] = l10n('Nothing appened, but you checked the box!'); 
    94102    } 
    95103  } 
  • extensions/skeleton/trunk/include/menu_events.class.php

    r24182 r28650  
    33 
    44/* 
    5  * there is two ways to use class methods as event handlers: 
     5 * There is two ways to use class methods as event handlers: 
    66 * 
    7  **   add_event_handler('blockmanager_apply', array('SkeletonMenu', 'blockmanager_apply')); 
     7 * >  add_event_handler('blockmanager_apply', array('SkeletonMenu', 'blockmanager_apply')); 
    88 *      in this case the method 'blockmanager_apply' must be a static method of the class 'SkeletonMenu' 
    99 * 
    10  **   $myObj = new SkeletonMenu(); 
    11  **   add_event_handler('blockmanager_apply', array(&$myObj, 'blockmanager_apply') ); 
     10 * >  $myObj = new SkeletonMenu(); 
     11 * >  add_event_handler('blockmanager_apply', array(&$myObj, 'blockmanager_apply')); 
    1212 *      in this case the method 'blockmanager_apply' must be a public method of the object '$myObj' 
    1313 */ 
     
    2020  static function blockmanager_apply1($menu_ref_arr) 
    2121  { 
    22     $menu = &$menu_ref_arr[0];   
    23      
    24     if ( ($block = $menu->get_block('mbMenu')) != null ) 
     22    $menu = &$menu_ref_arr[0]; 
     23 
     24    if (($block = $menu->get_block('mbMenu')) != null) 
    2525    { 
    26       array_push($block->data, array( 
     26      $block->data[] = array( 
    2727        'URL' => SKELETON_PUBLIC, 
    2828        'TITLE' => l10n('Skeleton'), 
    2929        'NAME' => l10n('Skeleton'), 
    30       )); 
     30        ); 
    3131    } 
    3232  } 
     
    3838  { 
    3939    $menu = &$menu_ref_arr[0]; 
    40      
     40 
    4141    if ($menu->get_id() == 'menubar') 
    4242    { 
    43       $menu->register_block(new RegisteredBlock('mbSkeleton', l10n('Skeleton'), 'skeleton')); 
     43      // identifier, title, owner 
     44      $menu->register_block(new RegisteredBlock('mbSkeleton', l10n('Skeleton'), 'Skeleton')); 
    4445    } 
    4546  } 
     
    5152  { 
    5253    $menu = &$menu_ref_arr[0]; 
    53      
    54     if ( ($block = $menu->get_block('mbSkeleton')) != null ) 
     54 
     55    if (($block = $menu->get_block('mbSkeleton')) != null) 
    5556    { 
    56       global $template; 
    57        
    5857      $block->set_title(l10n('Skeleton')); 
    59        
     58 
    6059      $block->data['link1'] = 
    6160        array( 
     
    7271          'NAME' => l10n('Link 2'), 
    7372        ); 
    74        
     73 
    7574      $block->template = realpath(SKELETON_PATH . 'template/menubar_skeleton.tpl'); 
    7675    } 
  • extensions/skeleton/trunk/include/public_events.inc.php

    r26137 r28650  
    1212  { 
    1313    $page['section'] = 'skeleton'; 
    14      
     14 
    1515    // section_title is for breadcrumb, title is for page <title> 
    1616    $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.SKELETON_PUBLIC.'">'.l10n('Skeleton').'</a>'; 
    1717    $page['title'] = l10n('Skeleton'); 
    18      
     18 
    1919    $page['body_id'] = 'theSkeletonPage'; 
    2020    $page['is_external'] = true; // inform Piwigo that you are on a new page 
     
    2929  global $page, $template; 
    3030 
    31   if ( isset($page['section']) and $page['section']=='skeleton' ) 
     31  if (isset($page['section']) and $page['section']=='skeleton') 
    3232  { 
    3333    include(SKELETON_PATH . 'include/skeleton_page.inc.php'); 
     
    4141{ 
    4242  global $template; 
    43    
     43 
    4444  $template->assign('SKELETON_PATH', SKELETON_PATH); 
    4545  $template->set_filename('skeleton_button', realpath(SKELETON_PATH.'template/my_button.tpl')); 
    4646  $button = $template->parse('skeleton_button', true); 
    47    
     47 
    4848  if (script_basename()=='index') 
    4949  { 
    50     $template->add_index_button($button, EVENT_HANDLER_PRIORITY_NEUTRAL); 
     50    $template->add_index_button($button, BUTTONS_RANK_NEUTRAL); 
    5151  } 
    5252  else 
    5353  { 
    54     $template->add_picture_button($button, EVENT_HANDLER_PRIORITY_NEUTRAL); 
     54    $template->add_picture_button($button, BUTTONS_RANK_NEUTRAL); 
    5555  } 
    5656} 
     
    6262{ 
    6363  global $template; 
    64    
     64 
    6565  $template->set_prefilter('picture', 'skeleton_picture_prefilter'); 
    6666} 
     
    6969{ 
    7070  $search = '{if $display_info.author and isset($INFO_AUTHOR)}'; 
    71   $replace = '<div id="Skeleton" class="imageInfo"> 
    72                 <dt>{\'Skeleton\'|@translate}</dt> 
    73                 <dd style="color:orange;">{\'Piwigo rocks\'|@translate}</dd> 
    74         </div> 
    75 '.$search; 
     71  $replace = ' 
     72<div id="Skeleton" class="imageInfo"> 
     73  <dt>{\'Skeleton\'|@translate}</dt> 
     74  <dd style="color:orange;">{\'Piwigo rocks\'|@translate}</dd> 
     75</div> 
     76'; 
    7677 
    77   return str_replace($search, $replace, $content); 
     78  return str_replace($search, $replace.$search, $content); 
    7879} 
  • extensions/skeleton/trunk/include/skeleton_page.inc.php

    r24182 r28650  
    99 
    1010$template->assign(array( 
     11  // this is useful when having big blocks of text which must be translated 
     12  // prefer separated HTML files over big lang.php files 
    1113  'INTRO_CONTENT' => load_language('intro.html', SKELETON_PATH, array('return'=>true)), 
    1214  'SKELETON_PATH' => SKELETON_PATH, 
  • extensions/skeleton/trunk/include/ws_functions.inc.php

    r26137 r28650  
    55{ 
    66  $service = &$arr[0]; 
    7    
     7 
     8  // only the first two parameters are mandatory 
    89  $service->addMethod( 
    9     'pwg.PHPinfo', 
    10     'ws_php_info', 
     10    'pwg.PHPinfo', // method name 
     11    'ws_php_info', // linked PHP function 
     12    array( // list of parameters 
     13      'what' => array( 
     14        'default' => 'INFO_ALL', // default value 
     15        'info' => 'This parameter has a default value', // parameter description 
     16        ), 
     17      'ids' => array( 
     18        'flags' => WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY, // flags are WS_PARAM_OPTIONAL, WS_PARAM_ACCEPT_ARRAY, WS_PARAM_FORCE_ARRAY 
     19        'type' => WS_TYPE_INT|WS_TYPE_POSITIVE|WS_TYPE_NOTNULL, // types are WS_TYPE_BOOL, WS_TYPE_INT, WS_TYPE_FLOAT, WS_TYPE_POSITIVE, WS_TYPE_NOTNULL, WS_TYPE_ID 
     20        'info' => 'This one must be an array', 
     21        ), 
     22      'count' => array( 
     23        'flags' => WS_PARAM_OPTIONAL, 
     24        'type' => WS_TYPE_INT|WS_TYPE_POSITIVE, 
     25        'maxValue' => 100, // maximum value for ints and floats 
     26        ), 
     27      ), 
     28    'Returns phpinfo', // method description 
     29    null, // file to include after param check and before function exec 
    1130    array( 
    12       'what' => array('default'=>'INFO_ALL', 'info'=>'This parameter has a default value'), 
    13       'ids' => array('flags'=>WS_PARAM_FORCE_ARRAY, 'info'=>'This one must be an array'), 
    14       ), 
    15     'Returns phpinfo (don\'t use XML request format)', 
    16     null, 
    17     array('hidden' => false) // you can hide your method from reflection.getMethodList method 
     31      'hidden' => false, // you can hide your method from reflection.getMethodList method 
     32      'admin_only' => true, // you can restrict access to admins only 
     33      'post_only' => false, // you can disallow GET resquests for this method 
     34      ) 
    1835    ); 
    1936} 
     
    2138function ws_php_info($params, &$service) 
    2239{ 
    23   if (!is_admin()) 
    24   { 
    25     return new PwgError(403, 'Forbidden'); 
    26   } 
    27    
    2840  return phpinfo(constant($params['what'])); 
    2941} 
  • extensions/skeleton/trunk/main.inc.php

    r25407 r28650  
    1 <?php  
     1<?php 
    22/* 
    33Plugin Name: skeleton 
     
    1010 
    1111/** 
    12  * This is te main file of the plugin, called by Piwigo in "include/common.inc.php" line 137. 
     12 * This is the main file of the plugin, called by Piwigo in "include/common.inc.php" line 137. 
    1313 * At this point of the code, Piwigo is not completely initialized, so nothing should be done directly 
    1414 * except define constants and event handlers (see http://piwigo.org/doc/doku.php?id=dev:plugins) 
     
    1717defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    1818 
    19 global $prefixeTable; 
    20  
    2119 
    2220// +-----------------------------------------------------------------------+ 
    2321// | Define plugin constants                                               | 
    2422// +-----------------------------------------------------------------------+ 
     23global $prefixeTable; 
     24 
    2525define('SKELETON_ID',      basename(dirname(__FILE__))); 
    2626define('SKELETON_PATH' ,   PHPWG_PLUGINS_PATH . SKELETON_ID . '/'); 
     
    2929define('SKELETON_PUBLIC',  get_absolute_root_url() . make_index_url(array('section' => 'skeleton')) . '/'); 
    3030define('SKELETON_DIR',     PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'skeleton/'); 
    31 define('SKELETON_VERSION', 'auto'); 
    32 // 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 
    3331 
    3432 
     
    4644{ 
    4745  // file containing all admin handlers functions 
    48   include_once(SKELETON_PATH . 'include/admin_events.inc.php'); 
    49    
     46  $admin_file = SKELETON_PATH . 'include/admin_events.inc.php'; 
     47 
    5048  // admin plugins menu link 
    51   add_event_handler('get_admin_plugin_menu_links', 'skeleton_admin_plugin_menu_links'); 
    52    
     49  add_event_handler('get_admin_plugin_menu_links', 'skeleton_admin_plugin_menu_links', 
     50    EVENT_HANDLER_PRIORITY_NEUTRAL, $admin_file); 
     51 
    5352  // new tab on photo page 
    54   add_event_handler('tabsheet_before_select', 'skeleton_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
    55    
     53  add_event_handler('tabsheet_before_select', 'skeleton_tabsheet_before_select', 
     54    EVENT_HANDLER_PRIORITY_NEUTRAL, $admin_file); 
     55 
    5656  // new prefiler in Batch Manager 
    57   add_event_handler('get_batch_manager_prefilters', 'skeleton_add_batch_manager_prefilters'); 
    58   add_event_handler('perform_batch_manager_prefilters', 'skeleton_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
    59    
     57  add_event_handler('get_batch_manager_prefilters', 'skeleton_add_batch_manager_prefilters', 
     58    EVENT_HANDLER_PRIORITY_NEUTRAL, $admin_file); 
     59  add_event_handler('perform_batch_manager_prefilters', 'skeleton_perform_batch_manager_prefilters', 
     60    EVENT_HANDLER_PRIORITY_NEUTRAL, $admin_file); 
     61 
    6062  // new action in Batch Manager 
    61   add_event_handler('loc_end_element_set_global', 'skeleton_loc_end_element_set_global'); 
    62   add_event_handler('element_set_global_action', 'skeleton_element_set_global_action', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
     63  add_event_handler('loc_end_element_set_global', 'skeleton_loc_end_element_set_global', 
     64    EVENT_HANDLER_PRIORITY_NEUTRAL, $admin_file); 
     65  add_event_handler('element_set_global_action', 'skeleton_element_set_global_action', 
     66    EVENT_HANDLER_PRIORITY_NEUTRAL, $admin_file); 
    6367} 
    6468else 
    6569{ 
    6670  // file containing all public handlers functions 
    67   include_once(SKELETON_PATH . 'include/public_events.inc.php'); 
    68    
     71  $public_file = SKELETON_PATH . 'include/public_events.inc.php'; 
     72 
    6973  // add a public section 
    70   add_event_handler('loc_end_section_init', 'skeleton_loc_end_section_init'); 
    71   add_event_handler('loc_end_index', 'skeleton_loc_end_page'); 
    72    
     74  add_event_handler('loc_end_section_init', 'skeleton_loc_end_section_init', 
     75    EVENT_HANDLER_PRIORITY_NEUTRAL, $public_file); 
     76  add_event_handler('loc_end_index', 'skeleton_loc_end_page', 
     77    EVENT_HANDLER_PRIORITY_NEUTRAL, $public_file); 
     78 
    7379  // add button on album and photos pages 
    74   add_event_handler('loc_end_index', 'skeleton_add_button'); 
    75   add_event_handler('loc_end_picture', 'skeleton_add_button'); 
    76    
     80  add_event_handler('loc_end_index', 'skeleton_add_button', 
     81    EVENT_HANDLER_PRIORITY_NEUTRAL, $public_file); 
     82  add_event_handler('loc_end_picture', 'skeleton_add_button', 
     83    EVENT_HANDLER_PRIORITY_NEUTRAL, $public_file); 
     84 
    7785  // prefilter on photo page 
    78   add_event_handler('loc_end_picture', 'skeleton_loc_end_picture'); 
     86  add_event_handler('loc_end_picture', 'skeleton_loc_end_picture', 
     87    EVENT_HANDLER_PRIORITY_NEUTRAL, $public_file); 
    7988} 
    8089 
     90// file containing API function 
     91$ws_file = SKELETON_PATH . 'include/ws_functions.inc.php'; 
     92 
    8193// add API function 
    82 add_event_handler('ws_add_methods', 'skeleton_ws_add_methods'); 
     94add_event_handler('ws_add_methods', 'skeleton_ws_add_methods', 
     95    EVENT_HANDLER_PRIORITY_NEUTRAL, $ws_file); 
    8396 
    8497 
     
    88101 
    89102// file containing the class for menu handlers functions 
    90 include_once(SKELETON_PATH . 'include/menu_events.class.php'); 
     103$menu_file = SKELETON_PATH . 'include/menu_events.class.php'; 
    91104 
    92105// 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); 
     106add_event_handler('blockmanager_apply', array('SkeletonMenu', 'blockmanager_apply1'), 
     107  EVENT_HANDLER_PRIORITY_NEUTRAL+10, $menu_file); 
    94108 
    95109// 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')); 
     110add_event_handler('blockmanager_register_blocks', array('SkeletonMenu', 'blockmanager_register_blocks'), 
     111  EVENT_HANDLER_PRIORITY_NEUTRAL, $menu_file); 
     112add_event_handler('blockmanager_apply', array('SkeletonMenu', 'blockmanager_apply2'), 
     113  EVENT_HANDLER_PRIORITY_NEUTRAL, $menu_file); 
     114 
    98115// NOTE: blockmanager_apply1() and blockmanager_apply2() can (must) be merged 
    99  
    100  
    101  
    102 // files containing specific plugin functions 
    103 include_once(SKELETON_PATH . 'include/functions.inc.php'); 
    104 include_once(SKELETON_PATH . 'include/ws_functions.inc.php'); 
    105  
    106116 
    107117 
     
    115125{ 
    116126  global $conf; 
    117    
    118   // apply upgrade if needed 
    119   include_once(SKELETON_PATH . 'maintain.inc.php'); 
    120   $maintain = new skeleton_maintain(SKELETON_ID); 
    121   $maintain->autoUpdate(SKELETON_VERSION, 'install'); 
    122    
     127 
    123128  // load plugin language file 
    124129  load_language('plugin.lang', SKELETON_PATH); 
    125    
     130 
    126131  // prepare plugin configuration 
    127   $conf['skeleton'] = unserialize($conf['skeleton']); 
     132  $conf['skeleton'] = safe_unserialize($conf['skeleton']); 
    128133} 
  • extensions/skeleton/trunk/template/my_button.tpl

    r26137 r28650  
    11{strip} 
     2{combine_css id="skeleton" path=$SKELETON_PATH|cat:"template/style.css"} 
     3 
     4{* <!-- nothing more than the button itself must be defined here --> *} 
    25<a href="javascript:alert('Hello world!');" title="{'This is not the %s you are looking for'|translate:('button'|translate)}" class="pwg-state-default pwg-button" rel="nofollow"> 
    3   <span class="pwg-icon" style="background:url('{$ROOT_URL}{$SKELETON_PATH}template/head.png') center center no-repeat;"> </span> 
     6  <span class="pwg-icon skeleton-button"> </span> 
    47  <span class="pwg-button-text">{'Skeleton'|translate}</span> 
    58</a> 
  • extensions/skeleton/trunk/template/skeleton_page.tpl

    r24182 r28650  
    1 {combine_css path=$SKELETON_PATH|@cat:"template/style.css"} 
     1{* <!-- load CSS files --> *} 
     2{combine_css id="skeleton" path=$SKELETON_PATH|cat:"template/style.css"} 
    23 
    3 {* <!-- add scripts here --> *} 
    4 {footer_script require='jquery'}{literal} 
    5 var reverse=0; 
    6 $("#test").click(function() { 
    7   if (!reverse) { 
    8     $("body").css('-moz-transform','rotate(180deg)'); 
    9     $("body").css('-webkit-transform','rotate(180deg)'); 
    10     $("body").css('-o-transform','rotate(180deg)'); 
    11     reverse=1; 
    12   } else { 
    13     $("body").css('-moz-transform','rotate(0deg)'); 
    14     $("body").css('-webkit-transform','rotate(0deg)'); 
    15     $("body").css('-o-transform','rotate(0deg)'); 
    16     reverse=0; 
     4{* <!-- load JS files --> *} 
     5{* {combine_script id="skeleton" require="jquery" path=$SKELETON_PATH|cat:"template/script.js"} *} 
     6 
     7{* <!-- add inline JS --> *} 
     8{footer_script require="jquery"} 
     9  jQuery('#skeleton').on('click', function(){ 
     10    alert('{'Hello world!'|translate}'); 
     11  }); 
     12{/footer_script} 
     13 
     14{* <!-- add inline CSS --> *} 
     15{html_style} 
     16  #skeleton { 
     17    display:block; 
    1718  } 
    18 }); 
    19 {/literal}{/footer_script} 
     19{/html_style} 
     20 
    2021 
    2122{* <!-- add page content here --> *} 
    2223<h1>{'What Skeleton can do for me?'|translate}</h1> 
     24 
    2325<blockquote> 
    2426  {$INTRO_CONTENT} 
    2527</blockquote> 
    2628 
    27 <div id="test">{'Click for fun'|translate}</div> 
     29<div id="skeleton">{'Click for fun'|translate}</div> 
  • extensions/skeleton/trunk/template/style.css

    r24182 r28650  
    1 #test { 
     1/* CSS code for your plugin */ 
     2 
     3#skeleton { 
    24  width:400px; 
    35  height:30px; 
     
    2426  cursor:pointer; 
    2527} 
    26 #test:hover { 
    27   -moz-transform:rotate(175deg); 
    28   -webkit-transform:rotate(175deg); 
    29   -o-transform:rotate(175deg); 
    30   transform:rotate(175deg); 
     28#skeleton:hover { 
     29  -moz-transform:rotate(-5deg); 
     30  -webkit-transform:rotate(-5deg); 
     31  -o-transform:rotate(-5deg); 
     32  transform:rotate(-5deg); 
    3133} 
     34 
     35.skeleton-button { 
     36  background:url('head.png') center center no-repeat !important; 
     37  min-width:26px; 
     38  min-height:26px; 
     39} 
Note: See TracChangeset for help on using the changeset viewer.