[geeklog-cvs] Geeklog-1.x/system lib-plugins.php,1.140,1.141

Dirk Haun dhaun at qs1489.pair.com
Sun Feb 3 15:47:29 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/system
In directory qs1489.pair.com:/tmp/cvs-serv17346/system

Modified Files:
	lib-plugins.php 
Log Message:
Only incude lib-story.php when it's needed; moved PLG_afterSaveSwitch to the ned of the file


Index: lib-plugins.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-plugins.php,v
retrieving revision 1.140
retrieving revision 1.141
diff -C2 -d -r1.140 -r1.141
*** lib-plugins.php	2 Jan 2008 21:06:02 -0000	1.140
--- lib-plugins.php	3 Feb 2008 20:47:27 -0000	1.141
***************
*** 66,121 ****
  
  /**
- * Forward the user depending on config.php-setting after saving something
- *
- * @param  string  $item_url   the url of the item saved
- * @param  string  $plugin     the name of the plugin that saved the item
- * @return the url where the user will be forwarded to
- *
- */
- function PLG_afterSaveSwitch($target, $item_url, $plugin, $message = '')
- {
-     global $_CONF;
- 
-     if (isset($message)) {
-         $msg = "msg=$message";
-     } else {
-         $msg = '';
-     }
- 
-     switch ($target) {
-     case 'item':
-         $url = $item_url . '&' . $msg;
-         break;
- 
-     case 'list':
-         if ($plugin == 'story') {
-             $url = $_CONF['site_admin_url'] . "/$plugin.php?$msg";
-         } elseif ($plugin == 'user') {
-             $url = $_CONF['site_admin_url'] . "/user.php?$msg";
-         } else {
-             $url = $_CONF['site_admin_url'] . "/plugins/$plugin/index.php?$msg";
-         }
-         break;
- 
-     case 'home':
-         // the plugins messages are not available, use generic
-         $url = $_CONF['site_url'] . "/index.php?msg=15";
-         break;
- 
-     case 'admin':
-         // the plugins messages are not available, use generic
-         $url = $_CONF['site_admin_url'] . "/moderation.php?msg=15";
-         break;
- 
-     case 'plugin':
-         $url = $_CONF['site_url'] . "/$plugin/index.php?$msg";
-         break;
-     }
- 
-     return COM_refresh($url);
- }
- 
- 
- /**
  * Calls a function for all enabled plugins
  *
--- 66,69 ----
***************
*** 2305,2310 ****
      $retval = PLG_RET_ERROR;
  
!     // ensure we can see the service_XXX_story functions
!     require_once $_CONF['path_system'] . 'lib-story.php';
  
      $output  = '';
--- 2253,2260 ----
      $retval = PLG_RET_ERROR;
  
!     if ($type == 'story') {
!         // ensure we can see the service_XXX_story functions
!         require_once $_CONF['path_system'] . 'lib-story.php';
!     }
  
      $output  = '';
***************
*** 2329,2337 ****
   * @param   string  type    The plugin type that is to be checked
   */
! function PLG_wsEnabled($type) {
      global $_CONF;
  
!     // ensure we can see the service_XXX_story functions
!     require_once $_CONF['path_system'] . 'lib-story.php';
  
      $function = 'plugin_wsEnabled_' . $type;
--- 2279,2290 ----
   * @param   string  type    The plugin type that is to be checked
   */
! function PLG_wsEnabled($type)
! {
      global $_CONF;
  
!     if ($type == 'story') {
!         // ensure we can see the service_XXX_story functions
!         require_once $_CONF['path_system'] . 'lib-story.php';
!     }
  
      $function = 'plugin_wsEnabled_' . $type;
***************
*** 2341,2344 ****
--- 2294,2357 ----
          return false;
      }
+ }
+ 
+ /**
+ * Forward the user depending on config.php-setting after saving something
+ *
+ * @param  string  $item_url   the url of the item saved
+ * @param  string  $plugin     the name of the plugin that saved the item
+ * @return the url where the user will be forwarded to
+ *
+ */
+ function PLG_afterSaveSwitch($target, $item_url, $plugin, $message = '')
+ {
+     global $_CONF;
+ 
+     if (isset($message)) {
+         $msg = "msg=$message";
+     } else {
+         $msg = '';
+     }
+ 
+     switch ($target) {
+     case 'item':
+         $url = $item_url;
+         if (!empty($msg)) {
+             $url .= '&' . $msg;
+         }
+         break;
+ 
+     case 'list':
+         if ($plugin == 'story') {
+             $url = $_CONF['site_admin_url'] . "/$plugin.php";
+         } elseif ($plugin == 'user') {
+             $url = $_CONF['site_admin_url'] . "/user.php";
+         } else {
+             $url = $_CONF['site_admin_url'] . "/plugins/$plugin/index.php";
+         }
+         if (!empty($msg)) {
+             $url .= '?' . $msg;
+         }
+         break;
+ 
+     case 'home':
+         // the plugins messages are not available, use generic
+         $url = $_CONF['site_url'] . '/index.php?msg=15';
+         break;
+ 
+     case 'admin':
+         // the plugins messages are not available, use generic
+         $url = $_CONF['site_admin_url'] . '/moderation.php?msg=15';
+         break;
+ 
+     case 'plugin':
+         $url = $_CONF['site_url'] . "/$plugin/index.php";
+         if (!empty($msg)) {
+             $url .= '?' . $msg;
+         }
+         break;
+     }
+ 
+     return COM_refresh($url);
  }
  




More information about the geeklog-cvs mailing list