diff options
author | patdenice <patdenice@piwigo.org> | 2011-04-23 12:48:05 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-04-23 12:48:05 +0000 |
commit | 790f6b3bb6e4bf888a7fdb36f87a763cdb8ca450 (patch) | |
tree | 57cce0c848c48c18e17013138509e9d0b2bbbb03 /admin/themes | |
parent | d7dfe63e113a069b05a363fa339db3cd7274ead1 (diff) |
Change tabsheet place for plugins, themes and languages.
Plugins, themes and languages use same update page.
git-svn-id: http://piwigo.org/svn/trunk@10594 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/themes.php | 50 | ||||
-rw-r--r-- | admin/themes/default/template/languages_update.tpl | 58 | ||||
-rw-r--r-- | admin/themes/default/template/plugins_list.tpl | 2 | ||||
-rw-r--r-- | admin/themes/default/template/plugins_update.tpl | 58 | ||||
-rw-r--r-- | admin/themes/default/template/themes_update.tpl | 58 | ||||
-rw-r--r-- | admin/themes_installed.php | 1 | ||||
-rw-r--r-- | admin/themes_new.php | 1 | ||||
-rw-r--r-- | admin/themes_update.php | 133 |
8 files changed, 51 insertions, 310 deletions
diff --git a/admin/themes.php b/admin/themes.php new file mode 100644 index 000000000..297cec1a9 --- /dev/null +++ b/admin/themes.php @@ -0,0 +1,50 @@ +<?php +// +-----------------------------------------------------------------------+ +// | Piwigo - a PHP based photo gallery | +// +-----------------------------------------------------------------------+ +// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org | +// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | +// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | +// +-----------------------------------------------------------------------+ +// | This program is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU General Public License as published by | +// | the Free Software Foundation | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +if( !defined("PHPWG_ROOT_PATH") ) +{ + die ("Hacking attempt!"); +} + +include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); + +$my_base_url = get_root_url().'admin.php?page=themes'; + +if (isset($_GET['tab'])) + $page['tab'] = $_GET['tab']; +else + $page['tab'] = 'installed'; + +$tabsheet = new tabsheet(); +$tabsheet->add('installed', l10n('Installed Themes'), $my_base_url.'&tab=installed'); +$tabsheet->add('update', l10n('Check for updates'), $my_base_url.'&tab=update'); +$tabsheet->add('new', l10n('Add New Theme'), $my_base_url.'&tab=new'); +$tabsheet->select($page['tab']); +$tabsheet->assign(); + +if ($page['tab'] == 'update') + include(PHPWG_ROOT_PATH.'admin/updates_ext.php'); +else + include(PHPWG_ROOT_PATH.'admin/themes_'.$page['tab'].'.php'); + +?>
\ No newline at end of file diff --git a/admin/themes/default/template/languages_update.tpl b/admin/themes/default/template/languages_update.tpl deleted file mode 100644 index 2b1a2b27d..000000000 --- a/admin/themes/default/template/languages_update.tpl +++ /dev/null @@ -1,58 +0,0 @@ -{footer_script require='jquery.effects.blind'}{literal} -jQuery(document).ready(function(){ - jQuery("td[id^='desc_'], p[id^='revdesc_']").click(function() { - id = this.id.split('_'); - jQuery("#revdesc_"+id[1]).toggle('blind'); - jQuery(".button_"+id[1]).toggle(); - return false; - }); -}); -{/literal}{/footer_script} - -<div class="titrePage"> - <h2>{'Languages'|@translate}</h2> -</div> - -{if not empty($update_languages)} -<div id="availablePlugins"> -<fieldset> -<legend>{'Languages which need upgrade'|@translate}</legend> -{foreach from=$update_languages item=language name=languages_loop} -<div class="pluginBox"> - <table> - <tr> - <td class="pluginBoxNameCell"> - {$language.EXT_NAME} - </td> - <td> - <a href="{$language.URL_UPDATE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'Install'|@translate}</a> - | <a href="{$language.URL_DOWNLOAD}">{'Download'|@translate}</a> - | <a class="externalLink" href="{$language.EXT_URL}">{'Visit language site'|@translate}</a> - </td> - </tr> - <tr> - <td> - {'Version'|@translate} {$language.CURRENT_VERSION} - </td> - <td class="pluginDesc" id="desc_{$language.ID}"> - <em>{'Downloads'|@translate}: {$language.DOWNLOADS}</em> - <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plus.gif" alt="" class="button_{$language.ID}"> - <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/minus.gif" alt="" class="button_{$language.ID}" style="display:none;"> - {'New Version'|@translate} : {$language.NEW_VERSION} - | {'By %s'|@translate|@sprintf:$language.AUTHOR} - </td> - </tr> - <tr> - <td></td> - <td class="pluginDesc"> - <p id="revdesc_{$language.ID}" style="display:none;">{$language.REV_DESC|htmlspecialchars|nl2br}</p> - </td> - </tr> - </table> -</div> -{/foreach} -</fieldset> -</div> -{elseif not isset($SERVER_ERROR)} -<p>{'All languages are up to date.'|@translate}</p> -{/if} diff --git a/admin/themes/default/template/plugins_list.tpl b/admin/themes/default/template/plugins_list.tpl index ccf6f02f7..54f051eac 100644 --- a/admin/themes/default/template/plugins_list.tpl +++ b/admin/themes/default/template/plugins_list.tpl @@ -81,7 +81,7 @@ jQuery(document).ready(function() { <div class="titrePage"> <span class="sort"> <form action="" method="get" name="change_order"> - <input type="hidden" name="page" value="plugins_list"/> + <input type="hidden" name="page" value="plugins"/> {'Sort order'|@translate} : <select name="plugin_order" onchange="this.form.submit();"> <option value="status" {if $plugin_order=='state'}selected="selected"{/if}>{'Status'|@translate}</option> diff --git a/admin/themes/default/template/plugins_update.tpl b/admin/themes/default/template/plugins_update.tpl deleted file mode 100644 index 50cca3505..000000000 --- a/admin/themes/default/template/plugins_update.tpl +++ /dev/null @@ -1,58 +0,0 @@ -{footer_script require='jquery.effects.blind'}{literal} -jQuery(document).ready(function(){ - jQuery("td[id^='desc_'], p[id^='revdesc_']").click(function() { - id = this.id.split('_'); - jQuery("#revdesc_"+id[1]).toggle('blind'); - jQuery(".button_"+id[1]).toggle(); - return false; - }); -}); -{/literal}{/footer_script} - -<div class="titrePage"> - <h2>{'Plugins'|@translate}</h2> -</div> - -{if not empty($plugins)} -<div id="availablePlugins"> -<fieldset> -<legend>{'Plugins which need upgrade'|@translate}</legend> -{foreach from=$plugins item=plugin name=plugins_loop} -<div class="pluginBox"> - <table> - <tr> - <td class="pluginBoxNameCell"> - {$plugin.EXT_NAME} - </td> - <td> - <a href="{$plugin.URL_UPDATE}" onclick="return confirm('{'Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'|@translate|@escape:javascript}');">{'Install'|@translate}</a> - | <a href="{$plugin.URL_DOWNLOAD}">{'Download'|@translate}</a> - | <a class="externalLink" href="{$plugin.EXT_URL}">{'Visit plugin site'|@translate}</a> - </td> - </tr> - <tr> - <td> - {'Version'|@translate} {$plugin.CURRENT_VERSION} - </td> - <td class="pluginDesc" id="desc_{$plugin.ID}"> - <em>{'Downloads'|@translate}: {$plugin.DOWNLOADS}</em> - <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plus.gif" alt="" class="button_{$plugin.ID}"> - <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/minus.gif" alt="" class="button_{$plugin.ID}" style="display:none;"> - {'New Version'|@translate} : {$plugin.NEW_VERSION} - | {'By %s'|@translate|@sprintf:$plugin.AUTHOR} - </td> - </tr> - <tr> - <td></td> - <td class="pluginDesc"> - <p id="revdesc_{$plugin.ID}" style="display:none;">{$plugin.REV_DESC|htmlspecialchars|nl2br}</p> - </td> - </tr> - </table> -</div> -{/foreach} -</fieldset> -</div> -{elseif not isset($SERVER_ERROR)} -<p>{'All plugins are up to date.'|@translate}</p> -{/if} diff --git a/admin/themes/default/template/themes_update.tpl b/admin/themes/default/template/themes_update.tpl deleted file mode 100644 index 3bf1cc0b1..000000000 --- a/admin/themes/default/template/themes_update.tpl +++ /dev/null @@ -1,58 +0,0 @@ -{footer_script require='jquery.effects.blind'}{literal} -jQuery(document).ready(function(){ - jQuery("td[id^='desc_'], p[id^='revdesc_']").click(function() { - id = this.id.split('_'); - jQuery("#revdesc_"+id[1]).toggle('blind'); - jQuery(".button_"+id[1]).toggle(); - return false; - }); -}); -{/literal}{/footer_script} - -<div class="titrePage"> - <h2>{'Themes'|@translate}</h2> -</div> - -{if not empty($update_themes)} -<div id="availablePlugins"> -<fieldset> -<legend>{'Themes which need upgrade'|@translate}</legend> -{foreach from=$update_themes item=theme name=themes_loop} -<div class="pluginBox"> - <table> - <tr> - <td class="pluginBoxNameCell"> - {$theme.EXT_NAME} - </td> - <td> - <a href="{$theme.URL_UPDATE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'Install'|@translate}</a> - | <a href="{$theme.URL_DOWNLOAD}">{'Download'|@translate}</a> - | <a class="externalLink" href="{$theme.EXT_URL}">{'Visit theme site'|@translate}</a> - </td> - </tr> - <tr> - <td> - {'Version'|@translate} {$theme.CURRENT_VERSION} - </td> - <td class="pluginDesc" id="desc_{$theme.ID}"> - <em>{'Downloads'|@translate}: {$theme.DOWNLOADS}</em> - <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plus.gif" alt="" class="button_{$theme.ID}"> - <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/minus.gif" alt="" class="button_{$theme.ID}" style="display:none;"> - {'New Version'|@translate} : {$theme.NEW_VERSION} - | {'By %s'|@translate|@sprintf:$theme.AUTHOR} - </td> - </tr> - <tr> - <td></td> - <td class="pluginDesc"> - <p id="revdesc_{$theme.ID}" style="display:none;">{$theme.REV_DESC|htmlspecialchars|nl2br}</p> - </td> - </tr> - </table> -</div> -{/foreach} -</fieldset> -</div> -{elseif not isset($SERVER_ERROR)} -<p>{'All themes are up to date.'|@translate}</p> -{/if} diff --git a/admin/themes_installed.php b/admin/themes_installed.php index 5fc17fe64..9ba06011c 100644 --- a/admin/themes_installed.php +++ b/admin/themes_installed.php @@ -151,7 +151,6 @@ $template->assign( ); -$themes->set_tabsheet($page['page']); $template->set_filenames(array('themes' => 'themes_installed.tpl')); $template->assign_var_from_handle('ADMIN_CONTENT', 'themes'); ?> diff --git a/admin/themes_new.php b/admin/themes_new.php index cef9b3c41..44acd1fa7 100644 --- a/admin/themes_new.php +++ b/admin/themes_new.php @@ -31,7 +31,6 @@ include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); $base_url = get_root_url().'admin.php?page='.$page['page']; $themes = new themes(); -$themes->set_tabsheet('themes_new'); // +-----------------------------------------------------------------------+ // | setup check | diff --git a/admin/themes_update.php b/admin/themes_update.php deleted file mode 100644 index 7909e47e0..000000000 --- a/admin/themes_update.php +++ /dev/null @@ -1,133 +0,0 @@ -<?php -// +-----------------------------------------------------------------------+ -// | Piwigo - a PHP based photo gallery | -// +-----------------------------------------------------------------------+ -// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org | -// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | -// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | -// +-----------------------------------------------------------------------+ -// | This program is free software; you can redistribute it and/or modify | -// | it under the terms of the GNU General Public License as published by | -// | the Free Software Foundation | -// | | -// | This program is distributed in the hope that it will be useful, but | -// | WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | General Public License for more details. | -// | | -// | You should have received a copy of the GNU General Public License | -// | along with this program; if not, write to the Free Software | -// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | -// | USA. | -// +-----------------------------------------------------------------------+ - - -if( !defined("PHPWG_ROOT_PATH") ) -{ - die ("Hacking attempt!"); -} - -include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); - -$base_url = get_root_url().'admin.php?page='.$page['page']; - -$themes = new themes(); - -$themes->set_tabsheet($page['page']); - -//-----------------------------------------------------------automatic upgrade -if (isset($_GET['theme']) and isset($_GET['revision'])) -{ - if (!is_webmaster()) - { - array_push($page['errors'], l10n('Webmaster status is required.')); - } - else - { - check_pwg_token(); - - $theme_id = $_GET['theme']; - $revision = $_GET['revision']; - - $upgrade_status = $themes->extract_theme_files('upgrade', $revision, $theme_id); - - switch ($upgrade_status) - { - case 'ok': - array_push($page['infos'], - sprintf( - l10n('%s has been successfully upgraded.'), - $themes->fs_themes[$_GET['theme']]['name'])); - break; - - case 'temp_path_error': - array_push($page['errors'], l10n('Can\'t create temporary file.')); - break; - - case 'dl_archive_error': - array_push($page['errors'], l10n('Can\'t download archive.')); - break; - - case 'archive_error': - array_push($page['errors'], l10n('Can\'t read or extract archive.')); - break; - - default: - array_push($page['errors'], - sprintf(l10n('An error occured during extraction (%s).'), $upgrade_status) - ); - } - - $themes->themes(); - $template->delete_compiled_templates(); - } -} - -// +-----------------------------------------------------------------------+ -// | start template output | -// +-----------------------------------------------------------------------+ -$template->set_filenames(array('themes' => 'themes_update.tpl')); - -if ($themes->get_server_themes()) -{ - foreach($themes->fs_themes as $theme_id => $fs_theme) - { - if (isset($fs_theme['extension']) - and isset($themes->server_themes[$fs_theme['extension']])) - { - $theme_info = $themes->server_themes[$fs_theme['extension']]; - - if (!$themes->theme_version_compare($fs_theme['version'], $theme_info['revision_name'])) - { - $url_auto_update = $base_url - . '&revision=' . $theme_info['revision_id'] - . '&theme=' . $theme_id - . '&pwg_token='.get_pwg_token() - ; - - $template->append('update_themes', array( - 'ID' => $theme_info['extension_id'], - 'EXT_NAME' => $fs_theme['name'], - 'EXT_URL' => PEM_URL.'/extension_view.php?eid='.$theme_info['extension_id'], - 'EXT_DESC' => trim($theme_info['extension_description'], " \n\r"), - 'REV_DESC' => trim($theme_info['revision_description'], " \n\r"), - 'CURRENT_VERSION' => $fs_theme['version'], - 'NEW_VERSION' => $theme_info['revision_name'], - 'AUTHOR' => $theme_info['author_name'], - 'DOWNLOADS' => $theme_info['extension_nb_downloads'], - 'URL_UPDATE' => $url_auto_update, - 'URL_DOWNLOAD' => $theme_info['download_url'] . '&origin=piwigo_download' - ) - ); - } - } - } -} -else -{ - $template->assign('SERVER_ERROR', true); - array_push($page['errors'], l10n('Can\'t connect to server.')); -} - -$template->assign_var_from_handle('ADMIN_CONTENT', 'themes'); -?>
\ No newline at end of file |