add phpDoc comment in document module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10788 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-06-25 01:47:26 +00:00
parent d8eeb2154d
commit 53e61bb7f0
8 changed files with 816 additions and 396 deletions

View file

@ -1,21 +1,24 @@
<?php <?php
/** /**
* @class documentAdminController * documentAdminController class
* @author NHN (developers@xpressengine.com) * Document the module's admin controller class
* @brief document the module's admin controller class *
**/ * @author NHN (developers@xpressengine.com)
* @package /modules/document
* @version 0.1
*/
class documentAdminController extends document { class documentAdminController extends document {
/**
/** * Initialization
* @brief Initialization * @return void
**/ */
function init() { function init() {
} }
/** /**
* @brief Remove the selected docs from admin page * Remove the selected docs from admin page
**/ * @return void
*/
function procDocumentAdminDeleteChecked() { function procDocumentAdminDeleteChecked() {
// error appears if no doc is selected // error appears if no doc is selected
$cart = Context::get('cart'); $cart = Context::get('cart');
@ -35,9 +38,13 @@
$this->setMessage( sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) ); $this->setMessage( sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) );
} }
/** /**
* @brief change the module to move a specific article * Change the module to move a specific article
**/ * @param array $document_srl_list
* @param int $module_srl
* @param int $category_srl
* @return Object
*/
function moveDocumentModule($document_srl_list, $module_srl, $category_srl) { function moveDocumentModule($document_srl_list, $module_srl, $category_srl) {
if(!count($document_srl_list)) return; if(!count($document_srl_list)) return;
@ -169,9 +176,13 @@
return new Object(); return new Object();
} }
/** /**
* @brief Copy the post * Copy the post
**/ * @param array $document_srl_list
* @param int $module_srl
* @param int $category_srl
* @return object
*/
function copyDocumentModule($document_srl_list, $module_srl, $category_srl) { function copyDocumentModule($document_srl_list, $module_srl, $category_srl) {
if(!count($document_srl_list)) return; if(!count($document_srl_list)) return;
@ -363,9 +374,11 @@
return $output; return $output;
} }
/** /**
* @brief Delete all documents of the module * Delete all documents of the module
**/ * @param int $module_srl
* @return object
*/
function deleteModuleDocument($module_srl) { function deleteModuleDocument($module_srl) {
$args->module_srl = $module_srl; $args->module_srl = $module_srl;
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
@ -395,9 +408,10 @@
return $output; return $output;
} }
/** /**
* @brief Save the default settings of the document module * Save the default settings of the document module
**/ * @return object
*/
function procDocumentAdminInsertConfig() { function procDocumentAdminInsertConfig() {
// Get the basic information // Get the basic information
$config = Context::gets('thumbnail_type'); $config = Context::gets('thumbnail_type');
@ -413,9 +427,10 @@
return $output; return $output;
} }
/** /**
* @brief Revoke declaration of the blacklisted posts * Revoke declaration of the blacklisted posts
**/ * @return object
*/
function procDocumentAdminCancelDeclare() { function procDocumentAdminCancelDeclare() {
$document_srl = trim(Context::get('document_srl')); $document_srl = trim(Context::get('document_srl'));
@ -426,9 +441,10 @@
} }
} }
/** /**
* @brief Delete all thumbnails * Delete all thumbnails
**/ * @return void
*/
function procDocumentAdminDeleteAllThumbnail() { function procDocumentAdminDeleteAllThumbnail() {
// delete all of thumbnail_ *. jpg files from files/attaches/images/ directory (prior versions to 1.0.4) // delete all of thumbnail_ *. jpg files from files/attaches/images/ directory (prior versions to 1.0.4)
$this->deleteThumbnailFile('./files/attach/images'); $this->deleteThumbnailFile('./files/attach/images');
@ -438,6 +454,10 @@
$this->setMessage('success_deleted'); $this->setMessage('success_deleted');
} }
/**
* Delete thumbnails with subdirectory
* @return void
*/
function deleteThumbnailFile($path) { function deleteThumbnailFile($path) {
$directory = dir($path); $directory = dir($path);
while($entry = $directory->read()) { while($entry = $directory->read()) {
@ -453,9 +473,10 @@
$directory->close(); $directory->close();
} }
/** /**
* @brief Add or modify extra variables of the module * Add or modify extra variables of the module
**/ * @return void|object
*/
function procDocumentAdminInsertExtraVar() { function procDocumentAdminInsertExtraVar() {
$module_srl = Context::get('module_srl'); $module_srl = Context::get('module_srl');
$var_idx = Context::get('var_idx'); $var_idx = Context::get('var_idx');
@ -497,9 +518,10 @@
} }
} }
/** /**
* @brief delete extra variables of the module * Delete extra variables of the module
**/ * @return void|object
*/
function procDocumentAdminDeleteExtraVar() { function procDocumentAdminDeleteExtraVar() {
$module_srl = Context::get('module_srl'); $module_srl = Context::get('module_srl');
$var_idx = Context::get('var_idx'); $var_idx = Context::get('var_idx');
@ -512,9 +534,10 @@
$this->setMessage('success_deleted'); $this->setMessage('success_deleted');
} }
/** /**
* @brief control the order of extra variables * Control the order of extra variables
**/ * @return void|object
*/
function procDocumentAdminMoveExtraVar() { function procDocumentAdminMoveExtraVar() {
$type = Context::get('type'); $type = Context::get('type');
$module_srl = Context::get('module_srl'); $module_srl = Context::get('module_srl');
@ -576,6 +599,10 @@
} }
} }
/**
* Insert alias for document
* @return void|object
*/
function procDocumentAdminInsertAlias() { function procDocumentAdminInsertAlias() {
$args = Context::gets('module_srl','document_srl', 'alias_title'); $args = Context::gets('module_srl','document_srl', 'alias_title');
$alias_srl = Context::get('alias_srl'); $alias_srl = Context::get('alias_srl');
@ -599,6 +626,10 @@
return $output; return $output;
} }
/**
* Delete alias for document
* @return void|object
*/
function procDocumentAdminDeleteAlias() { function procDocumentAdminDeleteAlias() {
$document_srl = Context::get('document_srl'); $document_srl = Context::get('document_srl');
$alias_srl = Context::get('target_srl'); $alias_srl = Context::get('target_srl');
@ -613,6 +644,10 @@
return $output; return $output;
} }
/**
* Restor document from trash
* @return void|object
*/
function procDocumentAdminRestoreTrash() { function procDocumentAdminRestoreTrash() {
$trash_srl = Context::get('trash_srl'); $trash_srl = Context::get('trash_srl');
$this->restoreTrash($trash_srl); $this->restoreTrash($trash_srl);
@ -671,10 +706,12 @@
return $output; return $output;
}*/ }*/
/** /**
* @brief restore document from trash module, called by trash module * Restore document from trash module, called by trash module
* this method is passived * This method is passived
**/ * @param object|array $originObject
* @return object
*/
function restoreTrash($originObject) function restoreTrash($originObject)
{ {
if(is_array($originObject)) $originObject = (object)$originObject; if(is_array($originObject)) $originObject = (object)$originObject;
@ -712,10 +749,12 @@
return new Object(0, 'success'); return new Object(0, 'success');
} }
/** /**
* @brief empty document in trash, called by trash module * Empty document in trash, called by trash module
* this method is passived * This method is passived
**/ * @param string $originObject string is serialized object
* @return object
*/
function emptyTrash($originObject) function emptyTrash($originObject)
{ {
$originObject = unserialize($originObject); $originObject = unserialize($originObject);

View file

@ -1,22 +1,25 @@
<?php <?php
/** /**
* @class documentAdminModel * documentAdminModel class
* @author NHN (developers@xpressengine.com) * Document the module's admin model class
* @version 0.1 *
* @brief document the module's admin model class * @author NHN (developers@xpressengine.com)
**/ * @package /modules/document
* @version 0.1
*/
class documentAdminModel extends document { class documentAdminModel extends document {
/**
/** * Initialization
* @brief Initialization * @return void
**/ */
function init() { function init() {
} }
/** /**
* @brief get a document list from the trash * Get a document list from the trash
**/ * @param object $obj
* @return object
*/
function getDocumentTrashList($obj) { function getDocumentTrashList($obj) {
// check a list and its order // check a list and its order
if (!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order'; if (!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order';
@ -64,9 +67,11 @@
return $output; return $output;
} }
/** /**
* @brief get the doc which has trash_srl from the trash can * Get the doc which has trash_srl from the trash can
**/ * @param int $trash_srl
* @return object
*/
function getDocumentTrash($trash_srl) { function getDocumentTrash($trash_srl) {
$args->trash_srl = $trash_srl; $args->trash_srl = $trash_srl;
$output = executeQuery('document.getTrash', $args); $output = executeQuery('document.getTrash', $args);
@ -77,9 +82,13 @@
return $node; return $node;
} }
/** /**
* @brief Return document count with date * Return document count with date
**/ * @param string $date
* @parpam array $moduleSrlList
* @param array $statusList
* @return int
*/
function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array()) { function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array()) {
if($date) $args->regDate = date('Ymd', strtotime($date)); if($date) $args->regDate = date('Ymd', strtotime($date));
if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList; if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList;

View file

@ -1,14 +1,17 @@
<?php <?php
/** /**
* @class documentAdminView * documentAdminView class
* @author NHN (developers@xpressengine.com) * Document admin view of the module class
* @brief document admin view of the module class *
**/ * @author NHN (developers@xpressengine.com)
* @package /modules/document
* @version 0.1
*/
class documentAdminView extends document { class documentAdminView extends document {
/** /**
* @brief Initialization * Initialization
**/ * @return void
*/
function init() { function init() {
// check current location in admin menu // check current location in admin menu
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
@ -23,9 +26,10 @@
} }
} }
/** /**
* @brief Display a list(administrative) * Display a list(administrative)
**/ * @return void
*/
function dispDocumentAdminList() { function dispDocumentAdminList() {
// option to get a list // option to get a list
$args->page = Context::get('page'); // /< Page $args->page = Context::get('page'); // /< Page
@ -67,9 +71,10 @@
$this->setTemplateFile('document_list'); $this->setTemplateFile('document_list');
} }
/** /**
* @brief Set a document module * Set a document module
**/ * @return void
*/
function dispDocumentAdminConfig() { function dispDocumentAdminConfig() {
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
$config = $oDocumentModel->getDocumentConfig(); $config = $oDocumentModel->getDocumentConfig();
@ -80,9 +85,10 @@
$this->setTemplateFile('document_config'); $this->setTemplateFile('document_config');
} }
/** /**
* @brief display a report list on the admin page * Display a report list on the admin page
**/ * @return void
*/
function dispDocumentAdminDeclared() { function dispDocumentAdminDeclared() {
// option for a list // option for a list
$args->page = Context::get('page'); // /< Page $args->page = Context::get('page'); // /< Page
@ -120,6 +126,10 @@
$this->setTemplateFile('declared_list'); $this->setTemplateFile('declared_list');
} }
/**
* Display a alias list on the admin page
* @return void
*/
function dispDocumentAdminAlias() { function dispDocumentAdminAlias() {
$args->document_srl = Context::get('document_srl'); $args->document_srl = Context::get('document_srl');
if(!$args->document_srl) return $this->dispDocumentAdminList(); if(!$args->document_srl) return $this->dispDocumentAdminList();
@ -145,6 +155,10 @@
$this->setTemplateFile('document_alias'); $this->setTemplateFile('document_alias');
} }
/**
* Display a trash list on the admin page
* @return void
*/
function dispDocumentAdminTrashList() { function dispDocumentAdminTrashList() {
// options for a list // options for a list
$args->page = Context::get('page'); // /< Page $args->page = Context::get('page'); // /< Page

View file

@ -2,19 +2,30 @@
require_once(_XE_PATH_.'modules/document/document.item.php'); require_once(_XE_PATH_.'modules/document/document.item.php');
/** /**
* @class document * document class
* @author NHN (developers@xpressengine.com)
* @brief document the module's high class * @brief document the module's high class
* {@internal Silently adds one extra Foo to compensate for lack of Foo } * {@internal Silently adds one extra Foo to compensate for lack of Foo }
*
* @author NHN (developers@xpressengine.com)
* @package /modules/document
* @version 0.1
*/ */
class document extends ModuleObject class document extends ModuleObject
{ {
// search option to use in admin page /**
* Search option to use in admin page
* @var array
*/
var $search_option = array('title','content','title_content','user_name',); // /< Search options var $search_option = array('title','content','title_content','user_name',); // /< Search options
/**
* Status list
* @var array
*/
var $statusList = array('private'=>'PRIVATE', 'public'=>'PUBLIC', 'secret'=>'SECRET', 'temp'=>'TEMP'); var $statusList = array('private'=>'PRIVATE', 'public'=>'PUBLIC', 'secret'=>'SECRET', 'temp'=>'TEMP');
/** /**
* @brief Implement if additional tasks are necessary when installing * Implement if additional tasks are necessary when installing
* @return Object
*/ */
function moduleInstall() function moduleInstall()
{ {
@ -41,20 +52,17 @@ class document extends ModuleObject
} }
/** /**
* @brief a method to check if successfully installed * A method to check if successfully installed
**/ * @return bool
*/
function checkUpdate() { function checkUpdate() {
$oDB = &DB::getInstance(); $oDB = &DB::getInstance();
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
/** // 2007. 7. 25: Add a column(notify_message) for notification
* 2007. 7. 25: Add a column(notify_message) for notification
**/
if(!$oDB->isColumnExists("documents","notify_message")) return true; if(!$oDB->isColumnExists("documents","notify_message")) return true;
/** // 2007. 8. 23: create a clustered index in the document table
* 2007. 8. 23: create a clustered index in the document table
**/
if(!$oDB->isIndexExists("documents","idx_module_list_order")) return true; if(!$oDB->isIndexExists("documents","idx_module_list_order")) return true;
if(!$oDB->isIndexExists("documents","idx_module_update_order")) return true; if(!$oDB->isIndexExists("documents","idx_module_update_order")) return true;
if(!$oDB->isIndexExists("documents","idx_module_readed_count")) return true; if(!$oDB->isIndexExists("documents","idx_module_readed_count")) return true;
@ -70,9 +78,7 @@ class document extends ModuleObject
// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian)) // 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
if(!$oDB->isIndexExists("documents","idx_module_document_srl")) return true; if(!$oDB->isIndexExists("documents","idx_module_document_srl")) return true;
/** // 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
* 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
**/
if(!$oDB->isColumnExists("documents","extra_vars")) return true; if(!$oDB->isColumnExists("documents","extra_vars")) return true;
// 2008. 04. 23 Add a column(blamed_count) // 2008. 04. 23 Add a column(blamed_count)
if(!$oDB->isColumnExists("documents", "blamed_count")) return true; if(!$oDB->isColumnExists("documents", "blamed_count")) return true;
@ -83,7 +89,7 @@ class document extends ModuleObject
/** /**
* 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table * 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
**/ */
if(!$oDB->isColumnExists("document_extra_vars","lang_code")) return true; if(!$oDB->isColumnExists("document_extra_vars","lang_code")) return true;
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true; if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true;
@ -92,9 +98,7 @@ class document extends ModuleObject
// 2009. 03. 11 check the index in the document_extra_vars table // 2009. 03. 11 check the index in the document_extra_vars table
if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true; if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true;
/** // 2009. 03. 19: Add a column(eid) if not exist in the table
* 2009. 03. 19: Add a column(eid) if not exist in the table
**/
if(!$oDB->isColumnExists("document_extra_keys","eid")) return true; if(!$oDB->isColumnExists("document_extra_keys","eid")) return true;
if(!$oDB->isColumnExists("document_extra_vars","eid")) return true; if(!$oDB->isColumnExists("document_extra_vars","eid")) return true;
@ -120,23 +124,20 @@ class document extends ModuleObject
} }
/** /**
* @brief Execute update * Execute update
**/ * @return Object
*/
function moduleUpdate() { function moduleUpdate() {
$oDB = &DB::getInstance(); $oDB = &DB::getInstance();
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
$oModuleController = &getController('module'); $oModuleController = &getController('module');
/** // 2007. 7. 25: Add a column(notify_message) for notification
* 2007. 7. 25: Add a column(notify_message) for notification
**/
if(!$oDB->isColumnExists("documents","notify_message")) { if(!$oDB->isColumnExists("documents","notify_message")) {
$oDB->addColumn('documents',"notify_message","char",1); $oDB->addColumn('documents',"notify_message","char",1);
} }
/** // 2007. 8. 23: create a clustered index in the document table
* 2007. 8. 23: create a clustered index in the document table
**/
if(!$oDB->isIndexExists("documents","idx_module_list_order")) { if(!$oDB->isIndexExists("documents","idx_module_list_order")) {
$oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order")); $oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order"));
} }
@ -162,14 +163,10 @@ class document extends ModuleObject
// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice) // 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
if(!$oDB->isIndexExists("documents","idx_module_notice")) $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice")); if(!$oDB->isIndexExists("documents","idx_module_notice")) $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice"));
/** // 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
* 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
**/
if(!$oDB->isColumnExists("documents","extra_vars")) $oDB->addColumn('documents','extra_vars','text'); if(!$oDB->isColumnExists("documents","extra_vars")) $oDB->addColumn('documents','extra_vars','text');
/** // 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
* 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
**/
if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl")); if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
// 2008. 04. 23 Add a column(blamed count) // 2008. 04. 23 Add a column(blamed count)
if(!$oDB->isColumnExists("documents", "blamed_count")) { if(!$oDB->isColumnExists("documents", "blamed_count")) {
@ -187,9 +184,7 @@ class document extends ModuleObject
if(!$oDB->isColumnExists("document_categories","color")) $oDB->addColumn('document_categories',"color","char",7); if(!$oDB->isColumnExists("document_categories","color")) $oDB->addColumn('document_categories',"color","char",7);
/** // 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
* 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
**/
if(!$oDB->isColumnExists("document_extra_vars","lang_code")) $oDB->addColumn('document_extra_vars',"lang_code","varchar",10); if(!$oDB->isColumnExists("document_extra_vars","lang_code")) $oDB->addColumn('document_extra_vars',"lang_code","varchar",10);
// 2009. 01. 29 Added a trigger for additional setup // 2009. 01. 29 Added a trigger for additional setup
@ -211,10 +206,8 @@ class document extends ModuleObject
$oDB->dropIndex("document_extra_vars", "unique_module_vars", true); $oDB->dropIndex("document_extra_vars", "unique_module_vars", true);
} }
/** // 2009. 03. 19: Add a column(eid)
* 2009. 03. 19: Add a column(eid) // 2009. 04. 12: Fixed the issue(#17922959) that changes another column values when adding eid column
* 2009. 04. 12: Fixed the issue(#17922959) that changes another column values when adding eid column
**/
if(!$oDB->isColumnExists("document_extra_keys","eid")) { if(!$oDB->isColumnExists("document_extra_keys","eid")) {
$oDB->addColumn("document_extra_keys","eid","varchar",40); $oDB->addColumn("document_extra_keys","eid","varchar",40);
@ -307,24 +300,34 @@ class document extends ModuleObject
} }
/** /**
* @brief Re-generate the cache file * Re-generate the cache file
**/ * @return void
*/
function recompileCache() { function recompileCache() {
} }
/** /**
* @brief Document Status List * Document Status List
**/ * @return array
*/
function getStatusList() function getStatusList()
{ {
return $this->statusList; return $this->statusList;
} }
/**
* Return default status
* @return string
*/
function getDefaultStatus() function getDefaultStatus()
{ {
return $this->statusList['public']; return $this->statusList['public'];
} }
/**
* Return status by key
* @return string
*/
function getConfigStatus($key) function getConfigStatus($key)
{ {
if(array_key_exists(strtolower($key), $this->statusList)) return $this->statusList[$key]; if(array_key_exists(strtolower($key), $this->statusList)) return $this->statusList[$key];

View file

@ -1,20 +1,24 @@
<?php <?php
/** /**
* @class documentController * documentController class
* document the module's controller class
*
* @author NHN (developers@xpressengine.com) * @author NHN (developers@xpressengine.com)
* @brief document the module's controller class * @package /modules/document
**/ * @version 0.1
*/
class documentController extends document { class documentController extends document {
/** /**
* @brief Initialization * Initialization
**/ * @return void
*/
function init() { function init() {
} }
/** /**
* @breif action to handle vote-up of the post (Up) * Action to handle vote-up of the post (Up)
**/ * @return Object
*/
function procDocumentVoteUp() { function procDocumentVoteUp() {
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
@ -34,6 +38,13 @@ class documentController extends document {
return $this->updateVotedCount($document_srl, $point); return $this->updateVotedCount($document_srl, $point);
} }
/**
* insert alias
* @param int $module_srl
* @param int $document_srl
* @param string $alias_title
* @return object
*/
function insertAlias($module_srl, $document_srl, $alias_title) { function insertAlias($module_srl, $document_srl, $alias_title) {
$args->alias_srl = getNextSequence(); $args->alias_srl = getNextSequence();
$args->module_srl = $module_srl; $args->module_srl = $module_srl;
@ -45,8 +56,9 @@ class documentController extends document {
} }
/** /**
* @breif action to handle vote-up of the post (Down) * Action to handle vote-up of the post (Down)
**/ * @return Object
*/
function procDocumentVoteDown() { function procDocumentVoteDown() {
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
@ -67,8 +79,9 @@ class documentController extends document {
} }
/** /**
* @brief Action called when the post is reported by other member * Action called when the post is reported by other member
**/ * @return void|Object
*/
function procDocumentDeclare() { function procDocumentDeclare() {
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
@ -78,18 +91,35 @@ class documentController extends document {
return $this->declaredDocument($document_srl); return $this->declaredDocument($document_srl);
} }
/**
* Delete alias when module deleted
* @param int $module_srl
* @return void
*/
function deleteDocumentAliasByModule($module_srl) function deleteDocumentAliasByModule($module_srl)
{ {
$args->module_srl = $module_srl; $args->module_srl = $module_srl;
executeQuery("document.deleteAlias", $args); executeQuery("document.deleteAlias", $args);
} }
/**
* Delete alias when document deleted
* @param int $document_srl
* @return void
*/
function deleteDocumentAliasByDocument($document_srl) function deleteDocumentAliasByDocument($document_srl)
{ {
$args->document_srl = $document_srl; $args->document_srl = $document_srl;
executeQuery("document.deleteAlias", $args); executeQuery("document.deleteAlias", $args);
} }
/**
* Delete document history
* @param int $history_srl
* @param int $document_srl
* @param int $module_srl
* @return void
*/
function deleteDocumentHistory($history_srl, $document_srl, $module_srl) function deleteDocumentHistory($history_srl, $document_srl, $module_srl)
{ {
$args->history_srl = $history_srl; $args->history_srl = $history_srl;
@ -100,8 +130,10 @@ class documentController extends document {
} }
/** /**
* @brief A trigger to delete all posts together when the module is deleted * A trigger to delete all posts together when the module is deleted
**/ * @param object $obj
* @return Object
*/
function triggerDeleteModuleDocuments(&$obj) { function triggerDeleteModuleDocuments(&$obj) {
$module_srl = $obj->module_srl; $module_srl = $obj->module_srl;
if(!$module_srl) return new Object(); if(!$module_srl) return new Object();
@ -126,16 +158,22 @@ class documentController extends document {
} }
/** /**
* @brief Grant a permisstion of the document * Grant a permisstion of the document
* Available in the current connection with session value * Available in the current connection with session value
**/ * @param int $document_srl
* @return void
*/
function addGrant($document_srl) { function addGrant($document_srl) {
$_SESSION['own_document'][$document_srl] = true; $_SESSION['own_document'][$document_srl] = true;
} }
/** /**
* @brief Insert the document * Insert the document
**/ * @param object $obj
* @param bool $manual_inserted
* @param bool $isRestore
* @return object
*/
function insertDocument($obj, $manual_inserted = false, $isRestore = false) { function insertDocument($obj, $manual_inserted = false, $isRestore = false) {
// begin transaction // begin transaction
$oDB = &DB::getInstance(); $oDB = &DB::getInstance();
@ -261,8 +299,11 @@ class documentController extends document {
} }
/** /**
* @brief Update the document * Update the document
**/ * @param object $source_obj
* @param object $obj
* @return object
*/
function updateDocument($source_obj, $obj) { function updateDocument($source_obj, $obj) {
if(!$source_obj->document_srl || !$obj->document_srl) return new Object(-1,'msg_invalied_request'); if(!$source_obj->document_srl || !$obj->document_srl) return new Object(-1,'msg_invalied_request');
if(!$obj->status && $obj->is_secret == 'Y') $obj->status = 'SECRET'; if(!$obj->status && $obj->is_secret == 'Y') $obj->status = 'SECRET';
@ -435,8 +476,13 @@ class documentController extends document {
} }
/** /**
* @brief Deleting Documents * Deleting Documents
**/ * @param int $document_srl
* @param bool $is_admin
* @param bool $isEmptyTrash
* @param documentItem $oDocument
* @return object
*/
function deleteDocument($document_srl, $is_admin = false, $isEmptyTrash = false, $oDocument = null) { function deleteDocument($document_srl, $is_admin = false, $isEmptyTrash = false, $oDocument = null) {
// Call a trigger (before) // Call a trigger (before)
$trigger_obj->document_srl = $document_srl; $trigger_obj->document_srl = $document_srl;
@ -518,10 +564,10 @@ class documentController extends document {
} }
/** /**
* @brief delete declared document, log * Delete declared document, log
* @param $documentSrls : srls string (ex: 1, 2,56, 88) * @param string $documentSrls (ex: 1, 2,56, 88)
* @return void * @return void
**/ */
function _deleteDeclaredDocuments($documentSrls) function _deleteDeclaredDocuments($documentSrls)
{ {
executeQuery('document.deleteDeclaredDocuments', $documentSrls); executeQuery('document.deleteDeclaredDocuments', $documentSrls);
@ -529,28 +575,30 @@ class documentController extends document {
} }
/** /**
* @brief delete readed log * Delete readed log
* @param $documentSrls : srls string (ex: 1, 2,56, 88) * @param string $documentSrls (ex: 1, 2,56, 88)
* @return void * @return void
**/ */
function _deleteDocumentReadedLog($documentSrls) function _deleteDocumentReadedLog($documentSrls)
{ {
executeQuery('document.deleteDocumentReadedLog', $documentSrls); executeQuery('document.deleteDocumentReadedLog', $documentSrls);
} }
/** /**
* @brief delete voted log * Delete voted log
* @param $documentSrls : srls string (ex: 1, 2,56, 88) * @param string $documentSrls (ex: 1, 2,56, 88)
* @return void * @return void
**/ */
function _deleteDocumentVotedLog($documentSrls) function _deleteDocumentVotedLog($documentSrls)
{ {
executeQuery('document.deleteDocumentVotedLog', $documentSrls); executeQuery('document.deleteDocumentVotedLog', $documentSrls);
} }
/** /**
* @brief Move the doc into the trash * Move the doc into the trash
**/ * @param object $obj
* @return object
*/
function moveDocumentToTrash($obj) { function moveDocumentToTrash($obj) {
// Get trash_srl if a given trash_srl doesn't exist // Get trash_srl if a given trash_srl doesn't exist
if(!$obj->trash_srl) $trash_args->trash_srl = getNextSequence(); if(!$obj->trash_srl) $trash_args->trash_srl = getNextSequence();
@ -650,8 +698,10 @@ class documentController extends document {
} }
/** /**
* @brief Update read counts of the document * Update read counts of the document
**/ * @param documentItem $oDocument
* @return bool|void
*/
function updateReadedCount(&$oDocument) { function updateReadedCount(&$oDocument) {
$document_srl = $oDocument->document_srl; $document_srl = $oDocument->document_srl;
$member_srl = $oDocument->get('member_srl'); $member_srl = $oDocument->get('member_srl');
@ -680,8 +730,18 @@ class documentController extends document {
} }
/** /**
* @breif Insert extra variables into the document table * Insert extra variables into the document table
**/ * @param int $module_srl
* @param int $var_idx
* @param string $var_name
* @param string $var_type
* @param string $var_is_required
* @param string $var_search
* @param string $var_default
* @param string $var_desc
* @param int $eid
* @return object
*/
function insertDocumentExtraKey($module_srl, $var_idx, $var_name, $var_type, $var_is_required = 'N', $var_search = 'N', $var_default = '', $var_desc = '', $eid) { function insertDocumentExtraKey($module_srl, $var_idx, $var_name, $var_type, $var_is_required = 'N', $var_search = 'N', $var_default = '', $var_desc = '', $eid) {
if(!$module_srl || !$var_idx || !$var_name || !$var_type || !$eid) return new Object(-1,'msg_invalid_request'); if(!$module_srl || !$var_idx || !$var_name || !$var_type || !$eid) return new Object(-1,'msg_invalid_request');
@ -705,8 +765,11 @@ class documentController extends document {
} }
/** /**
* @brief Remove the extra variables of the documents * Remove the extra variables of the documents
**/ * @param int $module_srl
* @param int $var_idx
* @return Object
*/
function deleteDocumentExtraKeys($module_srl, $var_idx = null) { function deleteDocumentExtraKeys($module_srl, $var_idx = null) {
if(!$module_srl) return new Object(-1,'msg_invalid_request'); if(!$module_srl) return new Object(-1,'msg_invalid_request');
$obj->module_srl = $module_srl; $obj->module_srl = $module_srl;
@ -755,8 +818,15 @@ class documentController extends document {
} }
/** /**
* @breif Insert extra vaiable to the documents table * Insert extra vaiable to the documents table
**/ * @param int $module_srl
* @param int $document_srl
* @param int $var_idx
* @param mixed $value
* @param int $eid
* @param string $lang_code
* @return Object|void
*/
function insertDocumentExtraVar($module_srl, $document_srl, $var_idx, $value, $eid = null, $lang_code = '') { function insertDocumentExtraVar($module_srl, $document_srl, $var_idx, $value, $eid = null, $lang_code = '') {
if(!$module_srl || !$document_srl || !$var_idx || !isset($value)) return new Object(-1,'msg_invalid_request'); if(!$module_srl || !$document_srl || !$var_idx || !isset($value)) return new Object(-1,'msg_invalid_request');
if(!$lang_code) $lang_code = Context::getLangType(); if(!$lang_code) $lang_code = Context::getLangType();
@ -772,8 +842,14 @@ class documentController extends document {
} }
/** /**
* @brief Remove values of extra variable from the document * Remove values of extra variable from the document
**/ * @param int $module_srl
* @param int $document_srl
* @param int $var_idx
* @param string $lang_code
* @param int $eid
* @return $output
*/
function deleteDocumentExtraVars($module_srl, $document_srl = null, $var_idx = null, $lang_code = null, $eid = null) { function deleteDocumentExtraVars($module_srl, $document_srl = null, $var_idx = null, $lang_code = null, $eid = null) {
$obj->module_srl = $module_srl; $obj->module_srl = $module_srl;
if(!is_null($document_srl)) $obj->document_srl = $document_srl; if(!is_null($document_srl)) $obj->document_srl = $document_srl;
@ -786,8 +862,11 @@ class documentController extends document {
/** /**
* @brief Increase the number of vote-up of the document * Increase the number of vote-up of the document
**/ * @param int $document_srl
* @param int $point
* @return Object
*/
function updateVotedCount($document_srl, $point = 1) { function updateVotedCount($document_srl, $point = 1) {
if($point > 0) $failed_voted = 'failed_voted'; if($point > 0) $failed_voted = 'failed_voted';
else $failed_voted = 'failed_blamed'; else $failed_voted = 'failed_blamed';
@ -865,8 +944,10 @@ class documentController extends document {
} }
/** /**
* @brief Report posts * Report posts
**/ * @param int $document_srl
* @return void|Object
*/
function declaredDocument($document_srl) { function declaredDocument($document_srl) {
// Fail if session information already has a reported document // Fail if session information already has a reported document
if($_SESSION['declared_document'][$document_srl]) return new Object(-1, 'failed_declared'); if($_SESSION['declared_document'][$document_srl]) return new Object(-1, 'failed_declared');
@ -920,9 +1001,14 @@ class documentController extends document {
} }
/** /**
* @brief Increase the number of comments in the document * Increase the number of comments in the document
* Update modified date, modifier, and order with increasing comment count * Update modified date, modifier, and order with increasing comment count
**/ * @param int $document_srl
* @param int $comment_count
* @param string $last_updater
* @param bool $comment_inserted
* @return object
*/
function updateCommentCount($document_srl, $comment_count, $last_updater, $comment_inserted = false) { function updateCommentCount($document_srl, $comment_count, $last_updater, $comment_inserted = false) {
$args->document_srl = $document_srl; $args->document_srl = $document_srl;
$args->comment_count = $comment_count; $args->comment_count = $comment_count;
@ -948,8 +1034,11 @@ class documentController extends document {
} }
/** /**
* @brief Increase trackback count of the document * Increase trackback count of the document
**/ * @param int $document_srl
* @param int $trackback_count
* @return object
*/
function updateTrackbackCount($document_srl, $trackback_count) { function updateTrackbackCount($document_srl, $trackback_count) {
$args->document_srl = $document_srl; $args->document_srl = $document_srl;
$args->trackback_count = $trackback_count; $args->trackback_count = $trackback_count;
@ -958,8 +1047,10 @@ class documentController extends document {
} }
/** /**
* @brief Add a category * Add a category
**/ * @param object $obj
* @return object
*/
function insertCategory($obj) { function insertCategory($obj) {
// Sort the order to display if a child category is added // Sort the order to display if a child category is added
if($obj->parent_srl) { if($obj->parent_srl) {
@ -983,8 +1074,11 @@ class documentController extends document {
} }
/** /**
* @brief Increase list_count from a specific category * Increase list_count from a specific category
**/ * @param int $module_srl
* @param int $list_order
* @return object
*/
function updateCategoryListOrder($module_srl, $list_order) { function updateCategoryListOrder($module_srl, $list_order) {
$args->module_srl = $module_srl; $args->module_srl = $module_srl;
$args->list_order = $list_order; $args->list_order = $list_order;
@ -992,8 +1086,12 @@ class documentController extends document {
} }
/** /**
* @brief Update document_count in the category. * Update document_count in the category.
**/ * @param int $module_srl
* @param int $category_srl
* @param int $document_count
* @return object
*/
function updateCategoryCount($module_srl, $category_srl, $document_count = 0) { function updateCategoryCount($module_srl, $category_srl, $document_count = 0) {
// Create a document model object // Create a document model object
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
@ -1008,8 +1106,10 @@ class documentController extends document {
} }
/** /**
* @brief Update category information * Update category information
**/ * @param object $obj
* @return object
*/
function updateCategory($obj) { function updateCategory($obj) {
$output = executeQuery('document.updateCategory', $obj); $output = executeQuery('document.updateCategory', $obj);
if($output->toBool()) $this->makeCategoryFile($obj->module_srl); if($output->toBool()) $this->makeCategoryFile($obj->module_srl);
@ -1017,9 +1117,10 @@ class documentController extends document {
} }
/** /**
/** * Delete a category
* @brief Delete a category * @param int $category_srl
**/ * @return object
*/
function deleteCategory($category_srl) { function deleteCategory($category_srl) {
$args->category_srl = $category_srl; $args->category_srl = $category_srl;
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
@ -1044,8 +1145,10 @@ class documentController extends document {
} }
/** /**
* @brief Delete all categories in a module * Delete all categories in a module
**/ * @param int $module_srl
* @return object
*/
function deleteModuleCategory($module_srl) { function deleteModuleCategory($module_srl) {
$args->module_srl = $module_srl; $args->module_srl = $module_srl;
$output = executeQuery('document.deleteModuleCategory', $args); $output = executeQuery('document.deleteModuleCategory', $args);
@ -1053,8 +1156,10 @@ class documentController extends document {
} }
/** /**
* @brief Move the category level to higher * Move the category level to higher
**/ * @param int $category_srl
* @return Object
*/
function moveCategoryUp($category_srl) { function moveCategoryUp($category_srl) {
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
// Get information of the selected category // Get information of the selected category
@ -1093,8 +1198,10 @@ class documentController extends document {
} }
/** /**
* @brief Move the category down * Move the category down
**/ * @param int $category_srl
* @return Object
*/
function moveCategoryDown($category_srl) { function moveCategoryDown($category_srl) {
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
// Get information of the selected category // Get information of the selected category
@ -1131,8 +1238,10 @@ class documentController extends document {
} }
/** /**
* @brief Add javascript codes into the header by checking values of document_extra_keys type, required and others * Add javascript codes into the header by checking values of document_extra_keys type, required and others
**/ * @param int $module_srl
* @return void
*/
function addXmlJsFilter($module_srl) { function addXmlJsFilter($module_srl) {
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
$extra_keys = $oDocumentModel->getExtraKeys($module_srl); $extra_keys = $oDocumentModel->getExtraKeys($module_srl);
@ -1159,8 +1268,10 @@ class documentController extends document {
} }
/** /**
* @brief Add a category * Add a category
**/ * @param object $args
* @return void
*/
function procDocumentInsertCategory($args = null) { function procDocumentInsertCategory($args = null) {
// List variables // List variables
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','category_title','category_description','expand','group_srls','category_color','mid'); if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','category_title','category_description','expand','group_srls','category_color','mid');
@ -1226,7 +1337,10 @@ class documentController extends document {
} }
} }
/**
* Move a category
* @return void
*/
function procDocumentMoveCategory() { function procDocumentMoveCategory() {
$source_category_srl = Context::get('source_srl'); $source_category_srl = Context::get('source_srl');
// If parent_srl exists, be the first child // If parent_srl exists, be the first child
@ -1284,8 +1398,9 @@ class documentController extends document {
} }
/** /**
* @brief Delete a category * Delete a category
**/ * @return void
*/
function procDocumentDeleteCategory() { function procDocumentDeleteCategory() {
// List variables // List variables
$args = Context::gets('module_srl','category_srl'); $args = Context::gets('module_srl','category_srl');
@ -1322,11 +1437,12 @@ class documentController extends document {
} }
/** /**
* @brief xml files updated * Xml files updated
* Occasionally the xml file is not generated after menu is configued on the admin page \n * Occasionally the xml file is not generated after menu is configued on the admin page \n
* The administrator can manually update the file in this case \n * The administrator can manually update the file in this case \n
* Although the issue is not currently reproduced, it is unnecessay to remove. * Although the issue is not currently reproduced, it is unnecessay to remove.
**/ * @return void
*/
function procDocumentMakeXmlFile() { function procDocumentMakeXmlFile() {
// Check input values // Check input values
$module_srl = Context::get('module_srl'); $module_srl = Context::get('module_srl');
@ -1343,8 +1459,10 @@ class documentController extends document {
} }
/** /**
* @brief Save the category in a cache file * Save the category in a cache file
**/ * @param int $module_srl
* @return string
*/
function makeCategoryFile($module_srl) { function makeCategoryFile($module_srl) {
// Return if there is no information you need for creating a cache file // Return if there is no information you need for creating a cache file
if(!$module_srl) return false; if(!$module_srl) return false;
@ -1451,10 +1569,15 @@ class documentController extends document {
} }
/** /**
* @brief Create the xml data recursively referring to parent_srl * Create the xml data recursively referring to parent_srl
* In the menu xml file, node tag is nested and xml doc enables the admin page to have a menu\n * In the menu xml file, node tag is nested and xml doc enables the admin page to have a menu\n
* (tree menu is implemented by reading xml file from the tree_menu.js) * (tree menu is implemented by reading xml file from the tree_menu.js)
**/ * @param array $source_node
* @param array $tree
* @param int $site_srl
* @param string $xml_header_buff
* @return string
*/
function getXmlTree($source_node, $tree, $site_srl, &$xml_header_buff) { function getXmlTree($source_node, $tree, $site_srl, &$xml_header_buff) {
if(!$source_node) return; if(!$source_node) return;
@ -1506,11 +1629,16 @@ class documentController extends document {
} }
/** /**
* @brief change sorted nodes in an array to the php code and then return * Change sorted nodes in an array to the php code and then return
* when using menu on tpl, you can directly xml data. howver you may need javascrips additionally. * When using menu on tpl, you can directly xml data. howver you may need javascrips additionally.
* therefore, you can configure the menu info directly from php cache file, not through DB. * Therefore, you can configure the menu info directly from php cache file, not through DB.
* You may include the cache in the ModuleHandler::displayContent() * You may include the cache in the ModuleHandler::displayContent()
**/ * @param array $source_node
* @param array $tree
* @param int $site_srl
* @param string $php_header_buff
* @return array
*/
function getPhpCacheCode($source_node, $tree, $site_srl, &$php_header_buff) { function getPhpCacheCode($source_node, $tree, $site_srl, &$php_header_buff) {
$output = array("buff"=>"", "category_srl_list"=>array()); $output = array("buff"=>"", "category_srl_list"=>array());
if(!$source_node) return $output; if(!$source_node) return $output;
@ -1562,8 +1690,13 @@ class documentController extends document {
} }
/** /**
* @brief A method to add a pop-up menu which appears when clicking * A method to add a pop-up menu which appears when clicking
**/ * @param string $url
* @param string $str
* @param string $icon
* @param string $target
* @return void
*/
function addDocumentPopupMenu($url, $str, $icon = '', $target = 'self') { function addDocumentPopupMenu($url, $str, $icon = '', $target = 'self') {
$document_popup_menu_list = Context::get('document_popup_menu_list'); $document_popup_menu_list = Context::get('document_popup_menu_list');
if(!is_array($document_popup_menu_list)) $document_popup_menu_list = array(); if(!is_array($document_popup_menu_list)) $document_popup_menu_list = array();
@ -1578,8 +1711,9 @@ class documentController extends document {
} }
/** /**
* @brief Saved in the session when an administrator selects a post * Saved in the session when an administrator selects a post
**/ * @return void|Object
*/
function procDocumentAddCart() { function procDocumentAddCart() {
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted'); if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
// Get document_srl // Get document_srl
@ -1636,8 +1770,9 @@ class documentController extends document {
} }
/** /**
* @brief Move/ Delete the document in the seession * Move/ Delete the document in the seession
**/ * @return void|Object
*/
function procDocumentManageCheckedDocument() { function procDocumentManageCheckedDocument() {
set_time_limit(0); set_time_limit(0);
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
@ -1746,6 +1881,10 @@ class documentController extends document {
} }
} }
/**
* Insert document module config
* @return void
*/
function procDocumentInsertModuleConfig() function procDocumentInsertModuleConfig()
{ {
$module_srl = Context::get('target_module_srl'); $module_srl = Context::get('target_module_srl');
@ -1780,8 +1919,9 @@ class documentController extends document {
} }
/** /**
* @brief * Document temporary save
**/ * @return void|Object
*/
function procDocumentTempSave() function procDocumentTempSave()
{ {
// Check login information // Check login information
@ -1830,8 +1970,9 @@ class documentController extends document {
} }
/** /**
* @brief return Document List for exec_xml * Return Document List for exec_xml
**/ * @return void|Object
*/
function procDocumentGetList() function procDocumentGetList()
{ {
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
@ -1853,8 +1994,10 @@ class documentController extends document {
} }
/** /**
* @brief for old version, comment allow status check. * For old version, comment allow status check.
**/ * @param object $obj
* @return void
*/
function _checkCommentStatusForOldVersion(&$obj) function _checkCommentStatusForOldVersion(&$obj)
{ {
if(!isset($obj->allow_comment)) $obj->allow_comment = 'N'; if(!isset($obj->allow_comment)) $obj->allow_comment = 'N';
@ -1865,8 +2008,10 @@ class documentController extends document {
} }
/** /**
* @brief for old version, document status check. * For old version, document status check.
**/ * @param object $obj
* @return void
*/
function _checkDocumentStatusForOldVersion(&$obj) function _checkDocumentStatusForOldVersion(&$obj)
{ {
if(!$obj->status && $obj->is_secret == 'Y') $obj->status = $this->getConfigStatus('secret'); if(!$obj->status && $obj->is_secret == 'Y') $obj->status = $this->getConfigStatus('secret');
@ -1874,8 +2019,10 @@ class documentController extends document {
} }
/** /**
* @brief copy extra keys when module copied * Copy extra keys when module copied
**/ * @param object $obj
* @return void
*/
function triggerCopyModuleExtraKeys(&$obj) function triggerCopyModuleExtraKeys(&$obj)
{ {
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');

View file

@ -1,21 +1,56 @@
<?php <?php
/** /**
* @class documentItem * documentItem class
* @author NHN (developers@xpressengine.com) * document object
* @brief document object *
**/ * @author NHN (developers@xpressengine.com)
* @package /modules/document
* @version 0.1
*/
class documentItem extends Object { class documentItem extends Object {
/**
* Document number
* @var int
*/
var $document_srl = 0; var $document_srl = 0;
/**
* Language code
* @var string
*/
var $lang_code = null; var $lang_code = null;
/**
* Status of allow trackback
* @var bool
*/
var $allow_trackback_status = null; var $allow_trackback_status = null;
/**
* column list
* @var array
*/
var $columnList = array(); var $columnList = array();
/**
* allow script access list
* @var array
*/
var $allowscriptaccessList = array(); var $allowscriptaccessList = array();
/**
* allow script access key
* @var int
*/
var $allowscriptaccessKey = 0; var $allowscriptaccessKey = 0;
/**
* upload file list
* @var array
*/
var $uploadedFiles = array(); var $uploadedFiles = array();
/**
* Constructor
* @param int $document_srl
* @param bool $load_extra_vars
* @param array columnList
* @return void
*/
function documentItem($document_srl = 0, $load_extra_vars = true, $columnList = array()) { function documentItem($document_srl = 0, $load_extra_vars = true, $columnList = array()) {
$this->document_srl = $document_srl; $this->document_srl = $document_srl;
$this->columnList = $columnList; $this->columnList = $columnList;
@ -28,6 +63,11 @@
$this->_loadFromDB($load_extra_vars); $this->_loadFromDB($load_extra_vars);
} }
/**
* Get data from database, and set the value to documentItem object
* @param bool $load_extra_vars
* @return void
*/
function _loadFromDB($load_extra_vars = true) { function _loadFromDB($load_extra_vars = true) {
if(!$this->document_srl) return; if(!$this->document_srl) return;
@ -170,6 +210,12 @@
return $_SESSION['document_management'][$this->document_srl]; return $_SESSION['document_management'][$this->document_srl];
} }
/**
* Send notify message to document owner
* @param string $type
* @param string $content
* @return void
*/
function notify($type, $content) { function notify($type, $content) {
if(!$this->document_srl) return; if(!$this->document_srl) return;
// return if it is not useNotify // return if it is not useNotify
@ -364,9 +410,14 @@
return $content; return $content;
} }
/** /**
* Return transformed content by Editor codes * Return transformed content by Editor codes
**/ * @param bool $add_popup_menu
* @param bool $add_content_info
* @param bool $resource_realpath
* @param bool $add_xe_content_class
* @return string
*/
function getTransContent($add_popup_menu = true, $add_content_info = true, $resource_realpath = false, $add_xe_content_class = true) { function getTransContent($add_popup_menu = true, $add_content_info = true, $resource_realpath = false, $add_xe_content_class = true) {
$oEditorController = &getController('editor'); $oEditorController = &getController('editor');
@ -451,6 +502,10 @@
return $oTrackbackModel->getTrackbackUrl($this->document_srl); return $oTrackbackModel->getTrackbackUrl($this->document_srl);
} }
/**
* Update readed count
* @return void
*/
function updateReadedCount() { function updateReadedCount() {
$oDocumentController = &getController('document'); $oDocumentController = &getController('document');
if($oDocumentController->updateReadedCount($this)) { if($oDocumentController->updateReadedCount($this)) {
@ -662,10 +717,12 @@
return; return;
} }
/** /**
* @brief Functions to display icons for new post, latest update, secret(private) post, image/video/attachment * Functions to display icons for new post, latest update, secret(private) post, image/video/attachment
* Determine new post and latest update by $time_interval * Determine new post and latest update by $time_interval
**/ * @param int $time_interval
* @return array
*/
function getExtraImages($time_interval = 43200) { function getExtraImages($time_interval = 43200) {
if(!$this->document_srl) return; if(!$this->document_srl) return;
// variables for icon list // variables for icon list
@ -715,9 +772,11 @@
return $this->get('status'); return $this->get('status');
} }
/** /**
* @brief Return the value obtained from getExtraImages with image tag * Return the value obtained from getExtraImages with image tag
**/ * @param int $time_check
* @return string
*/
function printExtraImages($time_check = 43200) { function printExtraImages($time_check = 43200) {
if(!$this->document_srl) return; if(!$this->document_srl) return;
// Get the icon directory // Get the icon directory
@ -756,9 +815,10 @@
return $this->uploadedFiles[$sortIndex]; return $this->uploadedFiles[$sortIndex];
} }
/** /**
* @brief Return Editor html * Return Editor html
**/ * @return string
*/
function getEditor() { function getEditor() {
$module_srl = $this->get('module_srl'); $module_srl = $this->get('module_srl');
if(!$module_srl) $module_srl = Context::get('module_srl'); if(!$module_srl) $module_srl = Context::get('module_srl');
@ -767,10 +827,11 @@
return $oEditorModel->getModuleEditor('document', $module_srl, $this->document_srl, 'document_srl', 'content'); return $oEditorModel->getModuleEditor('document', $module_srl, $this->document_srl, 'document_srl', 'content');
} }
/** /**
* @brief Check whether to have a permission to write comment * Check whether to have a permission to write comment
* Authority to write a comment and to write a document is separated * Authority to write a comment and to write a document is separated
**/ * @return bool
*/
function isEnableComment() { function isEnableComment() {
// Return false if not authorized, if a secret document, if the document is set not to allow any comment // Return false if not authorized, if a secret document, if the document is set not to allow any comment
if (!$this->allowComment()) return false; if (!$this->allowComment()) return false;
@ -779,9 +840,10 @@
return true; return true;
} }
/** /**
* @brief Return comment editor's html * Return comment editor's html
**/ * @return string
*/
function getCommentEditor() { function getCommentEditor() {
if(!$this->isEnableComment()) return; if(!$this->isEnableComment()) return;
@ -789,9 +851,10 @@
return $oEditorModel->getModuleEditor('comment', $this->get('module_srl'), $comment_srl, 'comment_srl', 'content'); return $oEditorModel->getModuleEditor('comment', $this->get('module_srl'), $comment_srl, 'comment_srl', 'content');
} }
/** /**
* @brief Return author's profile image * Return author's profile image
**/ * @return string
*/
function getProfileImage() { function getProfileImage() {
if(!$this->isExists() || !$this->get('member_srl')) return; if(!$this->isExists() || !$this->get('member_srl')) return;
$oMemberModel = &getModel('member'); $oMemberModel = &getModel('member');
@ -801,9 +864,10 @@
return $profile_info->src; return $profile_info->src;
} }
/** /**
* @brief Return author's signiture * Return author's signiture
**/ * @return string
*/
function getSignature() { function getSignature() {
// Pass if a document doesn't exist // Pass if a document doesn't exist
if(!$this->isExists() || !$this->get('member_srl')) return; if(!$this->isExists() || !$this->get('member_srl')) return;
@ -824,13 +888,20 @@
return $signature; return $signature;
} }
/** /**
* @brief Change an image path in the content to absolute path * Change an image path in the content to absolute path
**/ * @param array $matches
* @return mixed
*/
function replaceResourceRealPath($matches) { function replaceResourceRealPath($matches) {
return preg_replace('/src=(["\']?)files/i','src=$1'.Context::getRequestUri().'files', $matches[0]); return preg_replace('/src=(["\']?)files/i','src=$1'.Context::getRequestUri().'files', $matches[0]);
} }
/**
* Check accessible by document status
* @param array $matches
* @return mixed
*/
function _checkAccessibleFromStatus() function _checkAccessibleFromStatus()
{ {
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
@ -872,7 +943,8 @@
/** /**
* @brief Returns the document's mid in order to construct SEO friendly URLs * Returns the document's mid in order to construct SEO friendly URLs
* @return string
*/ */
function getDocumentMid() { function getDocumentMid() {
$model = &getModel('module'); $model = &getModel('module');
@ -881,7 +953,8 @@
} }
/** /**
* @brief Returns the document's type (document/page/wiki/board/etc) * Returns the document's type (document/page/wiki/board/etc)
* @return string
*/ */
function getDocumentType() { function getDocumentType() {
$model = &getModel('module'); $model = &getModel('module');
@ -890,7 +963,8 @@
} }
/** /**
* @brief Returns the document's alias * Returns the document's alias
* @return string
*/ */
function getDocumentAlias() { function getDocumentAlias() {
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
@ -898,7 +972,8 @@
} }
/** /**
* @brief Returns the document's actual title (browser_title) * Returns the document's actual title (browser_title)
* @return string
*/ */
function getModuleName() { function getModuleName() {
$model = &getModel('module'); $model = &getModel('module');

View file

@ -1,24 +1,34 @@
<?php <?php
/** /**
* @class documentModel * documentModel class
* @author NHN (developers@xpressengine.com) * model class of the module document
* @brief model class of the module document *
**/ * @author NHN (developers@xpressengine.com)
* @package /modules/document
* @version 0.1
*/
class documentModel extends document { class documentModel extends document {
/** /**
* @brief Initialization * Initialization
**/ * @return void
*/
function init() { function init() {
} }
/** /**
* @brief document checked the permissions on the session values * document checked the permissions on the session values
**/ * @param int $document_srl
* @return void
*/
function isGranted($document_srl) { function isGranted($document_srl) {
return $_SESSION['own_document'][$document_srl]; return $_SESSION['own_document'][$document_srl];
} }
/**
* Return document extra information from database
* @param array $documentSrls
* @return object
*/
function getDocumentExtraVarsFromDB($documentSrls) function getDocumentExtraVarsFromDB($documentSrls)
{ {
if(!is_array($documentSrls) || count($documentSrls) == 0) if(!is_array($documentSrls) || count($documentSrls) == 0)
@ -31,9 +41,10 @@
return $output; return $output;
} }
/** /**
* @brief extra variables for each article will not be processed bulk select and apply the macro city * Extra variables for each article will not be processed bulk select and apply the macro city
**/ * @return void
*/
function setToAllDocumentExtraVars() { function setToAllDocumentExtraVars() {
static $checked_documents = array(); static $checked_documents = array();
// XE XE_DOCUMENT_LIST all documents that the object referred to the global variable settings // XE XE_DOCUMENT_LIST all documents that the object referred to the global variable settings
@ -98,9 +109,14 @@
} }
} }
/** /**
* @brief Import Document * Import Document
**/ * @param int $document_srl
* @param bool $is_admin
* @param bool $load_extra_vars
* @param array $columnList
* @return documentItem
*/
function getDocument($document_srl=0, $is_admin = false, $load_extra_vars=true, $columnList = array()) { function getDocument($document_srl=0, $is_admin = false, $load_extra_vars=true, $columnList = array()) {
if(!$document_srl) return new documentItem(); if(!$document_srl) return new documentItem();
@ -115,9 +131,14 @@
return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
} }
/** /**
* @brief Bringing multiple documents (or paging) * Bringing multiple documents (or paging)
**/ * @param array|string $document_srls
* @param bool $is_admin
* @param bool $load_extra_vars
* @param array $columnList
* @return array value type is documentItem
*/
function getDocuments($document_srls, $is_admin = false, $load_extra_vars=true, $columnList = array()) { function getDocuments($document_srls, $is_admin = false, $load_extra_vars=true, $columnList = array()) {
if(is_array($document_srls)) { if(is_array($document_srls)) {
$list_count = count($document_srls); $list_count = count($document_srls);
@ -162,9 +183,14 @@
return $output; return $output;
} }
/** /**
* @brief module_srl value, bringing the list of documents * Module_srl value, bringing the list of documents
**/ * @param object $obj
* @param bool $except_notice
* @param bool $load_extra_vars
* @param array $columnList
* @return Object
*/
function getDocumentList($obj, $except_notice = false, $load_extra_vars=true, $columnList = array()) { function getDocumentList($obj, $except_notice = false, $load_extra_vars=true, $columnList = array()) {
$sort_check = $this->_setSortIndex($obj, $load_extra_vars); $sort_check = $this->_setSortIndex($obj, $load_extra_vars);
$obj->sort_index = $sort_check->sort_index; $obj->sort_index = $sort_check->sort_index;
@ -242,12 +268,12 @@
{ {
/** /**
* list_order asc sort of division that can be used only when * list_order asc sort of division that can be used only when
**/ */
if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false; if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false;
/** /**
* If it is true, use_division changed to use the document division * If it is true, use_division changed to use the document division
**/ */
if($use_division) { if($use_division) {
// Division begins // Division begins
$division = (int)Context::get('division'); $division = (int)Context::get('division');
@ -389,9 +415,12 @@
return $output; return $output;
} }
/** /**
* @brief module_srl value, bringing the document's gongjisa Port * Module_srl value, bringing the document's gongjisa Port
**/ * @param object $obj
* @param array $columnList
* @return object|void
*/
function getNoticeList($obj, $columnList = array()) { function getNoticeList($obj, $columnList = array()) {
$args->module_srl = $obj->module_srl; $args->module_srl = $obj->module_srl;
$args->category_srl= $obj->category_srl; $args->category_srl= $obj->category_srl;
@ -419,10 +448,12 @@
return $result; return $result;
} }
/** /**
* @brief function to retrieve the key values of the extended variable document * Function to retrieve the key values of the extended variable document
* $Form_include: writing articles whether to add the necessary extensions of the variable input form * $Form_include: writing articles whether to add the necessary extensions of the variable input form
**/ * @param int $module_srl
* @return array
*/
function getExtraKeys($module_srl) { function getExtraKeys($module_srl) {
if(is_null($GLOBALS['XE_EXTRA_KEYS'][$module_srl])) { if(is_null($GLOBALS['XE_EXTRA_KEYS'][$module_srl])) {
$oExtraVar = &ExtraVar::getInstance($module_srl); $oExtraVar = &ExtraVar::getInstance($module_srl);
@ -484,9 +515,12 @@
return $GLOBALS['XE_EXTRA_KEYS'][$module_srl]; return $GLOBALS['XE_EXTRA_KEYS'][$module_srl];
} }
/** /**
* @brief A particular document to get the value of the extra variable function * A particular document to get the value of the extra variable function
**/ * @param int $module_srl
* @param int $document_srl
* @return array
*/
function getExtraVars($module_srl, $document_srl) { function getExtraVars($module_srl, $document_srl) {
if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) { if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) {
// Extended to extract the values of variables set // Extended to extract the values of variables set
@ -498,11 +532,11 @@
return $GLOBALS['XE_EXTRA_VARS'][$document_srl]; return $GLOBALS['XE_EXTRA_VARS'][$document_srl];
} }
/** /**
* @brief Show pop-up menu of the selected posts * Show pop-up menu of the selected posts
* * Printing, scrap, recommendations and negative, reported the Add Features
* Printing, scrap, recommendations and negative, reported the Add Features * @return void
**/ */
function getDocumentMenu() { function getDocumentMenu() {
// Post number and the current login information requested Wanted // Post number and the current login information requested Wanted
$document_srl = Context::get('target_srl'); $document_srl = Context::get('target_srl');
@ -576,9 +610,12 @@
$this->add('menus', $menus); $this->add('menus', $menus);
} }
/** /**
* @brief module_srl the total number of documents that are bringing * The total number of documents that are bringing
**/ * @param int $module_srl
* @param object $search_obj
* @return int
*/
function getDocumentCount($module_srl, $search_obj = NULL) { function getDocumentCount($module_srl, $search_obj = NULL) {
// Additional search options // Additional search options
$args->module_srl = $module_srl; $args->module_srl = $module_srl;
@ -596,9 +633,11 @@
return (int)$total_count; return (int)$total_count;
} }
/** /**
* @brief module_srl the total number of documents that are bringing * the total number of documents that are bringing
**/ * @param object $search_obj
* @return array
*/
function getDocumentCountByGroupStatus($search_obj = NULL) { function getDocumentCountByGroupStatus($search_obj = NULL) {
// Additional search options // Additional search options
$args->module_srl = $search_obj->module_srl; $args->module_srl = $search_obj->module_srl;
@ -615,9 +654,12 @@
return $output->data; return $output->data;
} }
/** /**
* @brief Import page of the document, module_srl Without throughout .. * Import page of the document, module_srl Without throughout ..
**/ * @param documentItem $oDocument
* @param object $opt
* @return int
*/
function getDocumentPage($oDocument, $opt) { function getDocumentPage($oDocument, $opt) {
// Sort type changes depending on the query args // Sort type changes depending on the query args
switch($opt->sort_index) { switch($opt->sort_index) {
@ -680,9 +722,12 @@
return $page; return $page;
} }
/** /**
* @brief Imported Category of information * Imported Category of information
**/ * @param int $category_srl
* @param array $columnList
* @return object
*/
function getCategory($category_srl, $columnList = array()) { function getCategory($category_srl, $columnList = array()) {
$args->category_srl = $category_srl; $args->category_srl = $category_srl;
$output = executeQuery('document.getCategory', $args, $columnList); $output = executeQuery('document.getCategory', $args, $columnList);
@ -701,9 +746,11 @@
return $node; return $node;
} }
/** /**
* @brief Check whether the child has a specific category * Check whether the child has a specific category
**/ * @param int $category_srl
* @return bool
*/
function getCategoryChlidCount($category_srl) { function getCategoryChlidCount($category_srl) {
$args->category_srl = $category_srl; $args->category_srl = $category_srl;
$output = executeQuery('document.getChildCategoryCount',$args); $output = executeQuery('document.getChildCategoryCount',$args);
@ -711,10 +758,13 @@
return false; return false;
} }
/** /**
* @brief Bringing the Categories list the specific module * Bringing the Categories list the specific module
* Speed and variety of categories, considering the situation created by the php script to include a list of the must, in principle, to use * Speed and variety of categories, considering the situation created by the php script to include a list of the must, in principle, to use
**/ * @param int $module_srl
* @param array $columnList
* @return array
*/
function getCategoryList($module_srl, $columnList = array()) { function getCategoryList($module_srl, $columnList = array()) {
// Category of the target module file swollen // Category of the target module file swollen
$filename = sprintf("./files/cache/document_category/%s.php", $module_srl); $filename = sprintf("./files/cache/document_category/%s.php", $module_srl);
@ -731,9 +781,13 @@
return $document_category; return $document_category;
} }
/** /**
* @brief Category within a primary method to change the array type * Category within a primary method to change the array type
**/ * @param array $document_category
* @param array $list
* @param int $depth
* @return void
*/
function _arrangeCategory(&$document_category, $list, $depth) { function _arrangeCategory(&$document_category, $list, $depth) {
if(!count($list)) return; if(!count($list)) return;
$idx = 0; $idx = 0;
@ -786,9 +840,12 @@
$document_category[$list_order[count($list_order)-1]]->last = true; $document_category[$list_order[count($list_order)-1]]->last = true;
} }
/** /**
* @brief Wanted number of documents belonging to category * Wanted number of documents belonging to category
**/ * @param int $module_srl
* @param int $category_srl
* @return int
*/
function getCategoryDocumentCount($module_srl, $category_srl) { function getCategoryDocumentCount($module_srl, $category_srl) {
$args->module_srl = $module_srl; $args->module_srl = $module_srl;
$args->category_srl = $category_srl; $args->category_srl = $category_srl;
@ -796,9 +853,11 @@
return (int)$output->data->count; return (int)$output->data->count;
} }
/** /**
* @brief Xml cache file of the document category return information * Xml cache file of the document category return information
**/ * @param int $module_srl
* @return string
*/
function getCategoryXmlFile($module_srl) { function getCategoryXmlFile($module_srl) {
$xml_file = sprintf('files/cache/document_category/%s.xml.php',$module_srl); $xml_file = sprintf('files/cache/document_category/%s.xml.php',$module_srl);
if(!file_exists($xml_file)) { if(!file_exists($xml_file)) {
@ -808,9 +867,11 @@
return $xml_file; return $xml_file;
} }
/** /**
* @brief Php cache files in the document category return information * Php cache files in the document category return information
**/ * @param int $module_srl
* @return string
*/
function getCategoryPhpFile($module_srl) { function getCategoryPhpFile($module_srl) {
$php_file = sprintf('files/cache/document_category/%s.php',$module_srl); $php_file = sprintf('files/cache/document_category/%s.php',$module_srl);
if(!file_exists($php_file)) { if(!file_exists($php_file)) {
@ -820,9 +881,11 @@
return $php_file; return $php_file;
} }
/** /**
* @brief Imported post monthly archive status * Imported post monthly archive status
**/ * @param object $obj
* @return object
*/
function getMonthlyArchivedList($obj) { function getMonthlyArchivedList($obj) {
if($obj->mid) { if($obj->mid) {
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
@ -841,9 +904,11 @@
return $output; return $output;
} }
/** /**
* @brief Bringing a month on the status of the daily posts * Bringing a month on the status of the daily posts
**/ * @param object $obj
* @return object
*/
function getDailyArchivedList($obj) { function getDailyArchivedList($obj) {
if($obj->mid) { if($obj->mid) {
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
@ -863,9 +928,10 @@
return $output; return $output;
} }
/** /**
* @brief Get a list for a particular module * Get a list for a particular module
**/ * @return void|Object
*/
function getDocumentCategories() { function getDocumentCategories() {
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
$module_srl = Context::get('module_srl'); $module_srl = Context::get('module_srl');
@ -881,9 +947,10 @@
$this->add('categories', $output); $this->add('categories', $output);
} }
/** /**
* @brief Wanted to set document information * Wanted to set document information
**/ * @return object
*/
function getDocumentConfig() { function getDocumentConfig() {
if(!$GLOBALS['__document_config__']) { if(!$GLOBALS['__document_config__']) {
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
@ -894,10 +961,12 @@
return $GLOBALS['__document_config__']; return $GLOBALS['__document_config__'];
} }
/** /**
* @brief Common:: Module extensions of variable management * Common:: Module extensions of variable management
* Expansion parameter management module in the document module instance, when using all the modules available * Expansion parameter management module in the document module instance, when using all the modules available
**/ * @param int $module_srl
* @return string
*/
function getExtraVarsHTML($module_srl) { function getExtraVarsHTML($module_srl) {
// Bringing existing extra_keys // Bringing existing extra_keys
$extra_keys = $this->getExtraKeys($module_srl); $extra_keys = $this->getExtraKeys($module_srl);
@ -910,9 +979,11 @@
return $oTemplate->compile($this->module_path.'tpl', 'extra_keys'); return $oTemplate->compile($this->module_path.'tpl', 'extra_keys');
} }
/** /**
* @brief Common:: Category parameter management module * Common:: Category parameter management module
**/ * @param int $module_srl
* @return string
*/
function getCategoryHTML($module_srl) { function getCategoryHTML($module_srl) {
$category_xml_file = $this->getCategoryXmlFile($module_srl); $category_xml_file = $this->getCategoryXmlFile($module_srl);
@ -924,10 +995,11 @@
return $oTemplate->compile($this->module_path.'tpl', 'category_list'); return $oTemplate->compile($this->module_path.'tpl', 'category_list');
} }
/** /**
* @brief Certain categories of information, return the template guhanhu * Certain categories of information, return the template guhanhu
* Manager on the page to add information about a particular menu from the server after compiling tpl compiled a direct return html * Manager on the page to add information about a particular menu from the server after compiling tpl compiled a direct return html
**/ * @return void|Object
*/
function getDocumentCategoryTplInfo() { function getDocumentCategoryTplInfo() {
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
$oMemberModel = &getModel('member'); $oMemberModel = &getModel('member');
@ -974,7 +1046,12 @@
$this->add('tpl', $tpl); $this->add('tpl', $tpl);
} }
/**
* Return docuent data by alias
* @param string $mid
* @param string $alias
* @return int|void
*/
function getDocumentSrlByAlias($mid, $alias) function getDocumentSrlByAlias($mid, $alias)
{ {
if(!$mid || !$alias) return null; if(!$mid || !$alias) return null;
@ -987,6 +1064,12 @@
else return $output->data->document_srl; else return $output->data->document_srl;
} }
/**
* Return docuent number by document title
* @param int $module_srl
* @param string $title
* @return int|void
*/
function getDocumentSrlByTitle($module_srl, $title) function getDocumentSrlByTitle($module_srl, $title)
{ {
if(!$module_srl || !$title) return null; if(!$module_srl || !$title) return null;
@ -1000,6 +1083,11 @@
} }
} }
/**
* Return docuent's alias
* @param int $document_srl
* @return string|void
*/
function getAlias($document_srl){ function getAlias($document_srl){
if(!$document_srl) return null; if(!$document_srl) return null;
$args->document_srl = $document_srl; $args->document_srl = $document_srl;
@ -1009,6 +1097,13 @@
else return $output->data[0]->alias_title; else return $output->data[0]->alias_title;
} }
/**
* Return document's history list
* @param int $document_srl
* @param int $list_count
* @param int $page
* @return object
*/
function getHistories($document_srl, $list_count, $page) function getHistories($document_srl, $list_count, $page)
{ {
$args->list_count = $list_count; $args->list_count = $list_count;
@ -1018,6 +1113,11 @@
return $output; return $output;
} }
/**
* Return document's history
* @param int $history_srl
* @return object
*/
function getHistory($history_srl) function getHistory($history_srl)
{ {
$args->history_srl = $history_srl; $args->history_srl = $history_srl;
@ -1025,9 +1125,11 @@
return $output->data; return $output->data;
} }
/** /**
* @brief module_srl value, bringing the list of documents * Module_srl value, bringing the list of documents
**/ * @param object $obj
* @return object
*/
function getTrashList($obj) { function getTrashList($obj) {
// Variable check // Variable check
$args->category_srl = $obj->category_srl?$obj->category_srl:null; $args->category_srl = $obj->category_srl?$obj->category_srl:null;
@ -1100,9 +1202,10 @@
return $output; return $output;
} }
/** /**
* @brief vote up, vote down member list in Document View page * vote up, vote down member list in Document View page
**/ * @return void|Object
*/
function getDocumentVotedMemberList() function getDocumentVotedMemberList()
{ {
$document_srl = Context::get('document_srl'); $document_srl = Context::get('document_srl');
@ -1143,6 +1246,10 @@
$this->add('voted_member_list',$output->data); $this->add('voted_member_list',$output->data);
} }
/**
* Return status name list
* @return array
*/
function getStatusNameList() function getStatusNameList()
{ {
global $lang; global $lang;
@ -1151,6 +1258,12 @@
else return $lang->status_name_list; else return $lang->status_name_list;
} }
/**
* Setting sort index
* @param object $obj
* @param bool $load_extra_vars
* @return object
*/
function _setSortIndex($obj, $load_extra_vars) function _setSortIndex($obj, $load_extra_vars)
{ {
$sortIndex = $obj->sort_index; $sortIndex = $obj->sort_index;
@ -1186,10 +1299,15 @@
} }
/** /**
* @brief 게시물 목록의 검색 옵션을 Setting함(2011.03.08 - cherryfilter) * 게시물 목록의 검색 옵션을 Setting함(2011.03.08 - cherryfilter)
* page변수가 없는 상태에서 page 값을 알아오는 method(getDocumentPage) 검색하지 않은 값을 return해서 검색한 값을 가져오도록 검색옵션이 추가 . * page변수가 없는 상태에서 page 값을 알아오는 method(getDocumentPage) 검색하지 않은 값을 return해서 검색한 값을 가져오도록 검색옵션이 추가 .
* 검색옵션의 중복으로 인해 private method로 별도 분리 * 검색옵션의 중복으로 인해 private method로 별도 분리
**/ * @param object $searchOpt
* @param object $args
* @param string $query_id
* @param bool $use_division
* @return void
*/
function _setSearchOption($searchOpt, &$args, &$query_id, &$use_division) function _setSearchOption($searchOpt, &$args, &$query_id, &$use_division)
{ {
$search_target = $searchOpt->search_target; $search_target = $searchOpt->search_target;

View file

@ -1,22 +1,25 @@
<?php <?php
/** /**
* @class documentView * documentView class
* @author NHN (developers@xpressengine.com) * View class of the module document
* @brief View class of the module document *
**/ * @author NHN (developers@xpressengine.com)
* @package /modules/document
* @version 0.1
*/
class documentView extends document { class documentView extends document {
/**
/** * Initialization
* @brief Initialization * @return void
**/ */
function init() { function init() {
} }
/** /**
* @brief Document printing * Document printing
* I make it out to find the geulman;; * I make it out to find the geulman;;
**/ * @return void|Object
*/
function dispDocumentPrint() { function dispDocumentPrint() {
// Bring a list of variables needed to implement // Bring a list of variables needed to implement
$document_srl = Context::get('document_srl'); $document_srl = Context::get('document_srl');
@ -43,9 +46,10 @@
$this->setTemplateFile('print_page'); $this->setTemplateFile('print_page');
} }
/** /**
* @brief Preview * Preview
**/ * @return void
*/
function dispDocumentPreview() { function dispDocumentPreview() {
Context::set('layout','none'); Context::set('layout','none');
@ -54,9 +58,10 @@
$this->setTemplateFile('preview_page'); $this->setTemplateFile('preview_page');
} }
/** /**
* @brief Selected by the administrator for the document management * Selected by the administrator for the document management
**/ * @return void|Object
*/
function dispDocumentManageDocument() { function dispDocumentManageDocument() {
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
// Taken from a list of selected sessions // Taken from a list of selected sessions
@ -93,6 +98,12 @@
$this->setTemplateFile('checked_list'); $this->setTemplateFile('checked_list');
} }
/**
* Trigger method.
* Additional information realte to document setting
* @param string $obj
* @return Object
*/
function triggerDispDocumentAdditionSetup(&$obj) { function triggerDispDocumentAdditionSetup(&$obj) {
$current_module_srl = Context::get('module_srl'); $current_module_srl = Context::get('module_srl');
$current_module_srls = Context::get('module_srls'); $current_module_srls = Context::get('module_srls');
@ -119,6 +130,10 @@
return new Object(); return new Object();
} }
/**
* Document temp saved list
* @return void
*/
function dispTempSavedList() function dispTempSavedList()
{ {
$this->setLayoutFile('popup_layout'); $this->setLayoutFile('popup_layout');