[Isocial-svn] SF.net SVN: isocial: [34]
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-02-29 15:53:22
|
Revision: 34 http://isocial.svn.sourceforge.net/isocial/?rev=34&view=rev Author: dim0s77 Date: 2008-02-29 07:53:28 -0800 (Fri, 29 Feb 2008) Log Message: ----------- added the basis for messaging Modified Paths: -------------- app/application_controller.php app/controllers/default_controller.php app/controllers/user_controller.php app/locales/layout/ru.php app/views/shared/loggedin/compiled/pageheader.tpl.php app/views/shared/loggedin/pageheader.tpl app/views/user/home.tpl public/stylesheets/Application.css Added Paths: ----------- app/controllers/message_controller.php app/installers/message_installer.php app/locales/message/ app/locales/message/en.php app/locales/message/ru.php app/views/message/ app/views/message/_menu.tpl app/views/message/inbox.tpl app/views/message/outbox.tpl app/views/message/send.tpl public/stylesheets/Message.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/application_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -150,12 +150,12 @@ function renderSidebar() { - return $this->renderShared("default/sidebar"); + return $this->renderShared("loggedin/sidebar"); } function renderPageHeader() { - return $this->renderShared("default/pageheader"); + return $this->renderShared("loggedin/pageheader"); } function _fix_email ($value) { Modified: app/controllers/default_controller.php =================================================================== --- app/controllers/default_controller.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/controllers/default_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -8,9 +8,20 @@ function index() { if ($this->_getUserFromSession()) { - $this->redirectTo(array( 'controller' => 'user', 'action' => 'index')); - } + $this->redirectTo(array( 'controller' => 'user', 'action' => 'index')); + } } + + function renderSidebar() + { + return $this->renderShared("default/sidebar"); + } + + function renderPageHeader() + { + return $this->renderShared("default/pageheader"); + } + } ?> \ No newline at end of file Added: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php (rev 0) +++ app/controllers/message_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,21 @@ +<?php + +class MessageController extends ApplicationController +{ + //var $models = 'user, message'; + + function index () { + $this->redirectTo(array('action' => 'inbox')); + } + + function inbox () { + } + + function outbox () { + } + + function send () { + } + +} +?> \ No newline at end of file Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/controllers/user_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -8,16 +8,7 @@ function beforeAction ( $method = '' ) { $user = $this->_getUserFromSession(); - if (!$user && - $method != 'login' && - $method != 'logout' && - $method != 'register' && - $method != 'thankyou' && - $method != 'laststep' && - $method != 'confirm' && - $method != 'forgot_password' && - $method != 'reset_password' - ) { + if (!$user && $method == 'home') { $this->redirectToAction( 'login' ); } } @@ -149,15 +140,15 @@ } function renderSidebar () { - if ($this->current_user) { - return $this->renderShared("loggedin/sidebar"); + if (!$this->current_user) { + return $this->renderShared("default/sidebar"); } return parent::renderSidebar(); } function renderPageHeader () { - if ($this->current_user) { - return $this->renderShared("loggedin/pageheader"); + if (!$this->current_user) { + return $this->renderShared("default/pageheader"); } return parent::renderPageHeader(); } Added: app/installers/message_installer.php =================================================================== --- app/installers/message_installer.php (rev 0) +++ app/installers/message_installer.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,28 @@ +<?php +class MessageInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `messages` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `sender_id` int(11) NOT NULL DEFAULT 0, + `recipient_id` int(11) NOT NULL DEFAULT 0, + `subject` char(255) NOT NULL DEFAULT '', + `body` text NOT NULL DEFAULT '', + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + `read` tinyint(1) NOT NULL DEFAULT '0' + ) ENGINE=InnoDB"); + + } + + function down_1() + { + /**/ + $this->dropTable('messages'); + /**/ + } +} + +?> Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/locales/layout/ru.php 2008-02-29 15:53:28 UTC (rev 34) @@ -18,6 +18,6 @@ $dictionary['or'] = 'или'; $dictionary['Profile'] = 'Профиль'; $dictionary['Friends'] = 'Друзья'; -$dictionary['Inbox'] = 'Сообщения'; +$dictionary['Messages'] = 'Сообщения'; ?> Added: app/locales/message/en.php =================================================================== --- app/locales/message/en.php (rev 0) +++ app/locales/message/en.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,7 @@ +<?php + +// File created on: 2008-02-17 15:13:51 + +$dictionary = array(); + +?> Added: app/locales/message/ru.php =================================================================== --- app/locales/message/ru.php (rev 0) +++ app/locales/message/ru.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,25 @@ +<?php + +// File created on: 2008-02-17 15:13:51 + +$dictionary = array(); +$dictionary['Inbox'] = 'Входящие'; +$dictionary['Outbox'] = 'Отправленные'; +$dictionary['Send Message'] = 'Послать сообщение'; +$dictionary['You currently don\'t have any messages'] = 'В настоящее время у Вас нет сообщений'; +$dictionary['To'] = 'Кому'; +$dictionary['Subject'] = 'Тема'; +$dictionary['Message'] = 'Сообщение'; +$dictionary['Send'] = 'Послать'; +$dictionary['Cancel'] = 'Отмена'; +$dictionary['Select'] = 'Выбрать'; +$dictionary['None'] = 'Ничего'; +$dictionary['Read'] = 'Прочтенные'; +$dictionary['Unread'] = 'Непрочтенные'; +$dictionary['All'] = 'Все'; +$dictionary['Mark as Unread'] = 'Отметить как непрочтенные'; +$dictionary['Mark as Read'] = 'Отметить как прочтенные'; +$dictionary['Delete'] = 'Удалить'; + + +?> Added: app/views/message/_menu.tpl =================================================================== --- app/views/message/_menu.tpl (rev 0) +++ app/views/message/_menu.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,12 @@ +<div class="tabs"> + <div class="left"> + <ul class="toggle_tabs"> + <li class="first"><a href="/message/inbox" class="<?= $controller->getActionName() == 'inbox' ? 'selected' : '' ?>">_{Inbox}</a></li><li><a href="/message/outbox" class="last <?= $controller->getActionName() == 'outbox' ? 'selected' : '' ?>">_{Outbox}</a></li> + </ul> + </div> + <div class="right"> + <ul class="toggle_tabs"> + <li class="first last"><a href="/message/send" class="<?= $controller->getActionName() == 'send' ? 'selected' : '' ?>">_{Send Message}</a></li> + </ul> + </div> +</div> Added: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl (rev 0) +++ app/views/message/inbox.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,25 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="inbox_submenu"> + <div class="menu_block selector"> + <label for="action_select">_{Select}: + <select class="" onchange="" id="action_select" name="action_selector"> + <option selected="selected" value="_">---------</option> + <option value="">_{None}</option> + <option value="read">_{Read}</option> + <option value="unread">_{Unread}</option> + <option value="all">_{All}</option> + </select> + </label> + </div> + <div class="menu_block"> + <ul id="inbox_action" class="buttons"> + <li class="disabled"><a href="#" onclick="" id="unread">_{Mark as Unread}</a></li> + <li class="disabled"><a href="#" onclick="" id="read">_{Mark as Read}</a></li> + <li class="disabled"><a href="#" onclick="" id="delete">_{Delete}</a></li> + </ul> + </div> +</div> +<div class="no_messages">_{You currently don't have any messages}.<br><br> + <img src="/images/icons/message.gif" alt="" class=""> <a href="/message/send">_{Send Message}.</a> +</div> Added: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl (rev 0) +++ app/views/message/outbox.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,23 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="inbox_submenu"> + <div class="menu_block selector"> + <label for="action_select">_{Select}: + <select class="" onchange="" id="action_select" name="action_selector"> + <option selected="selected" value="_">---</option> + <option value="">_{None}</option> + <option value="read">_{Read}</option> + <option value="unread">_{Unread}</option> + <option value="all">_{All}</option> + </select> + </label> + </div> + <div class="menu_block"> + <ul id="inbox_action" class="buttons"> + <li class="disabled"><a href="#" onclick="" id="delete">_{Delete}</a></li> + </ul> + </div> +</div> +<div class="no_messages">_{You currently don't have any messages}.<br><br> + <img src="/images/icons/message.gif" alt="" class=""> <a href="/message/send">_{Send Message}.</a> +</div> Added: app/views/message/send.tpl =================================================================== --- app/views/message/send.tpl (rev 0) +++ app/views/message/send.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,25 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<form action="/message/send" method="post"> + <div class="messageform"> + <div class="formrow"> + <label>_{To}:</label> + <?= $form_helper->text_field('message', '', array('class' => 'textinput') )?> + </div> + <div class="formrow"> + <label>_{Subject}:</label> + <?= $form_helper->text_field('message', 'subject', array('class' => 'textinput'))?> + </div> + <div class="formrow"> + <label>_{Message}:</label> + <textarea id="message" name="message" class="textinput"></textarea> + </div> + <div class="formrow"> + <label></label> + <input class="submitinput" type="submit" value="_{Send}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + </div> +</form> Modified: app/views/shared/loggedin/compiled/pageheader.tpl.php =================================================================== --- app/views/shared/loggedin/compiled/pageheader.tpl.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/views/shared/loggedin/compiled/pageheader.tpl.php 2008-02-29 15:53:28 UTC (rev 34) @@ -1,7 +1,7 @@ <ul id="headermenuleft"> <li><a class="globallink" href="/profile/"><?php echo $text_helper->translate('Profile', array()); ?></a> <a href="/profile/edit"><?php echo $text_helper->translate('edit', array()); ?></a></li> <li><a class="globallink" href="/friend/"><?php echo $text_helper->translate('Friends', array()); ?></a></li> - <li><a class="globallink" href="/message/"><?php echo $text_helper->translate('Inbox', array()); ?> (0)</a></li> + <li><a class="globallink" href="/message/"><?php echo $text_helper->translate('Messages', array()); ?> (0)</a></li> </ul> <ul id="headermenuright"> <li><a href="/user/logout"><?php echo $text_helper->translate('Logout', array()); ?></a></li> Modified: app/views/shared/loggedin/pageheader.tpl =================================================================== --- app/views/shared/loggedin/pageheader.tpl 2008-02-29 10:19:57 UTC (rev 33) +++ app/views/shared/loggedin/pageheader.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -1,7 +1,7 @@ <ul id="headermenuleft"> <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/edit">_{edit}</a></li> <li><a class="globallink" href="/friend/">_{Friends}</a></li> - <li><a class="globallink" href="/message/">_{Inbox} (0)</a></li> + <li><a class="globallink" href="/message/">_{Messages} (0)</a></li> </ul> <ul id="headermenuright"> <li><a href="/user/logout">_{Logout}</a></li> Modified: app/views/user/home.tpl =================================================================== --- app/views/user/home.tpl 2008-02-29 10:19:57 UTC (rev 33) +++ app/views/user/home.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -1 +1 @@ -Hello <?= $current_user->name ?> +_{Hello}, <?= $current_user->name ?> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-02-29 10:19:57 UTC (rev 33) +++ public/stylesheets/Application.css 2008-02-29 15:53:28 UTC (rev 34) @@ -3,7 +3,7 @@ font-size: 11px; } -input { +input, textarea { padding: 3px; border: 1px solid #bdc7d8; font-family: verdana, arial, sans-serif; @@ -17,17 +17,23 @@ font-weight: bolder; } - label.persistent { line-height: 16px; font: 11px normal; padding: 1px 0px 3px 0px; } -label input { +label input, label select { font-weight: normal; } +select{ + border:1px solid #BDC7D8; + font-family:verdana,arial,sans-serif; + font-size:11px; + padding:2px; +} + a { color: #3b5998; text-decoration: none; @@ -183,7 +189,7 @@ #pagecontent #content { clear: both; - padding: 20px; + padding: 0; } #pagefooter { @@ -258,6 +264,17 @@ border-right: 1px solid #0e1f5b; } +.cancelinput { + cursor: pointer; + color: black; + background-color: lightgray; + padding: 2px 15px 3px 15px; + margin: 5px 0px 5px 0px; + border-top: 1px solid #d9dfea; + border-left: 1px solid #d9dfea; + border-bottom: 1px solid #0e1f5b; + border-right: 1px solid #0e1f5b; +} .textinput, .passwordinput { width: 123px; @@ -291,7 +308,7 @@ #content .title { font-weight: bold; font-size: 13px; - padding: 0px 0px 10px 0px; + padding: 10px 20px; border-bottom: 1px solid #dddddd; margin-bottom: 10px; } Added: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css (rev 0) +++ public/stylesheets/Message.css 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,57 @@ +#content .tabs { padding: 20px 0 15px; border-bottom:1px solid #898989; display:block; } +.tabs .left { padding-left: 10px; float: left; } +.tabs .right { padding-right:10px;float:right; } + +.toggle_tabs { margin:0; padding:0; list-style:none; text-align:center; display: block; } +.toggle_tabs li { display:inline; padding:2px 0px 3px; background:#f1f1f1; } +.toggle_tabs li a { border:1px solid #898989; border-left:0; color:#333; font-weight:bold; padding:2px 8px 3px 9px; } +.toggle_tabs li a small { font-size:11px; font-weight:normal; } +.toggle_tabs li a:focus { outline:0px; } +.toggle_tabs li.first a { border:1px solid #898989; } +.toggle_tabs li a.selected { margin-left:-1px; background:#6d84b4; border:1px solid #3b5998; border-left:1px solid #5973a9; border-right:1px solid #5973a9; color:#fff; } +.toggle_tabs li.last a.selected { margin-left:-1px; border-left:1px solid #5973a9; border-right:1px solid #36538f; } +.toggle_tabs li.first a.selected { margin:0; border-left:1px solid #36538f; border-right:1px solid #5973a9; } +.toggle_tabs li.first.last a.selected { border:1px solid #36538f; } +.toggle_tabs li a.selected:hover { text-decoration:none; } +.toggle_tabs li a.disabled { color:#999;cursor:default; } +.toggle_tabs li a.disabled:hover { text-decoration:none; } + +#content .inbox_submenu { background:#f7f7f7; border-bottom:1px solid #ccc; padding: 8px 20px 28px; } +.inbox_submenu .menu_block { float:left; } +.inbox_submenu .menu_block.selector { padding-right:5px; } +.inbox_submenu .menu_block.selector select { margin-left:5px; } +.inbox_submenu .buttons { list-style:none; margin:0px; padding:0px; } +.inbox_submenu .buttons li { float:left; } +.inbox_submenu .buttons li a { padding:4px 5px 4px 5px; display:block; } +.inbox_submenu .disabled a { color:#aaa; } +.inbox_submenu .disabled a:hover { cursor:default; text-decoration:none; } + +.no_messages { color:#666; font-size:13px; padding:100px 0px 110px 0px; text-align:center; } +.no_messages strong { color:#333; font-weight:bold; } + +#content .messageform { + margin: 20px auto 20px auto; + width: 510px; +} + +.messageform .formrow { + vertical-align: top; + padding: 0px 0px 3px 0px; +} + +.formrow label { + display: block; + width: 90px; + float: left; + text-align: right; + padding: 3px 10px 3px; +} + +.formrow textarea { + height: 150px; +} + +.formrow .textinput { + width: 350px; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |