From: <ki...@us...> - 2009-04-04 01:05:51
|
Revision: 404 http://xc-tokai.svn.sourceforge.net/xc-tokai/?rev=404&view=rev Author: kilica Date: 2009-04-04 01:05:38 +0000 (Sat, 04 Apr 2009) Log Message: ----------- [0.16] Add PollOneBlock.class.php Modified Paths: -------------- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/actions/PollEditAction.class.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/admin.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/modinfo.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/admin.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/modinfo.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php Added Paths: ----------- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/PollOneBlock.class.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/blocks.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/blocks.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_pollone.html Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt 2009-04-04 01:05:38 UTC (rev 404) @@ -18,6 +18,9 @@ \x8DX\x90V\x97\x9A\x97\xF0 -------- +0.16(2009.04.04) +\x81EPollOne\x83u\x83\x8D\x83b\x83N\x82\xF0\x92lj\xC1\x81B\x8Ew\x92肳\x82ꂽ\x83A\x83\x93\x83P\x81[\x83g\x82̓\x8A\x95[\x82\xAA\x8Fo\x97\x88\x82\xE9\x83u\x83\x8D\x83b\x83N + 0.15(2009.03.28) \x81Elanguages/japanese/modinfo.php \x82Ɍ\xBE\x8C\xEA\x92萔\x82\xF0\x92lj\xC1(thanks \x91\xBE\x98Y) \x81E\x83J\x83e\x83S\x83\x8A\x83O\x83\x8B\x81[\x83v\x82\xF0\x8Eg\x82\xED\x82Ȃ\xA2\x8Fꍇ\x82Ƀu\x83\x8D\x83b\x83N\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ȃ\xA9\x82\xC1\x82\xBD\x83o\x83O\x82\xF0\x8FC\x90\xB3\x81iThanks \x82\xB3\x82\xA2\x82\xB3\x82\xA2\x81j Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/actions/PollEditAction.class.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/actions/PollEditAction.class.php 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/actions/PollEditAction.class.php 2009-04-04 01:05:38 UTC (rev 404) @@ -153,7 +153,7 @@ **/ public function executeViewError(/*** XCube_RenderTarget ***/ &$render) { - $this->mRoot->mController->executeRedirect('./index.php?action=PollList', 1, _MD_BIZPOLL_ERROR_DBUPDATE_FAILED); + $this->mRoot->mController->executeRedirect('./index.php?action=PollView&enq_id='. $this->mObject->get('enq_id'), 1, _MD_BIZPOLL_ERROR_DBUPDATE_FAILED); } /** Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php 2009-04-04 01:05:38 UTC (rev 404) @@ -134,7 +134,7 @@ ); $configHandler =& xoops_gethandler('config'); - $configArr =& $configHandler->getConfigsByDirname($this->mDirname); + $configArr =& $configHandler->getConfigsByDirname($this->_mBlock->get('dirname')); $this->_mHandler =& $asset->getObject('handler','enq'); $criteria = new CriteriaCompo('1', '1'); $criteria->addSort('reg_unixtime', 'DESC'); Added: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/PollOneBlock.class.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/PollOneBlock.class.php (rev 0) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/PollOneBlock.class.php 2009-04-04 01:05:38 UTC (rev 404) @@ -0,0 +1,188 @@ +<?php +/** + * @file + * @package sdoc + * @version $Id$ +**/ + +if(!defined('XOOPS_ROOT_PATH')) +{ + exit(); +} + +/** + * Sdoc_ContentBlock +**/ +class Bizpoll_PollOneBlock extends Legacy_BlockProcedure +{ + /** + * @var Sdoc_ItemsHandler + * + * @private + **/ + var $_mHandler = null; + + /** + * @var Sdoc_ItmesObject + * + * @private + **/ + var $_mObject = null; + + /** + * @var string[] + * + * @private + **/ + var $_mOptions = array(); + + var $mActionForm = null; + + /** + * prepare + * + * @param void + * + * @return bool + * + * @public + **/ + function prepare() + { + return parent::prepare() && $this->_parseOptions() && $this->_setupObject(); + } + + /** + * _parseOptions + * + * @param void + * + * @return bool + * + * @private + **/ + function _parseOptions() + { + $opts = explode('|',$this->_mBlock->get('options')); + $this->_mOptions = array( + 'enq_id' => (intval($opts[0])>0 ? intval($opts[0]) : 0), + ); + return true; + } + + /** + * getBlockOption + * + * @param string $key + * + * @return string + * + * @public + **/ + function getBlockOption($key) + { + return isset($this->_mOptions[$key]) ? $this->_mOptions[$key] : null; + } + + /** + * getOptionForm + * + * @param void + * + * @return string + * + * @public + **/ + function getOptionForm() + { + if(!$this->prepare()) + { + return null; + } + $form = "<label for='". $this->_mBlock->get('dirname') ."block_enqId'>"._AD_BIZPOLL_LANG_ENQ_ID."</label> : + <input type='text' size='5' name='options[0]' id='". $this->_mBlock->get('dirname') ."block_enqId' value='".$this->getBlockOption('enq_id')."' />" ; + return $form; + } + + /** + * _setupObject + * + * @param void + * + * @return bool + * + * @private + **/ + function _setupObject() + { + $objects = array(); + + //get block options + $enqId = $this->getBlockOption('enq_id'); + + //get module asset for handlers + $asset = null; + XCube_DelegateUtils::call( + 'Module.bizpoll.Global.Event.GetAssetManager', + new XCube_Ref($asset), + $this->_mBlock->get('dirname') + ); + + $configHandler =& xoops_gethandler('config'); + $configArr =& $configHandler->getConfigsByDirname($this->_mBlock->get('dirname')); + $this->_mHandler =& $asset->getObject('handler','enq'); + + $object = $this->_mHandler->get($enqId); + + //check permission + require_once BIZPOLL_TRUST_PATH . '/class/XcatHandler.class.php'; + $xcatHandler = new Bizpoll_XcatHandler($this->_mBlock->get('dirname')); + if(! $xcatHandler->checkPermit($object->get('cat_id'), 'viewer')){ + return true; + } + + $object->loadMyPoll($this->_mBlock->get('dirname')); + if($object->mMyPoll->get('poll_id')>0){ + return true; + } + + $object->countPoll($this->_mBlock->get('dirname')); + $object->loadChoice($this->_mBlock->get('dirname')); + + $this->_mObject = $object; + + //setup action form + $this->mActionForm =& $asset->getObject('form', 'poll', false, 'edit'); + $this->mActionForm->prepare(); + $this->mActionForm->load($this->_mObject->mMyPoll); + + return true; + } + + /** + * execute + * + * @param void + * + * @return void + * + * @public + **/ + function execute() + { + if($this->_mObject){ + $root =& XCube_Root::getSingleton(); + + $render =& $this->getRenderTarget(); + $render->setTemplateName($this->_mBlock->get('template')); + $render->setAttribute('block', $this->_mObject); + $render->setAttribute('actionForm', $this->mActionForm); + $render->setAttribute('bizpollBlockDirname', $this->_mBlock->get('dirname')); + $renderSystem =& $root->getRenderSystem($this->getRenderSystemName()); + //var_dump($this->_mObject);die(); + $renderSystem->renderBlock($render); + } + } +} + +?> Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/admin.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/admin.php 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/admin.php 2009-04-04 01:05:38 UTC (rev 404) @@ -7,4 +7,6 @@ define('_AD_BIZPOLL_LANG_DISPLAY_NUMBER', "表示件数"); define('_AD_BIZPOLL_LANG_SHOW_CAT', "表示対象カテゴリ"); +define('_AD_BIZPOLL_LANG_ENQ_ID', "アンケートID"); + ?> Added: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/blocks.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/blocks.php (rev 0) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/blocks.php 2009-04-04 01:05:38 UTC (rev 404) @@ -0,0 +1,11 @@ +<?php +/** + * @file + * @package DBKMARKEN + * @version $Id$ + */ + +define('_MB_BIZPOLL_LANG_POLL_COUNT', "投票数"); +define('_MB_BIZPOLL_LANG_UID', "お名前"); + +?> Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/modinfo.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/modinfo.php 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/modinfo.php 2009-04-04 01:05:38 UTC (rev 404) @@ -80,4 +80,6 @@ define('_MI_BIZPOLL_DESC_IP_PERIOD', "同一IPアドレスからのゲスト投票を禁止する時間を指定"); define('_MI_BIZPOLL_BLOCK_NAME_ENQ', "最近のアンケート"); define('_MI_BIZPOLL_BLOCK_DESC_ENQ', "最近のアンケート"); +define('_MI_BIZPOLL_BLOCK_NAME_POLLONE', "投票"); +define('_MI_BIZPOLL_BLOCK_DESC_POLLONE', "複数の投票ブロックを同じページに表示させると投票できなくなります(^ ^;"); ?> Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/admin.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/admin.php 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/admin.php 2009-04-04 01:05:38 UTC (rev 404) @@ -7,4 +7,5 @@ define('_AD_BIZPOLL_LANG_DISPLAY_NUMBER', "ɽ\xBC\xA8\xB7\xEF\xBF\xF4"); define('_AD_BIZPOLL_LANG_SHOW_CAT', "ɽ\xBC\xA8\xC2оݥ\xAB\xA5ƥ\xB4\xA5\xEA"); +define('_AD_BIZPOLL_LANG_ENQ_ID', "\xA5\xA2\xA5\xBC\xA5\xC8ID"); ?> Added: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/blocks.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/blocks.php (rev 0) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/blocks.php 2009-04-04 01:05:38 UTC (rev 404) @@ -0,0 +1,10 @@ +<?php +/** + * @file + * @package DBKMARKEN + * @version $Id$ + */ +define('_MB_BIZPOLL_LANG_POLL_COUNT', "\xC5\xEAɼ\xBF\xF4"); +define('_MB_BIZPOLL_LANG_UID', "\xA4\xAA̾\xC1\xB0"); + +?> Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/modinfo.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/modinfo.php 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/modinfo.php 2009-04-04 01:05:38 UTC (rev 404) @@ -80,4 +80,6 @@ define('_MI_BIZPOLL_DESC_IP_PERIOD', "Ʊ\xB0\xECIP\xA5\xA2\xA5ɥ쥹\xA4\xAB\xA4\xE9\xA4Υ\xB2\xA5\xB9\xA5\xC8\xC5\xEAɼ\xA4\xF2\xB6ػߤ\xB9\xA4\xEB\xBB\xFE\xB4֤\xF2\xBB\xD8\xC4\xEA"); define('_MI_BIZPOLL_BLOCK_NAME_ENQ', "\xBAǶ\xE1\xA4Υ\xA2\xA5\xBC\xA5\xC8"); define('_MI_BIZPOLL_BLOCK_DESC_ENQ', "\xBAǶ\xE1\xA4Υ\xA2\xA5\xBC\xA5\xC8"); +define('_MI_BIZPOLL_BLOCK_NAME_POLLONE', "\xC5\xEAɼ"); +define('_MI_BIZPOLL_BLOCK_DESC_POLLONE', "ʣ\xBF\xF4\xA4\xCE\xC5\xEAɼ\xA5֥\xED\xA5å\xAF\xA4\xF2Ʊ\xA4\xB8\xA5ڡ\xBC\xA5\xB8\xA4\xCBɽ\xBC\xA8\xA4\xB5\xA4\xBB\xA4\xEB\xA4\xC8\xC5\xEAɼ\xA4Ǥ\xAD\xA4ʤ\xAF\xA4ʤ\xEA\xA4ޤ\xB9(^ ^;"); ?> Added: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_pollone.html =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_pollone.html (rev 0) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_pollone.html 2009-04-04 01:05:38 UTC (rev 404) @@ -0,0 +1,54 @@ +<div class="bizpoll"> + <!-- Main --> + <a href="<{$xoops_url}>/moduels/<{$bizpollBlockDirname}>/index.php?action=EnqView&enq_id=<{$block->getShow('enq_id')}>"><{$block->getShow('title')}></a> + <{$block->get('end_unixtime')|xoops_formattimestamp:"l"}> + <p> + <{if $useEditor=="fckeditor"}> + <{$block->get('description')}> + <{else}> + <{$block->getShow('description')}> + <{/if}> + </p> + <div class="bizpollPoll"> + <!-- Choices List --> + <{if $block->checkEnd()==true}> + <form action="<{$xoops_url}>/modules/<{$bizpollBlockDirname}>/index.php?action=PollEdit" method="post"> + <{xoops_token form=$actionForm}> + <{xoops_input type=hidden name=poll_id value=0}> + <{xoops_input type=hidden name=enq_id value=$actionForm->get('enq_id')}> + <ul class="bizpollChoice"> + <{if $block->get('type')==0}> + <{foreach item=choiceR from=$block->mChoice}> + <li><label> + <input type="radio" name="choice_id" id="legacy_xoopsform_choice_id" value="<{$choiceR->getShow('choice_id')}>"<{if $choiceR->mIsPolled==true}> checked="checked"<{/if}>> + <{$choiceR->getShow('title')}><{if $allowShowResult==true}> (<{$smarty.const._MB_BIZPOLL_LANG_POLL_COUNT}>: <{$choiceR->mPollCount}>)<{/if}></label> + </li> + <{/foreach}> + + <{elseif $block->get('type')==1}> + <{foreach item=choiceC from=$block->mChoice}> + <li><label> + <input type="checkbox" name="choice_id[]" id="legacy_xoopsform_choice_id[]" value="<{$choiceC->getShow('choice_id')}>"<{if $choiceC->mIsPolled==true}> checked="checked"<{/if}>> + <{$choiceC->getShow('title')}><{if $allowShowResult==true}> (<{$smarty.const._MB_BIZPOLL_LANG_POLL_COUNT}>: <{$choiceR->mPollCount}>)<{/if}></label> + </li> + <{/foreach}> + <{/if}> + </ul> + <{if ! $xoops_userid}> + <{$smarty.const._MB_BIZPOLL_LANG_UID}><br /> + <{xoops_input type=text name=name value=$actionForm->get('name') size=30 maxlength=16}><br /> + <{/if}> + <{xoops_textarea type=text name=comment value=$actionForm->get('comment')}> + <input type="submit" value="<{$smarty.const._SUBMIT}>" /> + </form> + <{else}> + <ul> + <{foreach item=choice from=$block->mChoice}> + <li> + <{$choice->getShow('title')}> + </li> + <{/foreach}> + </ul> + <{/if}> + </div> +</div> Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php 2009-03-28 07:11:21 UTC (rev 403) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php 2009-04-04 01:05:38 UTC (rev 404) @@ -21,7 +21,7 @@ // Define a basic manifesto. // $modversion['name'] = _MI_BIZPOLL_LANG_BIZPOLL; -$modversion['version'] = 0.15; +$modversion['version'] = 0.16; $modversion['description'] = _MI_BIZPOLL_DESC_BIZPOLL; $modversion['author'] = _MI_BIZPOLL_LANG_AUTHOR; $modversion['credits'] = _MI_BIZPOLL_LANG_CREDITS; @@ -213,6 +213,18 @@ 'can_clone' => true, 'visible_any' => false ), + 2 => array( + 'func_num' => 1, + 'file' => 'PollOneBlock.class.php', + 'class' => 'PollOneBlock', + 'name' => _MI_BIZPOLL_BLOCK_NAME_POLLONE, + 'description' => _MI_BIZPOLL_BLOCK_DESC_POLLONE, + 'options' => '0|', + 'template' => '{dirname}_block_pollone.html', + 'show_all_module' => true, + 'can_clone' => true, + 'visible_any' => false + ), ##[cubson:block] ##[/cubson:block] ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |