Ignore:
Timestamp:
Mar 17, 2010, 1:48:38 AM (14 years ago)
Author:
plg
Message:

feature 1514: new screen to manage installed themes; activate, deactivate,
delete, set as default.

plugins.class.php was merged back to a state it doesn't manage themes at all.
themes.class.php was created instead, from a duplication of plugins.class.php
and strongly modified then.

feature 1507: the display of available themes is now much more "graphic".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/plugins.class.php

    r5143 r5153  
    269269   * Retrieve PEM server datas to $server_plugins
    270270   */
    271   function get_server_plugins($new=false, $ext_type='plugin')
     271  function get_server_plugins($new=false)
    272272  {
    273273    global $user;
    274 
    275     $pem_category_id = 12;
    276     if ('theme' == $ext_type)
    277     {
    278       $pem_category_id = 10;
    279     }
    280274
    281275    // Retrieve PEM versions
    282276    $version = PHPWG_VERSION;
    283277    $versions_to_check = array();
    284     $url = PEM_URL . '/api/get_version_list.php?category_id='.$pem_category_id.'&format=php';
     278    $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php';
    285279    if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
    286280    {
     
    314308
    315309    // Retrieve PEM plugins infos
    316     $url = PEM_URL . '/api/get_revision_list.php?category_id='.$pem_category_id.'&format=php&last_revision_only=true';
     310    $url = PEM_URL . '/api/get_revision_list.php?category_id=12&format=php&last_revision_only=true';
    317311    $url .= '&version=' . implode(',', $versions_to_check);
    318312    $url .= '&lang=' . substr($user['language'], 0, 2);
     
    371365    * @param string - plugin id or extension id
    372366   */
    373   function extract_plugin_files($action, $revision, $dest, $ext_type = 'plugin')
    374   {
    375     if ('plugin' == $ext_type)
    376     {
    377       $install_basedir = PHPWG_PLUGINS_PATH;
    378       $main_filename = 'main.inc.php';
    379     }
    380     elseif ('theme' == $ext_type)
    381     {
    382       $install_basedir = PHPWG_ROOT_PATH.'themes/';
    383       $main_filename = 'themeconf.inc.php';
    384     }
    385     else
    386     {
    387       fatal_error('unknown extension type "'.$ext_type.'"');
    388     }
    389    
    390     if ($archive = tempnam( $install_basedir, 'zip'))
     367  function extract_plugin_files($action, $revision, $dest)
     368  {
     369    if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip'))
    391370    {
    392371      $url = PEM_URL . '/download.php?rid=' . $revision;
     
    403382          {
    404383            // we search main.inc.php in archive
    405             if (basename($file['filename']) == $main_filename
     384            if (basename($file['filename']) == 'main.inc.php'
    406385              and (!isset($main_filepath)
    407386              or strlen($file['filename']) < strlen($main_filepath)))
     
    415394            if ($action == 'upgrade')
    416395            {
    417               $extract_path = $install_basedir . $dest;
     396              $extract_path = PHPWG_PLUGINS_PATH . $dest;
    418397            }
    419398            else
    420399            {
    421               $extract_path = $install_basedir
     400              $extract_path = PHPWG_PLUGINS_PATH
    422401                  . ($root == '.' ? 'extension_' . $dest : basename($root));
    423402            }
Note: See TracChangeset for help on using the changeset viewer.