From: <ki...@us...> - 2008-12-23 12:41:41
|
Revision: 380 http://xc-tokai.svn.sourceforge.net/xc-tokai/?rev=380&view=rev Author: kilica Date: 2008-12-23 12:41:37 +0000 (Tue, 23 Dec 2008) Log Message: ----------- [0.13] Add Enq Block Modified Paths: -------------- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt 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/templates/bizpoll_enq_list.html modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php Added Paths: ----------- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_enq.html Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt 2008-12-18 13:23:22 UTC (rev 379) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/README.txt 2008-12-23 12:41:37 UTC (rev 380) @@ -18,6 +18,9 @@ \x8DX\x90V\x97\x9A\x97\xF0 -------- +0.13(2008.12.23) +\x81E\x81u\x8Dŋ߂̃A\x83\x93\x83P\x81[\x83g\x81v\x83u\x83\x8D\x83b\x83N\x82\xF0\x92lj\xC1 + 0.12(2008.12.13) \x81\xA60.11\x88ȑO\x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x8Eg\x82\xED\x82\xEA\x82Ă\xA2\x82\xE9\x8Fꍇ\x82́AMySQL \x82̃e\x81[\x83u\x83\x8B\x82\xCC bizpoll_poll \x82\xCC "choice_id" \x82\xCC type \x82\xF0 text \x82ɕύX\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B \x81EChoice \x82̍ĕҏW\x8B@\x94\\x82\xF0\x92lj\xC1 Added: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php (rev 0) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/blocks/EnqBlock.class.php 2008-12-23 12:41:37 UTC (rev 380) @@ -0,0 +1,195 @@ +<?php +/** + * @file + * @package sdoc + * @version $Id$ +**/ + +if(!defined('XOOPS_ROOT_PATH')) +{ + exit(); +} + +/** + * Sdoc_ContentBlock +**/ +class Bizpoll_EnqBlock extends Legacy_BlockProcedure +{ + /** + * @var Sdoc_ItemsHandler + * + * @private + **/ + var $_mHandler = null; + + /** + * @var Sdoc_ItmesObject + * + * @private + **/ + var $_mOject = null; + + /** + * @var string[] + * + * @private + **/ + var $_mOptions = array(); + + /** + * 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( + 'limit' => (intval($opts[0])>0 ? intval($opts[0]) : 5), + 'catIds' => $opts[1] + ); + 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_dispNum'>"._AD_BIZPOLL_LANG_DISPLAY_NUMBER."</label> : + <input type='text' size='5' name='options[0]' id='". $this->_mBlock->get('dirname') ."block_dispNum' value='".$this->getBlockOption('limit')."' /><br />\n + <label for='". $this->_mBlock->get('dirname') ."block_showCat'>"._AD_BIZPOLL_LANG_SHOW_CAT."</label> : + <input type='text' size='64' name='options[1]' id='". $this->_mBlock->get('dirname') ."block_enq' value='".$this->getBlockOption('catIds')."' />\n" ; + return $form; + } + + /** + * _setupObject + * + * @param void + * + * @return bool + * + * @private + **/ + function _setupObject() + { + $objects = array(); + $catIdArr = array(); + + //get block options + $limit = $this->getBlockOption('limit'); + if($this->getBlockOption('catIds')){ + $catIdArr = explode(',', $this->getBlockOption('catIds')); + } + + //get module asset for handlers + $asset = null; + XCube_DelegateUtils::call( + 'Module.bizpoll.Global.Event.GetAssetManager', + new XCube_Ref($asset), + $this->_mBlock->get('dirname') + ); + + $this->_mHandler =& $asset->getObject('handler','enq'); + $criteria = new CriteriaCompo('1', '1'); + $criteria->addSort('reg_unixtime', 'DESC'); + $criteria->setLimit($limit); + + //use subcriteria for permitted ids + require_once BIZPOLL_TRUST_PATH . '/class/XcatHandler.class.php'; + $xcatHandler = new Bizpoll_XcatHandler($this->_mBlock->get('dirname')); + $catCriteria = new CriteriaCompo('1', '1'); + if($catIdArr){ //get requested categories and check permission + foreach(array_keys($catIdArr) as $key){ + if($xcatHandler->checkPermit($catIdArr[$key], 'viewer')){ + $catCriteria->add(new Criteria('cat_id', $catIdArr[$key])); + } + } + if($catCriteria->getCountChildElements()==0){ + return true; + } + } + else{ //get all permit categories + $ids = $xcatHandler->getPermitCatIds(0, 'viewer'); + foreach(array_keys($ids) as $key){ + $catCriteria->add(new Criteria('cat_id', $ids[$key]), 'OR'); + } + } + $criteria->add($catCriteria); + + $objects = $this->_mHandler->getObjects($criteria); + foreach(array_keys($objects) as $keyC){ + $objects[$keyC]->countPoll($this->_mBlock->get('dirname')); + } + + $this->_mObject = $objects; + return true; + } + + /** + * execute + * + * @param void + * + * @return void + * + * @public + **/ + function execute() + { + $root =& XCube_Root::getSingleton(); + + $render =& $this->getRenderTarget(); + $render->setTemplateName($this->_mBlock->get('template')); + $render->setAttribute('block', $this->_mObject); + $render->setAttribute('dirname', $this->_mBlock->get('dirname')); + $renderSystem =& $root->getRenderSystem($this->getRenderSystemName()); + //var_dump($renderSystem);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 2008-12-18 13:23:22 UTC (rev 379) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/admin.php 2008-12-23 12:41:37 UTC (rev 380) @@ -5,4 +5,6 @@ * @version $Id$ **/ +define('_AD_BIZPOLL_LANG_DISPLAY_NUMBER', "表示件数"); +define('_AD_BIZPOLL_LANG_SHOW_CAT', "表示対象カテゴリ"); ?> 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 2008-12-18 13:23:22 UTC (rev 379) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/ja_utf8/modinfo.php 2008-12-23 12:41:37 UTC (rev 380) @@ -78,5 +78,6 @@ define('_MI_BIZPOLL_LANG_NOEDITOR', "エディタを使わない"); define('_MI_BIZPOLL_TITLE_IP_PERIOD', "同一IP投票禁止期間(時間)"); define('_MI_BIZPOLL_DESC_IP_PERIOD', "同一IPアドレスからのゲスト投票を禁止する時間を指定"); - +define('_MI_BIZPOLL_BLOCK_NAME_ENQ', "最近のアンケート"); +define('_MI_BIZPOLL_BLOCK_DESC_ENQ', "最近のアンケート"); ?> 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 2008-12-18 13:23:22 UTC (rev 379) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/admin.php 2008-12-23 12:41:37 UTC (rev 380) @@ -1,8 +1,10 @@ -<?php -/** - * @file - * @package bizpoll - * @version $Id$ -**/ - -?> +<?php +/** + * @file + * @package bizpoll + * @version $Id$ +**/ + +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"); +?> 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 2008-12-18 13:23:22 UTC (rev 379) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/language/japanese/modinfo.php 2008-12-23 12:41:37 UTC (rev 380) @@ -78,5 +78,7 @@ define('_MI_BIZPOLL_LANG_NOEDITOR', "\xA5\xA8\xA5ǥ\xA3\xA5\xBF\xA4\xF2\xBBȤ\xEF\xA4ʤ\xA4"); define('_MI_BIZPOLL_TITLE_IP_PERIOD', "Ʊ\xB0\xECIP\xC5\xEAɼ\xB6ػߴ\xFC\xB4֡ʻ\xFE\xB4֡\xCB"); 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"); ?> Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/bizpoll_enq_list.html =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/bizpoll_enq_list.html 2008-12-18 13:23:22 UTC (rev 379) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/bizpoll_enq_list.html 2008-12-23 12:41:37 UTC (rev 380) @@ -2,7 +2,7 @@ <li><a href="index.php?action=EnqEdit"><{$smarty.const._MD_BIZPOLL_LANG_ADD_A_NEW_ENQ}></a></li> </ul> -<div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div> +<div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div><div class="fix"></div> <table class="outer"> <thead> <tr> Added: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_enq.html =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_enq.html (rev 0) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/templates/blocks/bizpoll_block_enq.html 2008-12-23 12:41:37 UTC (rev 380) @@ -0,0 +1,6 @@ +<ul> + <{foreach item=obj from=$block}> + <li><a href="<{$xoops_url}>/modules/<{$dirname}>/index.php?action=EnqView&enq_id=<{$obj->getShow('enq_id')}>"><{$obj->getShow('title')|truncate:100:"..."}></a> (<{$obj->mPollCount}>) <{$obj->getShow('reg_unixtime')|date_format:"%Y.%m.%d"}> + </li> + <{/foreach}> +</ul> Modified: modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php =================================================================== --- modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php 2008-12-18 13:23:22 UTC (rev 379) +++ modules_bizpoll/trunk/xoops_trust_path/modules/bizpoll/xoops_version.php 2008-12-23 12:41:37 UTC (rev 380) @@ -21,7 +21,7 @@ // Define a basic manifesto. // $modversion['name'] = _MI_BIZPOLL_LANG_BIZPOLL; -$modversion['version'] = 0.12; +$modversion['version'] = 0.13; $modversion['description'] = _MI_BIZPOLL_DESC_BIZPOLL; $modversion['author'] = _MI_BIZPOLL_LANG_AUTHOR; $modversion['credits'] = _MI_BIZPOLL_LANG_CREDITS; @@ -201,19 +201,18 @@ // Block setting // $modversion['blocks'] = array( -/* - x => array( - 'func_num' => x, - 'file' => 'xxxBlock.class.php', - 'class' => 'xxx', - 'name' => _MI_BIZPOLL_BLOCK_NAME_xxx, - 'description' => _MI_BIZPOLL_BLOCK_DESC_xxx, - 'options' => '', - 'template' => '{dirname}_block_xxx.html', + 1 => array( + 'func_num' => 1, + 'file' => 'EnqBlock.class.php', + 'class' => 'EnqBlock', + 'name' => _MI_BIZPOLL_BLOCK_NAME_ENQ, + 'description' => _MI_BIZPOLL_BLOCK_DESC_ENQ, + 'options' => '5|', + 'template' => '{dirname}_block_enq.html', 'show_all_module' => true, - 'visible_any' => 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. |