diff options
| author | Christian Fowler <spider@viovio.com> | 2006-09-20 23:02:43 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2006-09-20 23:02:43 +0000 |
| commit | 0062760ba3307b305e78a3627d1e93ee213643ed (patch) | |
| tree | 0127f4e0674ef69814911307dc05995ec5e87773 | |
| parent | a4caff19bdf70757e444e19b837ed160956b5fca (diff) | |
| download | liberty-0062760ba3307b305e78a3627d1e93ee213643ed.tar.gz liberty-0062760ba3307b305e78a3627d1e93ee213643ed.tar.bz2 liberty-0062760ba3307b305e78a3627d1e93ee213643ed.zip | |
first pass at http://www.bitweaver.org/wiki/Liberty+Content+Status - basics are in place, and work. Need to get proper permissioning sorted out so only those permed can set the highest/lowest statuses
| -rw-r--r-- | LibertyContent.php | 8 | ||||
| -rwxr-xr-x | LibertySystem.php | 9 | ||||
| -rw-r--r-- | admin/schema_inc.php | 7 | ||||
| -rw-r--r-- | admin/upgrade_inc.php | 24 |
4 files changed, 35 insertions, 13 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index 8f2ee7b..9317748 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.154 2006/09/20 15:00:50 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.155 2006/09/20 23:02:43 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -33,6 +33,10 @@ define( 'BIT_CONTENT_MAX_LANGUAGE_LEN', 4); define( 'BIT_CONTENT_MAX_IP_LEN', 39); define( 'BIT_CONTENT_MAX_FORMAT_GUID_LEN', 16); +if( !defined( 'BIT_CONTENT_DEFAULT_STATUS' ) ) { + define( 'BIT_CONTENT_DEFAULT_STATUS', 50); +} + /** * required setup */ @@ -154,6 +158,8 @@ class LibertyContent extends LibertyBase { } } + $pParamHash['content_store']['content_status_id'] = (@BitBase::verifyId( $_REQUEST['content_status_id'] ) ? $_REQUEST['content_status_id'] : $gBitSystem->getConfig( 'liberty_default_status', BIT_CONTENT_DEFAULT_STATUS )); + $pParamHash['field_changed'] = empty( $pParamHash['content_id'] ) || (!empty($this->mInfo["data"]) && !empty($pParamHash["edit"]) && (md5($this->mInfo["data"]) != md5($pParamHash["edit"]))) || (!empty($pParamHash["title"]) && !empty($this->mInfo["title"]) && (md5($this->mInfo["title"]) != md5($pParamHash["title"]))); diff --git a/LibertySystem.php b/LibertySystem.php index d07775d..e0d852d 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.45 2006/09/11 18:59:48 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.46 2006/09/20 23:02:43 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -70,6 +70,9 @@ class LibertySystem extends LibertyBase { // Liberty data tags var $mDataTags; + // Content Status + var $mContentStatus; + // Content types var $mContentTypes; @@ -276,6 +279,10 @@ class LibertySystem extends LibertyBase { return $ret; } + function getContentStatus() { + return( $this->mDb->getAssoc( "SELECT `content_status_id`,`content_status_name` FROM `".BIT_DB_PREFIX."liberty_content_status`" ) ); + } + // ****************************** Content Type Functions /** * Load all available content types into $this->mContentTypes diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 5ced0b1..90f7aa9 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -12,6 +12,11 @@ $tables = array( handler_file C(128) ", +'liberty_content_status' => " + content_status_id I4 PRIMARY KEY, + content_status_name C(128) NOTNULL +", + 'liberty_content' => " content_id I4 PRIMARY, user_id I4 NOTNULL, @@ -27,6 +32,7 @@ $tables = array( ip C(39), data X CONSTRAINT ' + , CONSTRAINT `liberty_content_status_ref` FOREIGN KEY (`content_status_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content_status`( `content_status_id` ) , CONSTRAINT `liberty_content_type_ref` FOREIGN KEY (`content_type_guid`) REFERENCES `".BIT_DB_PREFIX."liberty_content_types`( `content_type_guid` ) ", @@ -168,6 +174,7 @@ $indices = array ( 'content_user_idx' => array( 'table' => 'liberty_content', 'cols' => 'user_id', 'opts' => NULL ), 'content_moduser_idx' => array( 'table' => 'liberty_content', 'cols' => 'modifier_user_id', 'opts' => NULL ), 'content_content_hits_idx' => array( 'table' => 'liberty_content_hits', 'cols' => 'content_id', 'opts' => NULL ), + 'content_status_idx' => array( 'table' => 'liberty_content', 'cols' => 'content_status_id', 'opts' => NULL ), 'comments_object_idx' => array( 'table' => 'liberty_comments', 'cols' => 'content_id', 'opts' => NULL ), 'comments_parent_idx' => array( 'table' => 'liberty_comments', 'cols' => 'parent_id', 'opts' => NULL ), 'attachments_hits_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'hits', 'opts' => NULL ), diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php index 8ba5576..cd3a36c 100644 --- a/admin/upgrade_inc.php +++ b/admin/upgrade_inc.php @@ -16,6 +16,18 @@ array( 'QUERY' => ), array( 'DATADICT' => array( + array( 'CREATE' => array ( + 'liberty_content_hits' => " + content_id I4 PRIMARY, + hits I4 NOTNULL DEFAULT 1, + last_hit I8 NOTNULL DEFAULT 1 + CONSTRAINTS ', CONSTRAINT `liberty_content_hits_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content`( `content_id` ) ' + ", + 'liberty_content_status' => " + content_status_id I4 PRIMARY KEY, + content_status_name C(128) NOTNULL + ", + )), array( 'RENAMETABLE' => array( 'tiki_content' => 'liberty_content', 'tiki_content_id_seq' => 'liberty_content_id_seq', @@ -36,6 +48,7 @@ array( 'DATADICT' => array( array( 'ALTER' => array( 'liberty_content' => array( 'lang_code' => array( '`lang_code`', 'VARCHAR(32)' ), + 'content_status_id' => array( '`content_status_id`', 'I4' ), ), )), array( 'ALTER' => array( @@ -50,17 +63,6 @@ array( 'DATADICT' => array( // move hits and last_hit to a new table -array( 'DATADICT' => array( - array( 'CREATE' => array ( - 'liberty_content_hits' => " - content_id I4 PRIMARY, - hits I4 NOTNULL DEFAULT 1, - last_hit I8 NOTNULL DEFAULT 1 - CONSTRAINTS ', CONSTRAINT `liberty_content_hits_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content`( `content_id` ) ' - ", - )), -)), - array( 'QUERY' => array( 'SQL92' => array( "INSERT INTO `".BIT_DB_PREFIX."liberty_content_hits` ( content_id, hits, last_hit ) |
