Changeset 25577


Ignore:
Timestamp:
Nov 19, 2013, 4:41:05 PM (10 years ago)
Author:
mistic100
Message:

feature 2998: Warning: Parameter 3 to theme_activate() expected to be a reference, value given
unable to pass references through func_get_args and call_user_func_array

Location:
trunk/admin/include
Files:
2 edited

Legend:

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

    r25406 r25577  
    3030  function install($plugin_version, &$errors=array())
    3131  {
    32     return $this->__call(__FUNCTION__, func_get_args());
     32    if (is_callable('plugin_install'))
     33    {
     34      return plugin_install($this->plugin_id, $plugin_version, $errors);
     35    }
    3336  }
    3437  function activate($plugin_version, &$errors=array())
    3538  {
    36     return $this->__call(__FUNCTION__, func_get_args());
     39    if (is_callable('plugin_activate'))
     40    {
     41      return plugin_activate($this->plugin_id, $plugin_version, $errors);
     42    }
    3743  }
    3844  function deactivate()
    3945  {
    40     return $this->__call(__FUNCTION__, func_get_args());
     46    if (is_callable('plugin_install'))
     47    {
     48      return plugin_install($this->plugin_id);
     49    }
    4150  }
    4251  function uninstall()
    4352  {
    44     return $this->__call(__FUNCTION__, func_get_args());
    45   }
    46 
    47   function __call($name, $arguments)
    48   {
    49     if (is_callable('plugin_'.$name))
    50     {
    51       array_unshift($arguments, $this->plugin_id);
    52       return call_user_func_array('plugin_'.$name, $arguments);
    53     }
    54     return null;
     53    if (is_callable('plugin_uninstall'))
     54    {
     55      return plugin_uninstall($this->plugin_id);
     56    }
    5557  }
    5658}
  • trunk/admin/include/themes.class.php

    r25406 r25577  
    3030  function activate($theme_version, &$errors=array())
    3131  {
    32     return $this->__call(__FUNCTION__, func_get_args());
     32    if (is_callable('theme_activate'))
     33    {
     34      return theme_activate($this->theme_id, $theme_version, $errors);
     35    }
    3336  }
    3437  function deactivate()
    3538  {
    36     return $this->__call(__FUNCTION__, func_get_args());
     39    if (is_callable('theme_deactivate'))
     40    {
     41      return theme_deactivate($this->theme_id);
     42    }
    3743  }
    3844  function delete()
    3945  {
    40     return $this->__call(__FUNCTION__, func_get_args());
    41   }
    42 
    43   function __call($name, $arguments)
    44   {
    45     if (is_callable('theme_'.$name))
    46     {
    47       array_unshift($arguments, $this->theme_id);
    48       return call_user_func_array('theme_'.$name, $arguments);
    49     }
    50     return null;
     46    if (is_callable('theme_delete'))
     47    {
     48      return theme_delete($this->theme_id);
     49    }
    5150  }
    5251}
Note: See TracChangeset for help on using the changeset viewer.