diff options
| author | Nick Palmer <nick@sluggardy.net> | 2007-03-10 16:07:02 +0000 |
|---|---|---|
| committer | Nick Palmer <nick@sluggardy.net> | 2007-03-10 16:07:02 +0000 |
| commit | 5397fd058d3aa687f9ef680bf2bd75c6115d73af (patch) | |
| tree | fbb2bdec3b06c4bb029ac3f555a8cfc0d8581e86 /LibertySystem.php | |
| parent | 28c3434ee667c2d0bb5ecce88f0f4e3902c6010d (diff) | |
| download | liberty-5397fd058d3aa687f9ef680bf2bd75c6115d73af.tar.gz liberty-5397fd058d3aa687f9ef680bf2bd75c6115d73af.tar.bz2 liberty-5397fd058d3aa687f9ef680bf2bd75c6115d73af.zip | |
Added support for changing status and owners of content. Reordered some status ids. Check the schema changlog. You also should run step 4 of the installer to update permisions as there are some new permisions for these features.
Diffstat (limited to 'LibertySystem.php')
| -rwxr-xr-x | LibertySystem.php | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/LibertySystem.php b/LibertySystem.php index 0a27669..6fe80b0 100755 --- a/LibertySystem.php +++ b/LibertySystem.php @@ -3,7 +3,7 @@ * System class for handling the liberty package * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.63 2007/03/05 00:59:58 wjames5 Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.64 2007/03/10 16:07:01 nickpalmer Exp $ * @author spider <spider@steelsun.com> */ @@ -357,20 +357,6 @@ class LibertySystem extends LibertyBase { $this->scanAllPlugins(); } - - - - // ****************************** Content Type Functions - /** - * getContentStatus - * - * @access public - * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure - */ - function getContentStatus() { - return( $this->mDb->getAssoc( "SELECT `content_status_id`,`content_status_name` FROM `".BIT_DB_PREFIX."liberty_content_status`" ) ); - } - /** * Load all available content types into $this->mContentTypes * @@ -758,4 +744,36 @@ function liberty_plugins_div_style( $pParamHash ) { return $ret; } +function liberty_content_load_sql() { + global $gBitSystem, $gBitUser; + $ret = array(); + if ($gBitSystem->isFeatureActive('liberty_display_status') && !$gBitUser->hasPermission('p_liberty_edit_all_status')) { + $ret['where_sql'] = " AND lc.`content_status_id` < 100 AND ( (lc.`user_id` = '".$gBitUser->getUserId()."' AND lc.`content_status_id` > -100) OR lc.`content_status_id` > 0 )"; + } + // Make sure owner comes out properly for all content + if ($gBitSystem->isFeatureActive('liberty_allow_change_owner') && $gBitUser->hasPermission('p_liberty_edit_content_owner')) { + $ret['select_sql'] = " , lc.`user_id` AS owner_id"; + } + return $ret; +} + +function liberty_content_list_sql() { + global $gBitSystem, $gBitUser; + $ret = array(); + if ($gBitSystem->isFeatureActive('liberty_display_status') && !$gBitUser->hasPermission('p_liberty_edit_all_status')) { + $ret['where_sql'] = " AND lc.`content_status_id` < 100 AND ( (lc.`user_id` = '".$gBitUser->getUserId()."' AND lc.`content_status_id` > -100) OR lc.`content_status_id` > 0 )"; + } + return $ret; +} + +function liberty_content_preview(&$pObject) { + global $gBitSystem, $gBitUser; + if ($gBitSystem->isFeatureActive('liberty_display_status') && ($gBitUser->hasPermission('p_liberty_edit_content_status') || $gBitUser->hasPermission('p_libert_edit_all_status'))) { + $pObject->mInfo['content_status_id'] = $_REQUEST['content_status_id']; + } + if ($gBitSystem->isFeatureActive('liberty_allow_change_owner') && $gBitUser->hasPermission('p_liberty_edit_content_owner')) { + $pObject->mInfo['owner_id'] = $_REQUEST['owner_id']; + } +} + ?> |
