[geeklog-cvs] geeklog: Rename STORY_getItemInfo to plugin_getiteminfo_story

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Feb 21 14:53:36 EST 2010


changeset 7748:63ffcd1093eb
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/63ffcd1093eb
user: Dirk Haun <dirk at haun-online.de>
date: Sun Feb 21 10:50:10 2010 +0100
description:
Rename STORY_getItemInfo to plugin_getiteminfo_story

diffstat:

 system/lib-plugins.php |   19 +++---
 system/lib-story.php   |  124 ++++++++++++++++++++--------------------
 2 files changed, 71 insertions(+), 72 deletions(-)

diffs (186 lines):

diff -r 7a8ca5e52c23 -r 63ffcd1093eb system/lib-plugins.php
--- a/system/lib-plugins.php	Sun Feb 21 10:19:08 2010 +0100
+++ b/system/lib-plugins.php	Sun Feb 21 10:50:10 2010 +0100
@@ -2086,25 +2086,24 @@
 */
 function PLG_getItemInfo($type, $id, $what, $uid = 0, $options = array())
 {
-    if ($type == 'article') {
+    if (($type == 'article') || ($type == 'story')) {
 
         global $_CONF;
 
         require_once $_CONF['path_system'] . 'lib-story.php';
 
-        return STORY_getItemInfo($id, $what, $uid, $options);
+        $type = 'story';
 
-    } else {
+    }
 
-        $args[1] = $id;
-        $args[2] = $what;
-        $args[3] = $uid;
-        $args[4] = $options;
+    $args[1] = $id;
+    $args[2] = $what;
+    $args[3] = $uid;
+    $args[4] = $options;
 
-        $function = 'plugin_getiteminfo_' . $type;
+    $function = 'plugin_getiteminfo_' . $type;
 
-        return PLG_callFunctionForOnePlugin($function, $args);
-    }
+    return PLG_callFunctionForOnePlugin($function, $args);
 }
 
 /**
diff -r 7a8ca5e52c23 -r 63ffcd1093eb system/lib-story.php
--- a/system/lib-story.php	Sun Feb 21 10:19:08 2010 +0100
+++ b/system/lib-story.php	Sun Feb 21 10:50:10 2010 +0100
@@ -676,6 +676,67 @@
 }
 
 /**
+* Delete a story.
+*
+* This is used to delete a story from the list of stories.
+*
+* @param    string  $sid    ID of the story to delete
+* @return   string          HTML, e.g. a meta redirect
+*
+*/
+function STORY_deleteStory($sid)
+{
+    $args = array (
+                    'sid' => $sid
+                  );
+
+    $output = '';
+
+    PLG_invokeService('story', 'delete', $args, $output, $svc_msg);
+
+    return $output;
+}
+
+/**
+* Delete a story and related data immediately.
+*
+* Note: For internal use only! To delete a story, use STORY_deleteStory (see
+*       above), which will do permission checks and eventually end up here.
+*
+* @param    string  $sid    ID of the story to delete
+* @internal For internal use only!
+*
+*/
+function STORY_doDeleteThisStoryNow($sid)
+{
+    global $_CONF, $_TABLES;
+
+    require_once $_CONF['path_system'] . 'lib-comment.php';
+
+    STORY_deleteImages($sid);
+    DB_delete($_TABLES['comments'], array('sid', 'type'),
+                                    array($sid, 'article'));
+    DB_delete($_TABLES['trackback'], array('sid', 'type'),
+                                     array($sid, 'article'));
+    DB_delete($_TABLES['stories'], 'sid', $sid);
+
+    // notify plugins
+    PLG_itemDeleted($sid, 'article');
+
+    // update RSS feed and Older Stories block
+    COM_rdfUpToDateCheck();
+    COM_olderStuff();
+    CMT_updateCommentcodes();
+}
+
+
+/*
+ * Implement *some* of the Plugin API functions for stories. While stories
+ * aren't a plugin (and likely never will be), implementing some of the API
+ * functions here will save us from doing special handling elsewhere.
+ */
+
+/**
 * Return information for a story
 *
 * This is the story equivalent of PLG_getItemInfo. See lib-plugins.php for
@@ -688,7 +749,7 @@
 * @return   mixed               string or array of strings with the information
 *
 */
-function STORY_getItemInfo($sid, $what, $uid = 0, $options = array())
+function plugin_getiteminfo_story($sid, $what, $uid = 0, $options = array())
 {
     global $_CONF, $_TABLES;
 
@@ -843,67 +904,6 @@
 }
 
 /**
-* Delete a story.
-*
-* This is used to delete a story from the list of stories.
-*
-* @param    string  $sid    ID of the story to delete
-* @return   string          HTML, e.g. a meta redirect
-*
-*/
-function STORY_deleteStory($sid)
-{
-    $args = array (
-                    'sid' => $sid
-                  );
-
-    $output = '';
-
-    PLG_invokeService('story', 'delete', $args, $output, $svc_msg);
-
-    return $output;
-}
-
-/**
-* Delete a story and related data immediately.
-*
-* Note: For internal use only! To delete a story, use STORY_deleteStory (see
-*       above), which will do permission checks and eventually end up here.
-*
-* @param    string  $sid    ID of the story to delete
-* @internal For internal use only!
-*
-*/
-function STORY_doDeleteThisStoryNow($sid)
-{
-    global $_CONF, $_TABLES;
-
-    require_once $_CONF['path_system'] . 'lib-comment.php';
-
-    STORY_deleteImages($sid);
-    DB_delete($_TABLES['comments'], array('sid', 'type'),
-                                    array($sid, 'article'));
-    DB_delete($_TABLES['trackback'], array('sid', 'type'),
-                                     array($sid, 'article'));
-    DB_delete($_TABLES['stories'], 'sid', $sid);
-
-    // notify plugins
-    PLG_itemDeleted($sid, 'article');
-
-    // update RSS feed and Older Stories block
-    COM_rdfUpToDateCheck();
-    COM_olderStuff();
-    CMT_updateCommentcodes();
-}
-
-
-/*
- * Implement *some* of the Plugin API functions for stories. While stories
- * aren't a plugin (and likely never will be), implementing some of the API
- * functions here will save us from doing special handling elsewhere.
- */
-
-/**
 * Return true since this component supports webservices
 *
 * @return   boolean     True, if webservices are supported



More information about the geeklog-cvs mailing list