Changeset 27221


Ignore:
Timestamp:
Feb 5, 2014, 9:15:05 PM (6 years ago)
Author:
mistic100
Message:

PluginMaintain is not abstract anymore, allowing partial declaration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_plugins.inc.php

    r26846 r27221  
    3636 * Used to declare maintenance methods of a plugin.
    3737 */
    38 abstract class PluginMaintain
     38class PluginMaintain
    3939{
    4040  /** @var string $plugin_id */
     
    5353   * @param array &$errors - used to return error messages
    5454   */
    55   abstract function install($plugin_version, &$errors=array());
     55  function install($plugin_version, &$errors=array()) {}
    5656
    5757  /**
     
    5959   * @param array &$errors - used to return error messages
    6060   */
    61   abstract function activate($plugin_version, &$errors=array());
    62 
    63   abstract function deactivate();
    64 
    65   abstract function uninstall();
     61  function activate($plugin_version, &$errors=array()) {}
     62
     63  function deactivate() {}
     64
     65  function uninstall() {}
    6666
    6767  /**
     
    105105 * Used to declare maintenance methods of a theme.
    106106 */
    107 abstract class ThemeMaintain
     107class ThemeMaintain
    108108{
    109109  /** @var string $theme_id */
     
    122122   * @param array &$errors - used to return error messages
    123123   */
    124   abstract function activate($theme_version, &$errors=array());
    125 
    126   abstract function deactivate();
    127 
    128   abstract function delete();
     124  function activate($theme_version, &$errors=array()) {}
     125
     126  function deactivate() {}
     127
     128  function delete() {}
    129129 
    130130  /**
     
    399399  if (count($clauses))
    400400  {
    401       $query .= '
     401    $query .= '
    402402  WHERE '. implode(' AND ', $clauses);
    403403  }
    404 
    405   $result = pwg_query($query);
    406   $plugins = array();
    407   while ($row = pwg_db_fetch_assoc($result))
    408   {
    409     $plugins[] = $row;
    410   }
    411   return $plugins;
     404 
     405  return query2array($query);
    412406}
    413407
Note: See TracChangeset for help on using the changeset viewer.