Changeset 9712


Ignore:
Timestamp:
03/15/11 20:25:09 (7 years ago)
Author:
patdenice
Message:

Clean code.
Rename files.

Location:
extensions/autoupdate/trunk
Files:
1 added
1 deleted
10 edited
2 moved

Legend:

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

    r9707 r9712  
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
    44 
    5 include_once(AUTOUPDATE_PATH.'include/functions.inc.php'); 
    6 include_once(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php'); 
    75include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 
    86 
  • extensions/autoupdate/trunk/ajax/check_updates.php

    r9710 r9712  
    55include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 
    66include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    7 include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); 
    87 
    98check_status(ACCESS_ADMINISTRATOR); 
  • extensions/autoupdate/trunk/ajax/ignore_list.php

    r9710 r9712  
    55include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 
    66include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    7 include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); 
    87 
    98check_status(ACCESS_ADMINISTRATOR); 
  • extensions/autoupdate/trunk/ajax/update_language.php

    r9710 r9712  
    55include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 
    66include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    7 include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); 
    87 
    98check_status(ACCESS_ADMINISTRATOR); 
  • extensions/autoupdate/trunk/ajax/update_plugin.php

    r9710 r9712  
    55include_once(PHPWG_ROOT_PATH.'include/common.inc.php' ); 
    66include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    7 include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); 
    87 
    98if (!defined('AUTOUPDATE_PATH')) 
  • extensions/autoupdate/trunk/ajax/update_theme.php

    r9710 r9712  
    55include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 
    66include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    7 include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); 
    87 
    98check_status(ACCESS_ADMINISTRATOR); 
  • extensions/autoupdate/trunk/include/functions.inc.php

    r6351 r9712  
    295295  if (!version_compare($_POST['upgrade_to'], PHPWG_VERSION, '>')) 
    296296  { 
    297     redirect(get_admin_plugin_menu_link(AUTOUPDATE_PATH . '/autoupdate.php')); 
     297    redirect(get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))); 
    298298  } 
    299299 
     
    417417} 
    418418 
    419 if (!function_exists('is_webmaster')) 
    420 { 
    421   function is_webmaster($user_status = '') 
    422   { 
    423     return is_autorize_status(ACCESS_WEBMASTER, $user_status); 
    424   } 
    425 } 
    426  
    427419define('AU_DEFAULT_INDEX', file_get_contents(AUTOUPDATE_PATH.'index.php')); 
    428420?> 
  • extensions/autoupdate/trunk/main.inc.php

    r9710 r9712  
    2828function check_for_auto_upgrade($plugin_menu_links) 
    2929{ 
    30   global $template, $page, $conf, $header_notes, $prefixeTable; 
    31  
    32   load_language('plugin.lang', dirname(__FILE__).'/'); 
     30  global $template, $page, $header_notes; 
    3331 
    3432  if ($page['page'] == 'intro') 
     
    4442      or $_SESSION['need_update'] !== false or $_SESSION['extensions_need_update'] !== array()) 
    4543    { 
     44      load_language('plugin.lang', dirname(__FILE__).'/'); 
    4645      $template->set_filename('autoupdate_head', realpath(AUTOUPDATE_PATH.'template/head.tpl')); 
    4746      array_push($header_notes, $template->parse('autoupdate_head', true)); 
  • extensions/autoupdate/trunk/template/update_ext.tpl

    r9710 r9712  
    11{combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' } 
     2{combine_script id='jquery.autoupdate' load='footer' require='jquery' path='plugins/autoupdate/template/autoupdate.js' } 
    23{combine_css path="admin/themes/default/uploadify.jGrowl.css"} 
    34 
    4 {footer_script require='jquery.jgrowl'} 
     5{footer_script require='jquery.autoupdate,jquery.effects.blind,jquery.jgrowl'} 
    56var extList = new Array(); 
    67var confirmMsg  = '{'Are you sure?'|@translate|@escape:'javascript'}'; 
     
    1011var restoreMsg  = '{'autoupdate_reset_ignore'|@translate|@escape:'javascript'}'; 
    1112 
     13checkFieldsets(); 
     14 
    1215{literal} 
    1316jQuery(document).ready(function() { 
    14  
    1517        jQuery("td[id^='desc_'], p[id^='revdesc_']").click(function() { 
    1618                id = this.id.split('_'); 
     
    1921                return false; 
    2022        }); 
    21  
    22   jQuery("#update_all").click(function() { 
    23     if (confirm(confirmMsg)) { 
    24       extList = []; 
    25       jQuery('.updateExtension').each( function() { 
    26         if (jQuery(this).parents('div').css('display') == 'block') { 
    27           extList.push(jQuery(this).attr('onClick')); 
    28         } 
    29       }); 
    30       if (extList.length > 0) eval(extList[0]); 
    31     } 
    32     return false; 
    33   });   
    34  
    35   jQuery("#reset_ignore").click(function() { 
    36     jQuery.post( 
    37       "plugins/autoupdate/ajax/ignore_list.php", 
    38       { reset: true }, 
    39       function(data) { 
    40         if (data == "ok") { 
    41           jQuery(".pluginBox, fieldset").show(); 
    42           jQuery("#up_to_date").hide(); 
    43           jQuery("#reset_ignore").hide(); 
    44           jQuery("#ignored").hide(); 
    45         } 
    46       } 
    47     ); 
    48     return false; 
    49   }); 
    50  
    5123}); 
    52  
    53 function checkFieldsets() { 
    54   var types = new Array('plugin', 'theme', 'language'); 
    55   var total = 0; 
    56   var ignored = 0; 
    57   for (i=0;i<3;i++) { 
    58     nbExtensions = 0; 
    59     jQuery("div[id^='"+types[i]+"_']").each(function(index) { 
    60         if (jQuery(this).css('display') == 'block') 
    61           nbExtensions++; 
    62         else 
    63           ignored++; 
    64       }); 
    65     total = total + nbExtensions; 
    66     if (nbExtensions == 0) 
    67       jQuery("#"+types[i]+"s").hide(); 
    68   } 
    69  
    70   if (total == 0) { 
    71     jQuery("#update_all").hide(); 
    72     jQuery("#up_to_date").show(); 
    73   } 
    74   if (ignored > 0) { 
    75     jQuery("#reset_ignore").val(restoreMsg + ' (' + ignored + ')'); 
    76   } 
    77 } 
    78  
    79 function upgradeExtension(type, id, revision) { 
    80   jQuery.ajax({ 
    81     type: 'POST', 
    82     url: 'plugins/autoupdate/ajax/update_'+type+'.php', 
    83     data: { id: id, revision: revision }, 
    84     success: function(data) { 
    85       if (data['result']) { 
    86         jQuery("#"+type+"_"+id).remove(); 
    87         checkFieldsets(); 
    88         jQuery.jGrowl( 
    89           data['msg'], 
    90           { 
    91             theme:  'success', 
    92             header: successHead, 
    93             life:   4000, 
    94             sticky: false 
    95           } 
    96         ); 
    97         if (extList.length > 0) extList.shift(); 
    98         if (extList.length > 0) eval(extList[0]); 
    99       } else { 
    100         jQuery.jGrowl( 
    101           data['msg'], 
    102           { 
    103             theme:  'error', 
    104             header: errorHead, 
    105             sticky: true 
    106           } 
    107         ); 
    108         extList = []; 
    109       } 
    110     }, 
    111     error: function(data) { 
    112       jQuery.jGrowl( 
    113         errorMsg, 
    114         { 
    115           theme:  'error', 
    116           header: errorHead, 
    117           sticky: true 
    118         } 
    119       ); 
    120       extList = []; 
    121     }, 
    122     dataType: 'json' 
    123   }); 
    124   return false; 
    125 } 
    126  
    127 function ignoreExtension(type, id) { 
    128   jQuery.post( 
    129     "plugins/autoupdate/ajax/ignore_list.php", 
    130     { type: type+'s', id: id }, 
    131     function(data) { 
    132       if (data == "ok") { 
    133         jQuery("#"+type+"_"+id).hide(); 
    134         jQuery("#reset_ignore").show(); 
    135         checkFieldsets(); 
    136       } 
    137     } 
    138   ); 
    139   return false; 
    140 } 
    141  
    142 checkFieldsets(); 
    143 {/literal}{/footer_script} 
     24{/literal} 
     25{/footer_script} 
    14426 
    14527<div class="titrePage"> 
     
    14830 
    14931<div> 
    150 <input type="button" id="update_all" value="{'autoupdate_update_all'|@translate}"> 
    151 <input type="button" id="reset_ignore" value="{'autoupdate_reset_ignore'|@translate}" {if !$SHOW_RESET}style="display:none;"{/if}> 
     32<input type="button" id="update_all" value="{'autoupdate_update_all'|@translate}" onClick="updateAll();"> 
     33<input type="button" id="reset_ignore" value="{'autoupdate_reset_ignore'|@translate}" onClick="resetIgnored();" {if !$SHOW_RESET}style="display:none;"{/if}> 
    15234</div> 
    15335 
  • extensions/autoupdate/trunk/update_ext.inc.php

    r9707 r9712  
    112112$template->assign('update_languages', $update_languages); 
    113113$template->assign('SHOW_RESET', (!empty($conf['AU_ignore']['plugins']) or !empty($conf['AU_ignore']['themes']) or !empty($conf['AU_ignore']['languages']))); 
    114 $template->set_filename('plugin_admin_content', realpath(AUTOUPDATE_PATH.'template/extensions.tpl')); 
     114$template->set_filename('plugin_admin_content', realpath(AUTOUPDATE_PATH.'template/update_ext.tpl')); 
    115115$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
    116116 
  • extensions/autoupdate/trunk/update_pwg.inc.php

    r9707 r9712  
    22 
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     4 
     5include_once(AUTOUPDATE_PATH.'include/functions.inc.php'); 
     6include_once(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php'); 
    47 
    58/* 
     
    137140); 
    138141 
    139 $template->set_filename('plugin_admin_content', realpath(AUTOUPDATE_PATH.'template/autoupdate.tpl')); 
     142$template->set_filename('plugin_admin_content', realpath(AUTOUPDATE_PATH.'template/update_pwg.tpl')); 
    140143$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
    141144 
Note: See TracChangeset for help on using the changeset viewer.