From: <ki...@us...> - 2010-06-02 13:40:42
|
Revision: 523 http://xc-tokai.svn.sourceforge.net/xc-tokai/?rev=523&view=rev Author: kilica Date: 2010-06-02 13:40:36 +0000 (Wed, 02 Jun 2010) Log Message: ----------- update for cool uri Modified Paths: -------------- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractEditAction.class.php modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractViewAction.class.php modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/Module.class.php modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/DeleteAction.class.php modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/EditAction.class.php modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/ViewAction.class.php modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/delete.html modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/edit.html Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractEditAction.class.php =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractEditAction.class.php 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractEditAction.class.php 2010-06-02 13:40:36 UTC (rev 523) @@ -30,6 +30,9 @@ **/ protected function _getId() { + $req = $this->mRoot->mContext->mRequest; + $dataId = $req->getRequest(_REQUESTED_DATA_ID); + return isset($dataId) ? intval($dataId) : intval($req->getRequest($this->_getHandler()->mPrimary)); } /** Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractViewAction.class.php =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractViewAction.class.php 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/AbstractViewAction.class.php 2010-06-02 13:40:36 UTC (rev 523) @@ -28,6 +28,9 @@ **/ protected function _getId() { + $req = $this->mRoot->mContext->mRequest; + $dataId = $req->getRequest(_REQUESTED_DATA_ID); + return isset($dataId) ? intval($dataId) : intval($req->getRequest($this->_getHandler()->mPrimary)); } /** Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/Module.class.php =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/Module.class.php 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/modulebase/xoops_trust_path/modules/modulename/class/Module.class.php 2010-06-02 13:40:36 UTC (rev 523) @@ -93,8 +93,30 @@ **/ private function _getDefaultActionName() { - // TODO insert your default action name - return '{{mainTable}}List'; + $req = XCube_Root::getSingleton()->mContext->mRequest; + $dataId = $req->getRequest(_REQUESTED_DATA_ID); + $dataname = $req->getRequest(_REQUESTED_DATA_NAME); + $dataname = isset($dataname) ? $dataname : '{{mainTable}}'; + $action = $req->getRequest(_REQUESTED_ACTION_NAME); + + if($dataId>0){ + if(isset($action)){ + $actionName = ucfirst($dataname).ucfirst($action); + } + else{ + $actionName = ucfirst($dataname).'View'; + } + } + else{ + if(isset($action)){ + $actionName = ucfirst($dataname).ucfirst($action); + } + else{ + $actionName = ucfirst($dataname).'List'; + } + } + + return $actionName; } /** Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/DeleteAction.class.php =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/DeleteAction.class.php 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/DeleteAction.class.php 2010-06-02 13:40:36 UTC (rev 523) @@ -17,17 +17,6 @@ **/ class {Modulename}_{Tablename}DeleteAction extends {Modulename}_AbstractDeleteAction { - /** - * _getId - * - * @param void - * - * @return int - **/ - protected function _getId() - { - return $this->mRoot->mContext->mRequest->getRequest('{primary_key_id}'); - } {{_getCatId}} /** * &_getHandler Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/EditAction.class.php =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/EditAction.class.php 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/EditAction.class.php 2010-06-02 13:40:36 UTC (rev 523) @@ -17,17 +17,6 @@ **/ class {Modulename}_{Tablename}EditAction extends {Modulename}_AbstractEditAction { - /** - * _getId - * - * @param void - * - * @return int - **/ - protected function _getId() - { - return $this->mRoot->mContext->mRequest->getRequest('{primary_key_id}'); - } {{_getCatId}} /** * &_getHandler Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/ViewAction.class.php =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/ViewAction.class.php 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/actions/ViewAction.class.php 2010-06-02 13:40:36 UTC (rev 523) @@ -17,14 +17,6 @@ **/ class {Modulename}_{Tablename}ViewAction extends {Modulename}_AbstractViewAction { - /** - * _getId - * - **/ - protected function _getId() - { - return $this->mRoot->mContext->mRequest->getRequest('{primary_key_id}'); - } {{_getCatId}} /** * &_getHandler Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/delete.html =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/delete.html 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/delete.html 2010-06-02 13:40:36 UTC (rev 523) @@ -3,7 +3,7 @@ <div class="confirm"><{$smarty.const._MD_{MODULENAME}_MESSAGE_CONFIRM_DELETE}></div> -<form action="./index.php?action={Tablename}Delete" method="post"> +<form action="<{xoops_cooluri dirname=$dirname dataname={tablename} action=delete}>" method="post"> <dl> {{delete}} <dd> Modified: modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/edit.html =================================================================== --- modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/edit.html 2010-06-02 13:17:12 UTC (rev 522) +++ modules_tubsonp/trunk/xoops_trust_path/modules/tubsonp/files/22/tablebase/templates/edit.html 2010-06-02 13:40:36 UTC (rev 523) @@ -7,7 +7,7 @@ <{/foreach}> </ul> <{/if}> -<form action="index.php?action={Tablename}Edit" method="post"> +<form action="<{xoops_cooluri dirname=$dirname dataname={tablename} action=edit}>" method="post"> <dl> {{edit}} <dt></dt> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |