From ae737786d25907b4e499389f2aad567e1be3300f Mon Sep 17 00:00:00 2001 From: PhilBau Date: Thu, 3 Jan 2013 16:00:32 +0100 Subject: [PATCH] Shoutit to ShoutIt refactoring. --- docs/changelog.txt | 2 +- docs/credits.txt | 2 +- javascript/{Shoutit.js => ShoutIt.js} | 6 +++--- lib/{Shoutit => ShoutIt}/Api/User.php | 14 +++++++------- .../Shoutit.php => ShoutIt/Block/ShoutIt.php} | 18 +++++++++--------- lib/{Shoutit => ShoutIt}/Controller/Ajax.php | 12 ++++++------ lib/{Shoutit => ShoutIt}/Installer.php | 14 +++++++------- lib/{Shoutit => ShoutIt}/Version.php | 10 +++++----- style/style.css | 4 ++-- templates/admin/block_modify.tpl | 6 +++--- templates/user/box.tpl | 6 +++--- 11 files changed, 47 insertions(+), 47 deletions(-) rename javascript/{Shoutit.js => ShoutIt.js} (95%) rename lib/{Shoutit => ShoutIt}/Api/User.php (91%) rename lib/{Shoutit/Block/Shoutit.php => ShoutIt/Block/ShoutIt.php} (89%) rename lib/{Shoutit => ShoutIt}/Controller/Ajax.php (83%) rename lib/{Shoutit => ShoutIt}/Installer.php (82%) rename lib/{Shoutit => ShoutIt}/Version.php (88%) diff --git a/docs/changelog.txt b/docs/changelog.txt index 0fb20c7..c8a4fe3 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -7,4 +7,4 @@ - New features: - Send a message to a specific group only - Block settings available : length of a message, number of messages displayed, - refresh rate (common to all Shoutit blocks) + refresh rate (common to all ShoutIt blocks) diff --git a/docs/credits.txt b/docs/credits.txt index 2cf2828..25c25b5 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -1,4 +1,4 @@ -Shoutit 2.x & 3.x: +ShoutIt 2.x & 3.x: ------------------- Gabriel Freinbichler Philippe Baudrion - UniGE/FTI: Zikula 1.3.x refactoring diff --git a/javascript/Shoutit.js b/javascript/ShoutIt.js similarity index 95% rename from javascript/Shoutit.js rename to javascript/ShoutIt.js index be9e346..fa1fc13 100644 --- a/javascript/Shoutit.js +++ b/javascript/ShoutIt.js @@ -1,5 +1,5 @@ /** - * Shoutit module for Zikula Application Framework + * ShoutIt module for Zikula Application Framework * @author Gabriel Freinbichler * refactored for zk 1.3 by Philippe Baudrion - UniGE/FTI */ @@ -23,7 +23,7 @@ this.updater = new Ajax.PeriodicalUpdater( 'shoutitcontent_' + this.bid, - Zikula.Config.baseURL + 'ajax.php?module=Shoutit&func=getmessages', + Zikula.Config.baseURL + 'ajax.php?module=ShoutIt&func=getmessages', { method: 'post', parameters: {bid: this.bid}, @@ -43,7 +43,7 @@ if (((this.grpMsg == '1' && e != '-') && m != '') || (this.grpMsg == '0' && m != '')) { new Zikula.Ajax.Request( - Zikula.Config.baseURL + "ajax.php?module=Shoutit&func=savemessages", + Zikula.Config.baseURL + "ajax.php?module=ShoutIt&func=savemessages", { method: 'post', parameters: diff --git a/lib/Shoutit/Api/User.php b/lib/ShoutIt/Api/User.php similarity index 91% rename from lib/Shoutit/Api/User.php rename to lib/ShoutIt/Api/User.php index c38c92a..818424b 100644 --- a/lib/Shoutit/Api/User.php +++ b/lib/ShoutIt/Api/User.php @@ -1,6 +1,6 @@ 'users', // table for the join @@ -43,8 +43,8 @@ public function getMessages($args) { ); // Only select user own messages and messages from own registered group(s) - if(ModUtil::getVar('Shoutit', "shoutit_group_messages_{$bid}") == '1' && - !SecurityUtil::checkPermission('Shoutit::', $bid.'::', ACCESS_MODERATE)) { + if(ModUtil::getVar('ShoutIt', "shoutit_group_messages_{$bid}") == '1' && + !SecurityUtil::checkPermission('ShoutIt::', $bid.'::', ACCESS_MODERATE)) { $uid = UserUtil::getVar('uid'); $where = "WHERE $shColumn[cr_uid] = $uid"; @@ -104,7 +104,7 @@ public function deleteMessages($args) { return LogUtil::registerArgsError(); } - $this->throwForbiddenUnless(SecurityUtil::checkPermission('Shoutit::', $args['bid'].'::', ACCESS_DELETE), LogUtil::getErrorMsgPermission()); + $this->throwForbiddenUnless(SecurityUtil::checkPermission('ShoutIt::', $args['bid'].'::', ACCESS_DELETE), LogUtil::getErrorMsgPermission()); $tables = DBUtil::getTables(); $shColumns = $tables['shoutit_messages_column']; @@ -120,4 +120,4 @@ public function deleteMessages($args) { } // end of class } -?> \ No newline at end of file +?> diff --git a/lib/Shoutit/Block/Shoutit.php b/lib/ShoutIt/Block/ShoutIt.php similarity index 89% rename from lib/Shoutit/Block/Shoutit.php rename to lib/ShoutIt/Block/ShoutIt.php index e14377e..c0195ec 100644 --- a/lib/Shoutit/Block/Shoutit.php +++ b/lib/ShoutIt/Block/ShoutIt.php @@ -1,6 +1,6 @@ = 20) ? $msgLength : '20'; if($delMsg) { - ModUtil::apiFunc('Shoutit', 'user', 'deleteMessages', array( + ModUtil::apiFunc('ShoutIt', 'user', 'deleteMessages', array( 'bid' => $blockinfo['bid'] )); } @@ -143,9 +143,9 @@ public function update($blockinfo) $vars['grpMsg'] = $grpMsg; $vars['delMsg'] = '0'; - ModUtil::setVar('Shoutit', "shoutit_lastx_messages_{$blockinfo['bid']}", $nbMsg); - ModUtil::setVar('Shoutit', 'shoutit_refresh_rate', $refRate); - ModUtil::setVar('Shoutit', "shoutit_group_messages_{$blockinfo['bid']}", $grpMsg); + ModUtil::setVar('ShoutIt', "shoutit_lastx_messages_{$blockinfo['bid']}", $nbMsg); + ModUtil::setVar('ShoutIt', 'shoutit_refresh_rate', $refRate); + ModUtil::setVar('ShoutIt', "shoutit_group_messages_{$blockinfo['bid']}", $grpMsg); $blockinfo['content'] = BlockUtil::varsToContent($vars); diff --git a/lib/Shoutit/Controller/Ajax.php b/lib/ShoutIt/Controller/Ajax.php similarity index 83% rename from lib/Shoutit/Controller/Ajax.php rename to lib/ShoutIt/Controller/Ajax.php index dec365c..a8ecdfb 100644 --- a/lib/Shoutit/Controller/Ajax.php +++ b/lib/ShoutIt/Controller/Ajax.php @@ -1,6 +1,6 @@ __('Ajax Error! Missing required parameter.')); } - $this->throwForbiddenUnless(SecurityUtil::checkPermission('Shoutit::', $bid.'::', ACCESS_OVERVIEW), LogUtil::getErrorMsgPermission()); + $this->throwForbiddenUnless(SecurityUtil::checkPermission('ShoutIt::', $bid.'::', ACCESS_OVERVIEW), LogUtil::getErrorMsgPermission()); - $messages = ModUtil::apiFunc('Shoutit', 'user', 'getMessages', array('bid' => $bid)); + $messages = ModUtil::apiFunc('ShoutIt', 'user', 'getMessages', array('bid' => $bid)); Zikula_AbstractController::configureView(); $this->view->setCaching(Zikula_View::CACHE_DISABLED); @@ -52,9 +52,9 @@ public function savemessages() throw new Zikula_Exception_Fatal($this->__('Ajax Error! Missing required parameter.')); } - $this->throwForbiddenUnless(SecurityUtil::checkPermission('Shoutit::', $bid.'::', ACCESS_COMMENT), LogUtil::getErrorMsgPermission()); + $this->throwForbiddenUnless(SecurityUtil::checkPermission('ShoutIt::', $bid.'::', ACCESS_COMMENT), LogUtil::getErrorMsgPermission()); - $result = ModUtil::apiFunc('Shoutit', 'user', 'saveMessages', array( + $result = ModUtil::apiFunc('ShoutIt', 'user', 'saveMessages', array( 'message' => $message, 'gid' => $gid, 'bid' => $bid diff --git a/lib/Shoutit/Installer.php b/lib/ShoutIt/Installer.php similarity index 82% rename from lib/Shoutit/Installer.php rename to lib/ShoutIt/Installer.php index 687d7e8..9949564 100644 --- a/lib/Shoutit/Installer.php +++ b/lib/ShoutIt/Installer.php @@ -1,6 +1,6 @@ version->getHookSubscriberBundles()); @@ -46,7 +46,7 @@ public function upgrade($oldversion) { case '2.0': // Module variables initialisation - ModUtil::setVar('Shoutit', 'shoutit_refresh_rate', '10'); + ModUtil::setVar('ShoutIt', 'shoutit_refresh_rate', '10'); // Register hook HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles()); @@ -55,14 +55,14 @@ public function upgrade($oldversion) } /** - * Deletes Shoutit modules + * Deletes ShoutIt modules * * @return boolean true/false */ public function uninstall() { $result = DBUtil::dropTable('shoutit_messages'); - $result = $result && ModUtil::delVar('Shoutit'); + $result = $result && ModUtil::delVar('ShoutIt'); HookUtil::unregisterSubscriberBundles($this->version->getHookSubscriberBundles()); diff --git a/lib/Shoutit/Version.php b/lib/ShoutIt/Version.php similarity index 88% rename from lib/Shoutit/Version.php rename to lib/ShoutIt/Version.php index bb7f28a..b129157 100644 --- a/lib/Shoutit/Version.php +++ b/lib/ShoutIt/Version.php @@ -1,6 +1,6 @@ __('Shoutit'); + $meta['name'] = 'ShoutIt'; + $meta['displayname'] = $this->__('ShoutIt'); $meta['description'] = $this->__('Ajax shoutbox'); $meta['version'] = '3.0.0'; $meta['url'] = $this->__('shoutit'); @@ -28,7 +28,7 @@ public function getMetaData() $meta['official'] = 0; $meta['author'] = 'Gabriel Freinbichler & Philippe Baudrion - UniGE/FTI'; $meta['contact'] = 'http://www.cmods-dev.de'; - $meta['securityschema'] = array('Shoutit::' => 'gid::'); + $meta['securityschema'] = array('ShoutIt::' => 'gid::'); $meta['core_min'] = '1.3.0'; $meta['core_max'] = '1.3.99'; diff --git a/style/style.css b/style/style.css index 93343a0..64076f7 100644 --- a/style/style.css +++ b/style/style.css @@ -1,5 +1,5 @@ /** - * Shoutit module for Zikula + * ShoutIt module for Zikula * @author Gabriel Freinbichler & refactored by Philippe Baudrion UniGE/FTI */ .shoutit_contentwrap{border:1px dashed #CCCCCC;height:200px;margin-bottom:5px;overflow: auto;} @@ -12,4 +12,4 @@ .shoutit_counter{width:2.2em;border:none;} .shoutit_message{border:1px solid #CCCCCC;margin:3px 0px;padding:3px 2px; width:97%} .shoutit_button{margin-top: 4px;} -.shoutit_input .bb_standardsmilies{width:99% !important;} \ No newline at end of file +.shoutit_input .bb_standardsmilies{width:99% !important;} diff --git a/templates/admin/block_modify.tpl b/templates/admin/block_modify.tpl index 067eee1..0de5cda 100644 --- a/templates/admin/block_modify.tpl +++ b/templates/admin/block_modify.tpl @@ -7,7 +7,7 @@
- {gt text="Common value for all Shoutit block instances.
Default is 8, minimum is 6"}
+ {gt text="Common value for all ShoutIt block instances.
Default is 8, minimum is 6"}
@@ -23,11 +23,11 @@ {else} {/if} - {gt text='Only display user messages and messages from same user group(s).
Please set Shoutit permissions according your needs before (Read install.txt).'}
+ {gt text='Only display user messages and messages from same user group(s).
Please set ShoutIt permissions according your needs before (Read install.txt).'}
{gt text='Tick the box, be careful when pressing \'Save\' this will delete all messages from the block.'} -
\ No newline at end of file + diff --git a/templates/user/box.tpl b/templates/user/box.tpl index 0c84fc0..f82afcd 100644 --- a/templates/user/box.tpl +++ b/templates/user/box.tpl @@ -1,5 +1,5 @@ {* $Id$ *} -{ajaxheader modname='Shoutit' filename='Shoutit.js'} +{ajaxheader modname='ShoutIt' filename='ShoutIt.js'}
@@ -31,8 +31,8 @@ {/if} {* pndebug *} -
\ No newline at end of file +