Thread: [Isocial-svn] SF.net SVN: isocial: [139] app (Page 2)
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <agu...@us...> - 2008-05-01 07:07:58
|
Revision: 139 http://isocial.svn.sourceforge.net/isocial/?rev=139&view=rev Author: aguidrevitch Date: 2008-05-01 00:08:03 -0700 (Thu, 01 May 2008) Log Message: ----------- initial dialog helper upload Modified Paths: -------------- app/application_controller.php Added Paths: ----------- app/helpers/dialog_helper.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-04-30 16:24:59 UTC (rev 138) +++ app/application_controller.php 2008-05-01 07:08:03 UTC (rev 139) @@ -20,8 +20,8 @@ var $_errors = array(); - var $app_models = array('User', 'Message', 'Country', 'Region', 'City'); - var $app_helpers = array('AutoComplete', 'City'); + var $app_models = array('User', 'Message'); + var $app_helpers = array('AutoComplete', 'City', 'Dialog'); var $current_user; function __construct () { Added: app/helpers/dialog_helper.php =================================================================== --- app/helpers/dialog_helper.php (rev 0) +++ app/helpers/dialog_helper.php 2008-05-01 07:08:03 UTC (rev 139) @@ -0,0 +1,32 @@ +<?php + +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'javascript_helper.php'); + +class DialogHelper extends AkActionViewHelper +{ + + function dialog ($function_name, $title, $body, $onyes) { + + $id = $this->id($function_name); + $content = "<div id='$id' style='display: none'>$body</div>"; + $function = " +function {$function_name} (element) { + return new Dialog.Box('dlg', { + reference: element, + title: '" . $this->t($title) . "', + body: \$('$id').show(), + yes: '" . $this->t('Save') . "', + cancel: '" . $this->t('Cancel') . "', + onYes : function () { $onyes } + }); +}"; + + return $content . JavaScriptHelper::javascript_tag($function); + } + + function id ($function_name) { + return $function_name . '_content'; + } +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-05 16:54:02
|
Revision: 163 http://isocial.svn.sourceforge.net/isocial/?rev=163&view=rev Author: fsnobody Date: 2008-05-05 09:54:03 -0700 (Mon, 05 May 2008) Log Message: ----------- changed action Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/edit_info.tpl app/views/photoapp/album/index.tpl Removed Paths: ------------- app/views/photoapp/album/add_photos.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-05 09:53:02 UTC (rev 162) +++ app/controllers/photoapp/album_controller.php 2008-05-05 16:54:03 UTC (rev 163) @@ -39,10 +39,10 @@ } - function add_photos () { + function add_photo () { } - function edit () { + function edit_info () { } function help () { Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-05 09:53:02 UTC (rev 162) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-05 16:54:03 UTC (rev 163) @@ -1,9 +1,9 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/photoapp/album/add_photos" class="<?= $controller->getActionName() == 'add_photos' ? 'selected' : '' ?>">_{Add Photos}</a></li><? - ?><li><a href="/photoapp/album/edit_info" class="last <?= $controller->getActionName() == 'edit_info' ? 'selected' : '' ?>">_{Edit Info}</a></li><? - ?><li><a href="/photoapp/album/delete" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> + <li class="first"><a href="/photoapp/album/add_photo/{id}" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li><a href="/photoapp/album/edit_info/{id}" class="last <?= $controller->getActionName() == 'edit_info' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/delete/{id}" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> </div> <div class="right"> Deleted: app/views/photoapp/album/add_photos.tpl =================================================================== --- app/views/photoapp/album/add_photos.tpl 2008-05-05 09:53:02 UTC (rev 162) +++ app/views/photoapp/album/add_photos.tpl 2008-05-05 16:54:03 UTC (rev 163) @@ -1,17 +0,0 @@ - -<?= $controller->renderErrors() ?> - -<div class="title_bar"> - <div class="info"> - <div class="header"> - <div class="name">_{Edit Album}</div> - </div> - <div class="clearfix"></div> - </div> -</div> -<div class="clearfix"></div> - -<?= $controller->renderPartial("edit_menu") ?> - - - Modified: app/views/photoapp/album/edit_info.tpl =================================================================== --- app/views/photoapp/album/edit_info.tpl 2008-05-05 09:53:02 UTC (rev 162) +++ app/views/photoapp/album/edit_info.tpl 2008-05-05 16:54:03 UTC (rev 163) @@ -15,3 +15,48 @@ +<div class="album_step"> + <form action="/photoapp/album/update/{id}" method="post"> + <div class="form_create_clear"> + + <div class="form_create_row"> + <label >_{Name}:</label> + <div class="form_create_col"> + <?= $form_helper->text_field('album', 'name', array('class' => 'text_input small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label >_{Description}:</label> + <div class="form_create_col"> + <?= $form_helper->text_area('album', 'description', array('rows' => '5', 'class' => 'small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label >_{Privacy}:</label> + <div class="form_create_col"> + <select> + <option>Everyone</option> + <option>Friends of Friends</option> + <option>Only Friends</option> + <option>Customize...</option> + </select> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <input class="submitinput" type="submit" value="_{Update Info}"/> + </div> + </div> + <div class="clearfix"></div> + + </div> + </form> +</div> +<div class="clearfix"></div> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-05 09:53:02 UTC (rev 162) +++ app/views/photoapp/album/index.tpl 2008-05-05 16:54:03 UTC (rev 163) @@ -34,7 +34,7 @@ <div class="photos_count">_{Created} April 25</div> </div> <div class="links"> - <div><a href="/photoapp/album/edit/<?= $my_album->get('id')?>">_{Edit Album}</a></div> + <div><a href="/photoapp/album/add_photo/<?= $my_album->get('id')?>">_{Edit Album}</a></div> <div><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></div> <div><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-05-06 07:33:58
|
Revision: 165 http://isocial.svn.sourceforge.net/isocial/?rev=165&view=rev Author: aguidrevitch Date: 2008-05-06 00:34:04 -0700 (Tue, 06 May 2008) Log Message: ----------- minor refactoring Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/_edit_menu.tpl Added Paths: ----------- app/views/photoapp/album/_form.tpl app/views/photoapp/album/add.tpl app/views/photoapp/album/edit.tpl Removed Paths: ------------- app/views/photoapp/album/create.tpl app/views/photoapp/album/edit_info.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-06 06:17:06 UTC (rev 164) +++ app/controllers/photoapp/album_controller.php 2008-05-06 07:34:04 UTC (rev 165) @@ -25,7 +25,7 @@ function create () { } */ - function create () { + function add () { if (!empty($this->params['album'])){ $this->PhotoappAlbum->setAttributes($this->params['album']); $this->PhotoappAlbum->owner = $this->current_user->getId(); @@ -42,7 +42,21 @@ function add_photo () { } - function edit_info () { + function edit () { + if (!empty($this->params['album'])){ + $this->PhotoappAlbum->setAttributes($this->params['album']); + $this->PhotoappAlbum->owner = $this->current_user->getId(); + if ($this->Request->isPost() && $this->PhotoappAlbum->save()){ + // success + $this->redirectTo(array('action' => 'index')); + } else { + $this->importErrors( $this->PhotoappAlbum->getErrors() ); + } + } else if ($this->params['id']) { + $this->album = $this->PhotoappAlbum->find($this->params['id']); + return; + } + } function help () { Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-06 06:17:06 UTC (rev 164) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-06 07:34:04 UTC (rev 165) @@ -2,7 +2,7 @@ <div class="left"> <ul class="toggle_tabs"> <li class="first"><a href="/photoapp/album/add_photo/{id}" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? - ?><li><a href="/photoapp/album/edit_info/{id}" class="last <?= $controller->getActionName() == 'edit_info' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/edit/{id}" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? ?><li><a href="/photoapp/album/delete/{id}" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> </div> Added: app/views/photoapp/album/_form.tpl =================================================================== --- app/views/photoapp/album/_form.tpl (rev 0) +++ app/views/photoapp/album/_form.tpl 2008-05-06 07:34:04 UTC (rev 165) @@ -0,0 +1,40 @@ + <div class="form_create_clear"> + + <div class="form_create_row"> + <label >_{Name}:</label> + <div class="form_create_col"> + <?= $form_helper->text_field('album', 'name', array('class' => 'textinput small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label >_{Description}:</label> + <div class="form_create_col"> + <?= $form_helper->text_area('album', 'description', array('rows' => '5', 'class' => 'small')) ?> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label >_{Privacy}:</label> + <div class="form_create_col"> + <select> + <option>Everyone</option> + <option>Friends of Friends</option> + <option>Only Friends</option> + <option>Customize...</option> + </select> + </div> + </div> + <div class="clearfix"></div> + + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <input class="submitinput" type="submit" value="_{Create Album}"/> + </div> + </div> + <div class="clearfix"></div> + + </div> Added: app/views/photoapp/album/add.tpl =================================================================== --- app/views/photoapp/album/add.tpl (rev 0) +++ app/views/photoapp/album/add.tpl 2008-05-06 07:34:04 UTC (rev 165) @@ -0,0 +1,20 @@ + +<?= $controller->renderErrors() ?> + +<div class="title_bar"> + <div class="info"> + <div class="header"> + <div class="name">_{Create Album}</div> + </div> + <div class="clearfix"></div> + </div> +</div> +<div class="clearfix"></div> + + +<div class="album_step"> + <?= $form_tag_helper->start_form_tag(array('action'=>'add')) ?> + <?= $controller->renderPartial('form') ?> + </form> +</div> +<div class="clearfix"></div> \ No newline at end of file Deleted: app/views/photoapp/album/create.tpl =================================================================== --- app/views/photoapp/album/create.tpl 2008-05-06 06:17:06 UTC (rev 164) +++ app/views/photoapp/album/create.tpl 2008-05-06 07:34:04 UTC (rev 165) @@ -1,59 +0,0 @@ - -<?= $controller->renderErrors() ?> - -<div class="title_bar"> - <div class="info"> - <div class="header"> - <div class="name">_{Create Album}</div> - </div> - <div class="clearfix"></div> - </div> -</div> -<div class="clearfix"></div> - - -<div class="album_step"> - <form action="/photoapp/album/create" method="post"> - <div class="form_create_clear"> - - <div class="form_create_row"> - <label >_{Name}:</label> - <div class="form_create_col"> - <?= $form_helper->text_field('album', 'name', array('class' => 'text_input small')) ?> - </div> - </div> - <div class="clearfix"></div> - - <div class="form_create_row"> - <label >_{Description}:</label> - <div class="form_create_col"> - <?= $form_helper->text_area('album', 'description', array('rows' => '5', 'class' => 'small')) ?> - </div> - </div> - <div class="clearfix"></div> - - <div class="form_create_row"> - <label >_{Privacy}:</label> - <div class="form_create_col"> - <select> - <option>Everyone</option> - <option>Friends of Friends</option> - <option>Only Friends</option> - <option>Customize...</option> - </select> - </div> - </div> - <div class="clearfix"></div> - - <div class="form_create_row"> - <label > </label> - <div class="form_create_col"> - <input class="submitinput" type="submit" value="_{Create Album}"/> - </div> - </div> - <div class="clearfix"></div> - - </div> - </form> -</div> -<div class="clearfix"></div> \ No newline at end of file Added: app/views/photoapp/album/edit.tpl =================================================================== --- app/views/photoapp/album/edit.tpl (rev 0) +++ app/views/photoapp/album/edit.tpl 2008-05-06 07:34:04 UTC (rev 165) @@ -0,0 +1,22 @@ + +<?= $controller->renderErrors() ?> + +<div class="title_bar"> + <div class="info"> + <div class="header"> + <div class="name">_{Edit Album}</div> + </div> + <div class="clearfix"></div> + </div> +</div> +<div class="clearfix"></div> + +<?= $controller->renderPartial("edit_menu") ?> + + +<div class="album_step"> + <?= $form_tag_helper->start_form_tag(array('action'=>'edit', 'id' => $album->getId())) ?> + <?= $controller->renderPartial("form") ?> + </form> +</div> +<div class="clearfix"></div> Deleted: app/views/photoapp/album/edit_info.tpl =================================================================== --- app/views/photoapp/album/edit_info.tpl 2008-05-06 06:17:06 UTC (rev 164) +++ app/views/photoapp/album/edit_info.tpl 2008-05-06 07:34:04 UTC (rev 165) @@ -1,62 +0,0 @@ - -<?= $controller->renderErrors() ?> - -<div class="title_bar"> - <div class="info"> - <div class="header"> - <div class="name">_{Edit Album}</div> - </div> - <div class="clearfix"></div> - </div> -</div> -<div class="clearfix"></div> - -<?= $controller->renderPartial("edit_menu") ?> - - - -<div class="album_step"> - <form action="/photoapp/album/update/{id}" method="post"> - <div class="form_create_clear"> - - <div class="form_create_row"> - <label >_{Name}:</label> - <div class="form_create_col"> - <?= $form_helper->text_field('album', 'name', array('class' => 'text_input small')) ?> - </div> - </div> - <div class="clearfix"></div> - - <div class="form_create_row"> - <label >_{Description}:</label> - <div class="form_create_col"> - <?= $form_helper->text_area('album', 'description', array('rows' => '5', 'class' => 'small')) ?> - </div> - </div> - <div class="clearfix"></div> - - <div class="form_create_row"> - <label >_{Privacy}:</label> - <div class="form_create_col"> - <select> - <option>Everyone</option> - <option>Friends of Friends</option> - <option>Only Friends</option> - <option>Customize...</option> - </select> - </div> - </div> - <div class="clearfix"></div> - - <div class="form_create_row"> - <label > </label> - <div class="form_create_col"> - <input class="submitinput" type="submit" value="_{Update Info}"/> - </div> - </div> - <div class="clearfix"></div> - - </div> - </form> -</div> -<div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-07 05:58:34
|
Revision: 173 http://isocial.svn.sourceforge.net/isocial/?rev=173&view=rev Author: fsnobody Date: 2008-05-06 22:58:38 -0700 (Tue, 06 May 2008) Log Message: ----------- photos installer add Modified Paths: -------------- app/views/photoapp/album/index.tpl Added Paths: ----------- app/installers/photoapp/photo_installer.php Added: app/installers/photoapp/photo_installer.php =================================================================== --- app/installers/photoapp/photo_installer.php (rev 0) +++ app/installers/photoapp/photo_installer.php 2008-05-07 05:58:38 UTC (rev 173) @@ -0,0 +1,31 @@ +<?php +class PhotoInstaller extends AkInstaller +{ + var $module = 'photoapp'; + + function up_1() + { + + $this->execute( + "CREATE TABLE `photoapp_photos` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `album_id` int(11) NOT NULL , + `is_cover` int(1) UNSIGNED NOT NULL DEFAULT '0', + `name` char(100) NOT NULL DEFAULT '', + `caption` char(255) NOT NULL DEFAULT '', + `created_at` datetime NOT NULL , + `img` char(255) NOT NULL DEFAULT '', + `img_preview` char(255) NOT NULL DEFAULT '', + `img_small` char(255) NOT NULL DEFAULT '' + + ) ENGINE=InnoDB"); + + } + + function down_1() + { + $this->dropTable('photoapp_photo'); + } +} + +?> \ No newline at end of file Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-07 05:35:43 UTC (rev 172) +++ app/views/photoapp/album/index.tpl 2008-05-07 05:58:38 UTC (rev 173) @@ -39,11 +39,6 @@ <li><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></li> <li><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></li> </ul> -<!-- - <div><a href="/photoapp/album/add_photo/<?= $my_album->get('id')?>">_{Edit Album}</a></div> - <div><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></div> - <div><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></div> ---> </div> </div> {end} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-07 07:55:08
|
Revision: 175 http://isocial.svn.sourceforge.net/isocial/?rev=175&view=rev Author: fsnobody Date: 2008-05-07 00:55:15 -0700 (Wed, 07 May 2008) Log Message: ----------- fixez Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/locales/photoapp/album/ru.php app/views/photoapp/album/add.tpl app/views/photoapp/album/add_photo.tpl app/views/photoapp/album/index.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-07 07:40:02 UTC (rev 174) +++ app/controllers/photoapp/album_controller.php 2008-05-07 07:55:15 UTC (rev 175) @@ -46,6 +46,7 @@ if (!empty($this->params['album'])){ // + print_r($this->params['album']); } else if ($this->params['id']) { $this->album = $this->PhotoappAlbum->find($this->params['id']); return; Modified: app/locales/photoapp/album/ru.php =================================================================== --- app/locales/photoapp/album/ru.php 2008-05-07 07:40:02 UTC (rev 174) +++ app/locales/photoapp/album/ru.php 2008-05-07 07:55:15 UTC (rev 175) @@ -6,7 +6,7 @@ $dictionary['My Photos'] = 'Мои Фото'; $dictionary['Photos'] = 'Фото'; -$dictionary['Photos of You'] = 'Фото для Вас'; +$dictionary['Photos of You'] = 'Фото с Вами'; $dictionary['Create a Photo Album'] = 'Создать фото альбом'; $dictionary['Welcome to PROJECT_NAME Photos'] = 'Добро пожаловать в PROJECT_NAME Фото'; $dictionary['Name'] = 'Название'; @@ -15,16 +15,16 @@ $dictionary['Privacy'] = 'Доступ'; $dictionary['Create Album'] = 'Создать альбом'; -$dictionary['My Albums'] = 'Мои Альбомы'; +$dictionary['My Albums'] = 'Мои альбомы'; $dictionary['Create a New Album'] = 'Создать новый альбом'; $dictionary['You have no any album'] = 'У вас нет альбомов'; $dictionary['Photo Albums'] = 'Фото альбомов'; $dictionary['Album Privacy'] = 'Доступ альбомов'; $dictionary['Description'] = 'Описание'; $dictionary['Created'] = 'Создан'; -$dictionary['Edit Album'] = 'Редактировать Альбом'; -$dictionary['View Album'] = 'Просмотр Альбома'; -$dictionary['Delete Album'] = 'Удаление Альбома'; +$dictionary['Edit Album'] = 'Редактировать альбом'; +$dictionary['View Album'] = 'Просмотр альбома'; +$dictionary['Delete Album'] = 'Удаление альбома'; $dictionary['photos'] = 'фотографий'; $dictionary['Upload'] = 'Загрузить'; $dictionary['Choose'] = 'Обзор'; Modified: app/views/photoapp/album/add.tpl =================================================================== --- app/views/photoapp/album/add.tpl 2008-05-07 07:40:02 UTC (rev 174) +++ app/views/photoapp/album/add.tpl 2008-05-07 07:55:15 UTC (rev 175) @@ -1,6 +1,3 @@ - -<?= $controller->renderErrors() ?> - <div class="title_bar"> <div class="info"> <div class="header"> @@ -11,6 +8,7 @@ </div> <div class="clearfix"></div> +<?= $controller->renderErrors() ?> <div class="album_step"> <?= $form_tag_helper->start_form_tag(array('action'=>'add')) ?> Modified: app/views/photoapp/album/add_photo.tpl =================================================================== --- app/views/photoapp/album/add_photo.tpl 2008-05-07 07:40:02 UTC (rev 174) +++ app/views/photoapp/album/add_photo.tpl 2008-05-07 07:55:15 UTC (rev 175) @@ -15,6 +15,7 @@ <div class="album_step"> <?= $form_tag_helper->start_form_tag(array('action'=>'add_photo', 'id' => $album->getId())) ?> + <div class="form_create_clear red"> <div class="form_create_row"> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-07 07:40:02 UTC (rev 174) +++ app/views/photoapp/album/index.tpl 2008-05-07 07:55:15 UTC (rev 175) @@ -21,7 +21,7 @@ <? } else {?> <div class="album_list"> - <?= $count_albums?> _{Photo Albums} <span>|</span> <a href="#" >_{Album Privacy}</a> + _{Photo Albums}: <?= $count_albums?> <span>|</span> <a href="#" >_{Album Privacy}</a> </div> <div class="container"> {loop my_albums} @@ -29,9 +29,9 @@ <div class="img">IMG</div> <div class="info"> <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->get('id')?>"><?= $my_album->get('name') ?></a></div> - <div class="photos_count"><?= $my_album->get('photos_count')?> _{photos}</div> + <div class="photos_count">_{photos}: <?= $my_album->get('photos_count')?> </div> <div class="description">_{Description}: <?= $my_album->get('description')?></div> - <div class="photos_count">_{Created} <?= strftime("%b %e", strtotime($my_album->get('created_at')))?></div> + <div class="photos_count">_{Created}: <?= $my_album->get('created_at')?></div> </div> <div class="links"> <ul class="actions_list"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-12 09:21:43
|
Revision: 181 http://isocial.svn.sourceforge.net/isocial/?rev=181&view=rev Author: fsnobody Date: 2008-05-12 02:21:48 -0700 (Mon, 12 May 2008) Log Message: ----------- can upload up to 5 img Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/uploaded.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-09 12:13:00 UTC (rev 180) +++ app/controllers/photoapp/album_controller.php 2008-05-12 09:21:48 UTC (rev 181) @@ -83,9 +83,12 @@ if (!empty($this->params['album']) ){ // delete $album = $this->PhotoappAlbum->find($this->params['id']); - if ($album->get('owner') == $this->current_user->getId() && $this->Request->isPost() && $this->PhotoappAlbum->destroyAll("id = " . $this->params['id'])) { - $this->redirectTo(array('action' => 'index')); - return; + if ($album->get('owner') == $this->current_user->getId() && $this->Request->isPost()) { + + if( $this->PhotoappPhoto->destroyAll("album_id = " . $this->params['id']) && $this->PhotoappAlbum->destroyAll("id = " . $this->params['id'])) { + $this->redirectTo(array('action' => 'index')); + return; + } } } else if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { // pre delete @@ -97,6 +100,7 @@ //$this->debug($_FILES); for ($i = 1 ; $i < 6 ; $i++) { $field = 'photo' . $i; + if ($_FILES['album']['error'][$field] == 0 ) { // copy file; save photo $copy_to = PROJECT_DIR . "public/images/uploaded/" . $_FILES['album']['name'][$field]; @@ -104,11 +108,10 @@ if (move_uploaded_file($copy_from, $copy_to)) { $album = $this->PhotoappAlbum->find($this->params['id']); - $this->PhotoappPhoto->img = $copy_to; - $this->PhotoappPhoto->album_id = $album->getId(); - - $this->PhotoappPhoto->setAttributes($atr); - $this->PhotoappPhoto->save(); + $photo = new PhotoappPhoto (); + $photo->img = $_FILES['album']['name'][$field]; + $photo->album_id = $album->getId(); + $photo->save(); } } } // for Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-09 12:13:00 UTC (rev 180) +++ app/views/photoapp/album/uploaded.tpl 2008-05-12 09:21:48 UTC (rev 181) @@ -16,8 +16,7 @@ {loop uploaded_photos} <div class="album"> <div class="img"> - IMG: <?= $uploaded_photo->get('img')?> - <img src="/preview/index/100x100/Supermassive_Black_Hole_by_Remind_me.jpg" /> + <img src="/preview/index/100x100/<?= $uploaded_photo->get('img')?>" /> </div> </div> {end} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-12 09:43:16
|
Revision: 182 http://isocial.svn.sourceforge.net/isocial/?rev=182&view=rev Author: fsnobody Date: 2008-05-12 02:43:21 -0700 (Mon, 12 May 2008) Log Message: ----------- album cover, force delete photos when delete album Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-12 09:21:48 UTC (rev 181) +++ app/controllers/photoapp/album_controller.php 2008-05-12 09:43:21 UTC (rev 182) @@ -111,7 +111,14 @@ $photo = new PhotoappPhoto (); $photo->img = $_FILES['album']['name'][$field]; $photo->album_id = $album->getId(); + if( empty($album->img)) { + $photo->is_cover = 1; + $album->img = $photo->img; + } $photo->save(); + $album->photos_count += 1; + + $album->save(); } } } // for Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-12 09:21:48 UTC (rev 181) +++ app/views/photoapp/album/index.tpl 2008-05-12 09:43:21 UTC (rev 182) @@ -26,7 +26,7 @@ <div class="container"> {loop my_albums} <div class="album"> - <div class="img">IMG</div> + <div class="img"><img src="/preview/index/100x100/<?= $my_album->get('img')?>" /></div> <div class="info"> <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->get('id')?>"><?= $my_album->get('name') ?></a></div> <div class="photos_count">_{photos}: <?= $my_album->get('photos_count')?> </div> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-12 09:21:48 UTC (rev 181) +++ app/views/photoapp/album/uploaded.tpl 2008-05-12 09:43:21 UTC (rev 182) @@ -15,7 +15,7 @@ <div class="container"> {loop uploaded_photos} <div class="album"> - <div class="img"> + <div class="img red"> <img src="/preview/index/100x100/<?= $uploaded_photo->get('img')?>" /> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-13 09:15:53
|
Revision: 188 http://isocial.svn.sourceforge.net/isocial/?rev=188&view=rev Author: fsnobody Date: 2008-05-13 02:16:01 -0700 (Tue, 13 May 2008) Log Message: ----------- delete photo from view album Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/view.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-13 08:51:32 UTC (rev 187) +++ app/controllers/photoapp/album_controller.php 2008-05-13 09:16:01 UTC (rev 188) @@ -29,10 +29,27 @@ function photos_of_you () { } -/* - function create () { + + function delete_photo () { + if (!empty($this->params['id']) ){ + //$this->debug($this->params); + $photo = $this->PhotoappPhoto->findFirst(array('id' => $this->params['id'])); + if ($photo) { + $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); + if ($album && $album->owner == $this->current_user->getId()) { + if ($photo->destroyAll("id = " . $photo->id)) { + $album->photos_count = $album->photos_count - 1; + $album->save(); + $this->redirectTo(array('action' => 'view', 'id' => $album->id)); + } else { + $this->importErrors( $this->PhotoappPhoto->getErrors() ); + } + } + } + } + return; } -*/ + function uploaded () { if (!empty($this->params['photo']) && $this->Request->isPost() && $this->params['photo']['action_comment'] == 'do_comment'){ unset($this->params['photo']['action_comment']); Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-13 08:51:32 UTC (rev 187) +++ app/views/photoapp/album/view.tpl 2008-05-13 09:16:01 UTC (rev 188) @@ -25,10 +25,6 @@ <li><a href="/photoapp/album/delete_photo/<?= $photo->get('id')?>">_{Delete Photo}</a></li> </ul> </div> -<!-- - <div><a href="#">_{Edit}</a></div> - <div><a href="#">_{Delete}</a></div> ---> </div> {end} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-16 06:28:49
|
Revision: 210 http://isocial.svn.sourceforge.net/isocial/?rev=210&view=rev Author: fsnobody Date: 2008-05-15 23:28:55 -0700 (Thu, 15 May 2008) Log Message: ----------- fix getId in templates, delete photo with img Modified Paths: -------------- app/models/photoapp_photo.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/edit_photo.tpl app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl app/views/photoapp/album/view.tpl Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-15 19:05:14 UTC (rev 209) +++ app/models/photoapp_photo.php 2008-05-16 06:28:55 UTC (rev 210) @@ -4,6 +4,14 @@ { var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); + function beforeDestroy() { + + $path = str_replace("@" , "/", $this->img); + $file = AK_PUBLIC_DIR . "/images/uploaded/" . $path; + `rm -f $file`; + return parent::beforeDestroy(); + } + } ?> Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -1,11 +1,11 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/photoapp/album/add_photo/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? - ?><li class="first"><a href="/photoapp/album/view/<?= $album->get('id')?>" class="<?= in_array($controller->getActionName(),array( 'edit_photo', 'view')) ? 'selected' : '' ?>">_{View}</a></li><? - ?><li class="first"><a href="/photoapp/album/uploaded/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? - ?><li><a href="/photoapp/album/edit/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? - ?><li><a href="/photoapp/album/delete/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> + <li class="first"><a href="/photoapp/album/add_photo/<?= $album->getId()?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li class="first"><a href="/photoapp/album/view/<?= $album->getId()?>" class="<?= in_array($controller->getActionName(),array( 'edit_photo', 'view')) ? 'selected' : '' ?>">_{View}</a></li><? + ?><li class="first"><a href="/photoapp/album/uploaded/<?= $album->getId()?>" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? + ?><li><a href="/photoapp/album/edit/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/delete/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> </div> <div class="right"> Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/edit_photo.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -5,7 +5,7 @@ <?= $controller->renderErrors() ?> <div class="uploaded_container"> - <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->get('id'))) ?> + <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->getId())) ?> <?= $form_helper->hidden_field('photo', 'action_edit', array('value' => 'do_edit'))?> <div class="edit_container"> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/index.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -31,16 +31,16 @@ } ?></div> <div class="info"> - <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->get('id')?>"><?= $my_album->get('name') ?></a></div> + <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->getId()?>"><?= $my_album->get('name') ?></a></div> <div class="photos_count">_{photos}: <?= $my_album->get('photos_count')?> </div> <div class="description">_{Description}: <?= $my_album->get('description')?></div> <div class="photos_count">_{Created}: <?= $my_album->get('created_at')?></div> </div> <div class="links"> <ul class="actions_list"> - <li><a href="/photoapp/album/add_photo/<?= $my_album->get('id')?>">_{Edit Album}</a></li> - <li><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></li> - <li><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></li> + <li><a href="/photoapp/album/add_photo/<?= $my_album->getId()?>">_{Edit Album}</a></li> + <li><a href="/photoapp/album/view/<?= $my_album->getId()?>">_{View Album}</a></li> + <li><a href="/photoapp/album/delete/<?= $my_album->getId()?>">_{Delete Album}</a></li> </ul> </div> </div> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/uploaded.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -25,7 +25,7 @@ <div class="form_create_row"> <label >_{Name}:</label> <div class="form_create_col"> - <?= $form_helper->text_field('photo[' . $uploaded_photo->get('id') . ']', 'name', array('class' => 'text_input small')) ?> + <?= $form_helper->text_field('photo[' . $uploaded_photo->getId() . ']', 'name', array('class' => 'text_input small')) ?> </div> </div> <div class="clearfix"></div> @@ -33,7 +33,7 @@ <div class="form_create_row"> <label >_{Description}:</label> <div class="form_create_col"> - <?= $form_helper->text_area('photo[' . $uploaded_photo->get('id') . ']', 'caption', array('rows' => '5', 'class' => 'small')) ?> + <?= $form_helper->text_area('photo[' . $uploaded_photo->getId() . ']', 'caption', array('rows' => '5', 'class' => 'small')) ?> </div> </div> <div class="clearfix"></div> Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/view.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -21,8 +21,8 @@ </div> <div class="links"> <ul class="actions_list"> - <li><a href="/photoapp/album/edit_photo/<?= $photo->get('id')?>">_{Edit Photo}</a></li> - <li><a href="/photoapp/album/delete_photo/<?= $photo->get('id')?>">_{Delete Photo}</a></li> + <li><a href="/photoapp/album/edit_photo/<?= $photo->getId()?>">_{Edit Photo}</a></li> + <li><a href="/photoapp/album/delete_photo/<?= $photo->getId()?>">_{Delete Photo}</a></li> </ul> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-21 17:41:39
|
Revision: 215 http://isocial.svn.sourceforge.net/isocial/?rev=215&view=rev Author: fsnobody Date: 2008-05-21 10:24:33 -0700 (Wed, 21 May 2008) Log Message: ----------- add, delete photo -> album photos_count set from triggers Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/installers/user_installer.php app/models/photoapp_photo.php Removed Paths: ------------- app/installers/photoapp/photo_installer.php Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/controllers/photoapp/album_controller.php 2008-05-21 17:24:33 UTC (rev 215) @@ -58,12 +58,12 @@ //$this->debug($this->params); $photo = $this->PhotoappPhoto->findFirst(array('id' => $this->params['id'])); if ($photo) { - $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); - if ($album && $album->owner == $this->current_user->getId()) { - if ($photo->destroyAll("id = " . $photo->id)) { - $album->photos_count = $album->photos_count - 1; - $album->save(); - $this->redirectTo(array('action' => 'view', 'id' => $album->id)); + $photo->album->load(); + if ($photo->album->getId() && $photo->album->owner == $this->current_user->getId()) { + if ($photo->destroy()) { + //$photo->album->photos_count = $photo->album->photos_count - 1; + //$photo->album->save(); + $this->redirectTo(array('action' => 'view', 'id' => $photo->album->id)); } else { $this->importErrors( $this->PhotoappPhoto->getErrors() ); } @@ -177,16 +177,17 @@ $copy_from = $_FILES['album']['tmp_name'][$field]; if (move_uploaded_file($copy_from, $copy_to)) { $album = $this->PhotoappAlbum->find($this->params['id']); - $photo = new PhotoappPhoto (); $photo->img = $this->current_user->getId() . "@" . $photo_name; $photo->album_id = $album->getId(); + $photo->save(); + + $album = $this->PhotoappAlbum->find($this->params['id']); if( empty($album->img)) { $photo->is_cover = 1; $album->img = $photo->img; } - $photo->save(); - $album->photos_count += 1; + //$album->photos_count += 1; $album->save(); } } Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/installers/photoapp/album_installer.php 2008-05-21 17:24:33 UTC (rev 215) @@ -19,10 +19,41 @@ ) ENGINE=InnoDB"); + $this->execute( + "CREATE TABLE `photoapp_photos` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `album_id` int(11) NOT NULL , + `is_cover` int(1) UNSIGNED NOT NULL DEFAULT '0', + `name` char(100) NOT NULL DEFAULT '', + `caption` char(255) NOT NULL DEFAULT '', + `created_at` datetime NOT NULL , + `img` char(255) NOT NULL DEFAULT '' + + ) ENGINE=InnoDB"); + + + $this->execute( + "CREATE TRIGGER papp_photo_insert AFTER INSERT ON photoapp_photos + FOR EACH ROW BEGIN + UPDATE `photoapp_albums` SET photos_count = photos_count + 1 WHERE id = NEW.album_id; + END; + "); + + $this->execute( + "CREATE TRIGGER papp_photo_delete AFTER DELETE ON photoapp_photos + FOR EACH ROW BEGIN + UPDATE `photoapp_albums` SET photos_count = photos_count - 1 WHERE id = OLD.album_id; + END; + "); + + } + + function down_1() { + $this->dropTable('photoapp_photos'); $this->dropTable('photoapp_albums'); } } Deleted: app/installers/photoapp/photo_installer.php =================================================================== --- app/installers/photoapp/photo_installer.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/installers/photoapp/photo_installer.php 2008-05-21 17:24:33 UTC (rev 215) @@ -1,29 +0,0 @@ -<?php -class PhotoInstaller extends AkInstaller -{ - var $module = 'photoapp'; - - function up_1() - { - - $this->execute( - "CREATE TABLE `photoapp_photos` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `album_id` int(11) NOT NULL , - `is_cover` int(1) UNSIGNED NOT NULL DEFAULT '0', - `name` char(100) NOT NULL DEFAULT '', - `caption` char(255) NOT NULL DEFAULT '', - `created_at` datetime NOT NULL , - `img` char(255) NOT NULL DEFAULT '' - - ) ENGINE=InnoDB"); - - } - - function down_1() - { - $this->dropTable('photoapp_photos'); - } -} - -?> \ No newline at end of file Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/installers/user_installer.php 2008-05-21 17:24:33 UTC (rev 215) @@ -23,7 +23,7 @@ `created_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) - ) ENGINE=innoDB"); + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `friends` ( Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/models/photoapp_photo.php 2008-05-21 17:24:33 UTC (rev 215) @@ -4,12 +4,18 @@ { var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); + /*function __constructor() { + echo 1; + die(); + $album = new PhotoappAlbum(); + return parent::__constructor(); + }*/ + function beforeDestroy() { if ($this->is_cover) { $this->album->load(); - - $this->album->img = "xxx"; + $this->album->img = ""; $this->album->save(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-06-01 16:39:50
|
Revision: 231 http://isocial.svn.sourceforge.net/isocial/?rev=231&view=rev Author: fsnobody Date: 2008-06-01 09:39:58 -0700 (Sun, 01 Jun 2008) Log Message: ----------- changes with stored file Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/models/photoapp_photo.php app/models/stored_file.php app/views/photoapp/album/edit_photo.tpl app/views/photoapp/album/uploaded.tpl app/views/photoapp/album/view.tpl Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-06-01 15:41:30 UTC (rev 230) +++ app/controllers/photoapp/album_controller.php 2008-06-01 16:39:58 UTC (rev 231) @@ -24,10 +24,7 @@ } //$this->photos = $this->PhotoappPhoto->find('all', array('conditions' => array("album_id =" . $this->params['id']))); - - $_filter_pagination = array('items_per_page' => 15, 'count_conditions' => "album_id =" . $this->params['id'] ); - $this->photo_pages = $this->pagination_helper->getPaginator($this->PhotoappPhoto, $_filter_pagination);// paginator $_filter = array('conditions' => "album_id =" . $this->params['id']); @@ -99,8 +96,8 @@ $photo->album->load(); if ($photo->album->getId() && $photo->album->owner == $this->current_user->getId()) { if ($photo->destroy()) { - //$photo->album->photos_count = $photo->album->photos_count - 1; - //$photo->album->save(); + $photo->album->photos_count -= 1; + $photo->album->save(); $this->redirectTo(array('action' => 'view', 'id' => $photo->album->id)); } else { $this->importErrors( $this->PhotoappPhoto->getErrors() ); @@ -163,7 +160,10 @@ //$photo->stored_file->build(); //$photo->stored_file->assign($file); $photo->save(); + $this->album->photos_count += 1; } + $this->album->save(); + $this->redirectTo(array('action' => 'uploaded', 'id' => $photo->album_id)); } else if ($this->params['id']) { $this->album = $this->PhotoappAlbum->find($this->params['id']); return; Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-06-01 15:41:30 UTC (rev 230) +++ app/installers/photoapp/album_installer.php 2008-06-01 16:39:58 UTC (rev 231) @@ -32,33 +32,8 @@ ) ENGINE=InnoDB"); - $this->execute( - "CREATE TRIGGER papp_photo_insert AFTER INSERT ON photoapp_photos - FOR EACH ROW BEGIN - UPDATE `photoapp_albums` SET photos_count = photos_count + 1 WHERE id = NEW.album_id; - END; - "); - $this->execute( - "CREATE TRIGGER papp_photo_delete AFTER DELETE ON photoapp_photos - FOR EACH ROW BEGIN - UPDATE `photoapp_albums` SET photos_count = photos_count - 1 WHERE id = OLD.album_id; - END; - "); - $this->execute( - "CREATE TRIGGER papp_photo_update AFTER UPDATE ON photoapp_photos - FOR EACH ROW BEGIN - - IF OLD.album_id != NEW.album_id THEN - UPDATE `photoapp_albums` SET photos_count = photos_count - 1 WHERE id = OLD.album_id; - UPDATE `photoapp_albums` SET photos_count = photos_count + 1 WHERE id = NEW.album_id; - END IF; - - END; - "); - - } Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-06-01 15:41:30 UTC (rev 230) +++ app/models/photoapp_photo.php 2008-06-01 16:39:58 UTC (rev 231) @@ -5,9 +5,9 @@ var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id'), 'stored_file' => array('class_name' => 'StoredFile', 'primary_key_name' => 'base_file_id')); - /* + function beforeDestroy() { - +/* $albums_cover = $this->album->find('all', array('conditions' => array("img = '" . $this->img . "'"))); if ($albums_cover) foreach ($albums_cover as $album) { @@ -16,14 +16,14 @@ $album->save(); } } +*/ - $path = str_replace("@" , "/", $this->img); - $file = AK_PUBLIC_DIR . "/images/uploaded/" . $path; - `rm -f $file`; + $this->stored_file->load(); + $this->stored_file->remove(); return parent::beforeDestroy(); } - */ + } ?> \ No newline at end of file Modified: app/models/stored_file.php =================================================================== --- app/models/stored_file.php 2008-06-01 15:41:30 UTC (rev 230) +++ app/models/stored_file.php 2008-06-01 16:39:58 UTC (rev 231) @@ -3,6 +3,14 @@ class StoredFile extends BaseFile { + function location () { + return $this->user_id . DS . $this->name; + } + + function preview () { + return $this->user_id . "@" . $this->name; + } + function path () { return "images" . DS . "uploaded" . DS . $this->user_id . DS; } @@ -22,7 +30,7 @@ } function url () { - return AK_ASSET_URL_PREFIX . "/" . $this->path() . "/" . $this->name; + return AK_ASSET_URL_PREFIX . $this->path() . $this->name; } } Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-06-01 15:41:30 UTC (rev 230) +++ app/views/photoapp/album/edit_photo.tpl 2008-06-01 16:39:58 UTC (rev 231) @@ -10,8 +10,8 @@ <?= $form_helper->hidden_field('photo_old', 'album_id', array('value' => $photo->get('album_id')))?> <div class="edit_container"> - <div class="photo_comment"> - <div class="img_medium"><img src="/preview/index/620x500/<?= $photo->get('img')?>" /></div> + <div class="photo_comment"><? $photo->stored_file->load();?> + <div class="img_medium"><img src="/preview/index/620x500/<?= $photo->stored_file->preview() ?>" /></div> <div class="data_medium"> <div class="form_create_row"> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-06-01 15:41:30 UTC (rev 230) +++ app/views/photoapp/album/uploaded.tpl 2008-06-01 16:39:58 UTC (rev 231) @@ -16,8 +16,8 @@ <div class="edit_container"> {loop uploaded_photos} <div class="photo_comment"> - <div class="img"> - <img src="/preview/index/100x100/<?= $uploaded_photo->get('img')?>" /> + <div class="img"><? $uploaded_photo->stored_file->load();?> + <img src="/preview/index/100x100/<?= $uploaded_photo->stored_file->preview() ?>" /> </div> <div class="data"> Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-06-01 15:41:30 UTC (rev 230) +++ app/views/photoapp/album/view.tpl 2008-06-01 16:39:58 UTC (rev 231) @@ -16,10 +16,9 @@ <div class="edit_container"> {loop photos} <div class="photo_view"> - <div class="img"> - <ximg src="/preview/index/100x100/<?= $photo->stored_file->load()->url()?>" /> - <img src="<? $photo->stored_file->load(); echo $photo->stored_file->url() ?>" /> - </div> + <div class="img"><? $photo->stored_file->load() + ?><img src="/preview/index/100x100/<?= $photo->stored_file->preview() ?>" /><? + ?></div> <div class="links"> <ul class="actions_list"> <li><a href="/photoapp/album/edit_photo/<?= $photo->getId()?>">_{Edit}</a></li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-06-02 15:21:23
|
Revision: 234 http://isocial.svn.sourceforge.net/isocial/?rev=234&view=rev Author: fsnobody Date: 2008-06-02 08:21:28 -0700 (Mon, 02 Jun 2008) Log Message: ----------- photoappPhoto - now use Media Item and Store File Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/installers/user_installer.php app/models/photoapp_photo.php app/views/photoapp/album/edit_photo.tpl app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl Added Paths: ----------- app/models/media_item.php Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-06-01 17:32:12 UTC (rev 233) +++ app/controllers/photoapp/album_controller.php 2008-06-02 15:21:28 UTC (rev 234) @@ -41,9 +41,9 @@ if ($photo) { $album = $this->PhotoappAlbum->find($photo->album_id); if ($album) { - - $album->img = $photo->img; - $album->save(); + $photo->stored_file->load(); + $album->img = $photo->stored_file->url(); + $album->save(); } } $this->redirectTo(array('action' => 'view', 'id' => $photo->album_id)); @@ -65,7 +65,22 @@ if ($photo) { $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); if ($album->owner == $this->current_user->getId()) { + $photo->setAttributes($this->params['photo']); + + // counters + if ($photo_old->album_id != $photo->album_id) { + $old_album = $this->PhotoappAlbum->find($photo_old->album_id); + $old_album->photos_count -= 1; + $old_album->save(); + $new_album = $this->PhotoappAlbum->find($photo->album_id); + $new_album->photos_count += 1; + $new_album->save(); + } + + $photo->media_item = $photo->media_item->load(); + $photo->media_item->setAttributes($this->params['media_item']); + $photo->media_item->save(); // check for old album. cases: 1 just update info, 2 moving to another album if ($this->Request->isPost() && $photo->save()){ $this->redirectTo(array('action' => 'view', 'id' => $album->id)); @@ -76,6 +91,11 @@ } } else if (!empty($this->params['id']) && $this->PhotoappPhoto->find($this->params['id'])) { $this->photo = $this->PhotoappPhoto->find($this->params['id']); + + $this->media_item = $this->photo->media_item->load(); + $this->photo->body = $this->media_item->body; + //$this->debug($this->photo->body); + $this->album = $this->PhotoappAlbum->find($this->photo->album_id); $this->albums = $this->PhotoappAlbum->find('all', array('conditions' => array('owner = ' . $this->current_user->getId()))); } @@ -96,6 +116,7 @@ $photo->album->load(); if ($photo->album->getId() && $photo->album->owner == $this->current_user->getId()) { if ($photo->destroy()) { + $photo->album->reload(); $photo->album->photos_count -= 1; $photo->album->save(); $this->redirectTo(array('action' => 'view', 'id' => $photo->album->id)); @@ -113,7 +134,13 @@ unset($this->params['photo']['action_comment']); foreach ($this->params['photo'] as $k => $v) { $photo = $this->PhotoappPhoto->findFirst(array('id' => $k)); + + $photo->media_item->load(); + $photo->media_item->setAttributes($v); + $photo->media_item->save(); + $photo->setAttributes($v); + $photo->is_new = 0; $photo->save(); } //$this->redirectTo(array('action' => 'index')); @@ -125,7 +152,7 @@ // pre delete $this->album = $this->PhotoappAlbum->find($this->params['id']); } - $this->uploaded_photos = $this->PhotoappPhoto->find('all', array('conditions' => array("name =''", "caption =''"))); + $this->uploaded_photos = $this->PhotoappPhoto->find('all', array('conditions' => array("is_new =1"))); return; } } @@ -156,9 +183,20 @@ unset($photo); $photo = $this->album->photo->build(); $photo->base_file_id = $file->id; + + $photo->media_item->build(); + $photo->media_item->user_id = $this->current_user->getId(); + $photo->media_item->save(); + $photo->media_item_id = $photo->media_item->getId(); + //echo "#" . $photo->media_item->getId() . "#"; + //die(); //$photo->stored_file->assign($file); //$photo->stored_file->build(); //$photo->stored_file->assign($file); + if (empty($this->album->img)) { + $this->album->img = $file->url(); + } + $photo->save(); $this->album->photos_count += 1; } Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-06-01 17:32:12 UTC (rev 233) +++ app/installers/photoapp/album_installer.php 2008-06-02 15:21:28 UTC (rev 234) @@ -24,10 +24,11 @@ `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `album_id` int(11) NOT NULL, `base_file_id` int(11) NOT NULL, - `name` char(100) NOT NULL DEFAULT '', - `caption` char(255) NOT NULL DEFAULT '', + `media_item_id` int(11) NOT NULL, + `is_new` int(1) NOT NULL DEFAULT 1, FOREIGN KEY (album_id) REFERENCES photoapp_albums(id), FOREIGN KEY (base_file_id) REFERENCES base_files(id), + FOREIGN KEY (media_item_id) REFERENCES media_items(id), INDEX album_idx (album_id) ) ENGINE=InnoDB"); Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-06-01 17:32:12 UTC (rev 233) +++ app/installers/user_installer.php 2008-06-02 15:21:28 UTC (rev 234) @@ -26,6 +26,17 @@ FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `media_items` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `title` char(255) NOT NULL, + `body` text NOT NULL, + `created_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `confirmations` ( Added: app/models/media_item.php =================================================================== --- app/models/media_item.php (rev 0) +++ app/models/media_item.php 2008-06-02 15:21:28 UTC (rev 234) @@ -0,0 +1,10 @@ +<?php + +class MediaItem extends ActiveRecord +{ + var $table_name = 'media_items'; + var $belongs_to = array('User'); + +} + +?> Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-06-01 17:32:12 UTC (rev 233) +++ app/models/photoapp_photo.php 2008-06-02 15:21:28 UTC (rev 234) @@ -3,10 +3,33 @@ class PhotoappPhoto extends ActiveRecord { var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id'), - 'stored_file' => array('class_name' => 'StoredFile', 'primary_key_name' => 'base_file_id')); + 'stored_file' => array('class_name' => 'StoredFile', 'primary_key_name' => 'base_file_id'), + 'media_item' => array('class_name' => 'MediaItem', 'primary_key_name' => 'media_item_id') + ); + //var $has_one = array('media_item' => array('class_name' => 'MediaItem', 'primary_key_name' => 'media_item_id')); + +/* + function beforeDestroy() { + $this->stored_file->load(); + //echo "@" . $this->stored_file->url() . "@"; + + $albums_cover = $this->album->find('all', array('conditions' => array("img = '" . $this->stored_file->url() . "'"))); + if ($albums_cover) + foreach ($albums_cover as $album) { + if ($album) { + //echo $album->getId() . "#"; + $album->img = ""; + $album->save(); + } + } + return parent::beforeDestroy(); + } +*/ + function afterDestroy() { + /* $albums_cover = $this->album->find('all', array('conditions' => array("img = '" . $this->img . "'"))); if ($albums_cover) @@ -20,7 +43,24 @@ $this->stored_file->load(); + + //echo "@" . $this->stored_file->url() . "@"; + + $albums_cover = $this->album->find('all', array('conditions' => array("img = '" . $this->stored_file->url() . "'"))); + if ($albums_cover) + foreach ($albums_cover as $calbum) { + if ($calbum) { + //echo $calbum->getId() . "#"; + $calbum->img = ""; + $calbum->save(); +//die(); + } + } + + $this->stored_file->destroy(); + $this->media_item->load(); + $this->media_item->destroy(); return parent::afterDestroy(); } Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-06-01 17:32:12 UTC (rev 233) +++ app/views/photoapp/album/edit_photo.tpl 2008-06-02 15:21:28 UTC (rev 234) @@ -10,14 +10,14 @@ <?= $form_helper->hidden_field('photo_old', 'album_id', array('value' => $photo->get('album_id')))?> <div class="edit_container"> - <div class="photo_comment"><? $photo->stored_file->load();?> + <div class="photo_comment"><? $photo->stored_file->load(); $photo->media_item->load();?> <div class="img_medium"><img src="/preview/620x500/<?= $photo->stored_file->url() ?>" /></div> <div class="data_medium"> <div class="form_create_row"> <label >_{Name}:</label> <div class="form_create_col"> - <?= $form_helper->text_field('photo', 'name', array('class' => 'textinput small')) ?> + <?= $form_helper->text_field('media_item', 'title', array('class' => 'textinput small', )) ?> </div> </div><div class="clearfix"></div> @@ -33,7 +33,8 @@ <div class="form_create_row"> <label >_{Description}:</label> <div class="form_create_col"> - <?= $form_helper->text_area('photo', 'caption', array('rows' => '5', 'class' => 'small')) ?> + <?= $form_helper->text_area('media_item', 'body', array('rows' => '5', 'class' => 'small')) ?> + </div> </div><div class="clearfix"></div> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-06-01 17:32:12 UTC (rev 233) +++ app/views/photoapp/album/index.tpl 2008-06-02 15:21:28 UTC (rev 234) @@ -26,7 +26,7 @@ <div class="container"> {loop my_albums} <div class="album"> - <div class="img"><? if ($my_album->get('img') != '' || $my_album->get('img')) {?><img src="/preview/index/100x100/<?= $my_album->get('img')?>" /><? + <div class="img"><? if ($my_album->get('img') != '' || $my_album->get('img')) {?><img src="/preview/100x100/<?= $my_album->get('img')?>" /><? } else {?>_{No cover choosed}<? } ?></div> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-06-01 17:32:12 UTC (rev 233) +++ app/views/photoapp/album/uploaded.tpl 2008-06-02 15:21:28 UTC (rev 234) @@ -24,7 +24,7 @@ <div class="form_create_row"> <label >_{Name}:</label> <div class="form_create_col"> - <?= $form_helper->text_field('photo[' . $uploaded_photo->getId() . ']', 'name', array('class' => 'text_input small')) ?> + <?= $form_helper->text_field('photo[' . $uploaded_photo->getId() . ']', 'title', array('class' => 'text_input small')) ?> </div> </div> <div class="clearfix"></div> @@ -32,7 +32,7 @@ <div class="form_create_row"> <label >_{Description}:</label> <div class="form_create_col"> - <?= $form_helper->text_area('photo[' . $uploaded_photo->getId() . ']', 'caption', array('rows' => '5', 'class' => 'small')) ?> + <?= $form_helper->text_area('photo[' . $uploaded_photo->getId() . ']', 'body', array('rows' => '5', 'class' => 'small')) ?> </div> </div> <div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-15 11:43:24
|
Revision: 237 http://isocial.svn.sourceforge.net/isocial/?rev=237&view=rev Author: dim0s77 Date: 2008-06-15 04:43:32 -0700 (Sun, 15 Jun 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/installers/user_installer.php app/views/groupapp/group/show_group.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-10 17:09:30 UTC (rev 236) +++ app/controllers/groupapp/group_controller.php 2008-06-15 11:43:32 UTC (rev 237) @@ -184,6 +184,7 @@ } } $this->topics = $topics; + $this->topics_count = count($this->topics); } } Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-06-10 17:09:30 UTC (rev 236) +++ app/installers/user_installer.php 2008-06-15 11:43:32 UTC (rev 237) @@ -286,18 +286,6 @@ ) ENGINE=InnoDB"); $this->execute( - "CREATE TABLE `groups` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `name` varchar(255), - `type` - `city_id` int(11), - `count` int(11), - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (city_id) REFERENCES cities(id), - INDEX user_idx (user_id) - ) ENGINE=InnoDB"); - - $this->execute( "CREATE TABLE `group_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-06-10 17:09:30 UTC (rev 236) +++ app/views/groupapp/group/show_group.tpl 2008-06-15 11:43:32 UTC (rev 237) @@ -100,7 +100,7 @@ {?topics} <div class="menu"> <div class="action"><a href="/groupapp/board/start_topic/{group.id?}">_{Start New Topic}</a></div> - <div class="info">_{Topics count}: <a href="/groupapp/board/{group.id?}">1</a></div> + <div class="info">_{Topics count}: <a href="/groupapp/board/{group.id?}">{topics_count?}</a></div> </div> <div class="simple_list"> {loop topics} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-15 13:11:46
|
Revision: 239 http://isocial.svn.sourceforge.net/isocial/?rev=239&view=rev Author: dim0s77 Date: 2008-06-15 06:11:54 -0700 (Sun, 15 Jun 2008) Log Message: ----------- enable limit accesing to few actions for user Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/show_group.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-15 11:50:47 UTC (rev 238) +++ app/controllers/groupapp/group_controller.php 2008-06-15 13:11:54 UTC (rev 239) @@ -151,11 +151,22 @@ $this->members = $this->_getGroupMembers($this->group); $this->members_count = count($this->members); $this->admins = array(); + $this->is_admin = false; + $this->is_member = false; + $this->is_guest = true; + $current_user_id = $this->current_user->getId(); foreach ($this->members as $member) { if ($member->groupapp_member_role_id < 3) { $member->role->load(); $this->admins[] = $member; + if ($current_user_id == $member->getId()) { + $this->is_admin = true; + } } + if ($current_user_id == $member->getId()) { + $this->is_member = true; + $this->is_guest = false; + } } $this->group_type = $this->group->group_type->load()->get('name'); $messages = $this->GroupappMessage->find('all', Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-06-15 11:50:47 UTC (rev 238) +++ app/views/groupapp/group/show_group.tpl 2008-06-15 13:11:54 UTC (rev 239) @@ -14,11 +14,19 @@ </div> <ul class="actions_list"> + {?is_admin} <li><a href="/groupapp/">_{Message All Members}</a></li> <li><a href="/groupapp/group/edit_info/{group.id?}">_{Edit Group}</a></li> <li><a href="/groupapp/group/edit_members/{group.id?}">_{Edit Members}</a></li> + {end} + {?is_member} <li><a href="/groupapp/group/edit_members/{group.id?}">_{Invite People to Join}</a></li> <li><a href="#">_{Leave Group}</a></li> + {end} + {?is_guest} + <li><a href="#">_{View Discussion Board}</a></li> + <li><a href="#">_{Join this Group}</a></li> + {end} </ul> <div class="box"> @@ -59,7 +67,7 @@ <div class="box"> <div class="header"> - <div class="edit"><a href="/groupapp/group/edit_info/{group.id?}">_{edit}</a></div> + {?is_admin}<div class="edit"><a href="/groupapp/group/edit_info/{group.id?}">_{edit}</a></div>{end} <div class="box_title">_{Group Info}</div> </div> <div class="clearfix"></div> @@ -117,14 +125,15 @@ </div> {else} <div class="emptyblock"> - _{There are no discussions}.<br><a href="/groupapp/board/start_topic/{group.id?}">_{Start the first topic}</a>. + _{There are no discussions}.<br> + {?is_member}<a href="/groupapp/board/start_topic/{group.id?}">_{Start the first topic}</a>.{end} </div> {end} </div> <div class="box"> <div class="header"> - <div class="edit"><a href="/groupapp/group/edit_members/{group.id?}">_{edit}</a></div> + {?is_admin}<div class="edit"><a href="/groupapp/group/edit_members/{group.id?}">_{edit}</a></div>{end} <div class="box_title">_{Members}</div> </div> <div class="menu"> @@ -143,7 +152,7 @@ </div> <div class="clearfix"></div> <div class="emptyblock"> - _{No one has said anything...yet}. <a href="#">_{Write something}</a>. + _{No one has said anything...yet}. {?is_member}<a href="#">_{Write something}</a>.{end} </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-17 09:22:44
|
Revision: 241 http://isocial.svn.sourceforge.net/isocial/?rev=241&view=rev Author: dim0s77 Date: 2008-06-17 02:22:52 -0700 (Tue, 17 Jun 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/controllers/message_controller.php app/views/message/show.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-06-16 18:39:40 UTC (rev 240) +++ app/controllers/message_controller.php 2008-06-17 09:22:52 UTC (rev 241) @@ -105,7 +105,7 @@ $this->last_box = !empty($this->params['from']) ? $this->params['from'] : 'inbox'; $thread = $this->Message->findFirst(array('thread_id' => $this->params['id'] )); $user_id = $this->current_user->getId(); - if ($thread->sender_id == $user_id || $thread->recipient_id == $user_id ) { + if ($thread && ($thread->sender_id == $user_id || $thread->recipient_id == $user_id) ) { $recipient_id = $thread->sender_id == $user_id ? $thread->recipient_id : $thread->sender_id; $this->interlocutor = $this->User->findFirst(array( 'id' => $recipient_id)); $messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), Modified: app/views/message/show.tpl =================================================================== --- app/views/message/show.tpl 2008-06-16 18:39:40 UTC (rev 240) +++ app/views/message/show.tpl 2008-06-17 09:22:52 UTC (rev 241) @@ -4,23 +4,25 @@ <div class="messages_thread"> <div id="messages"> + {?interlocutor} {?messages} <?= $controller->render(array('partial' =>'thread', 'locals' => array('interlocutor' => $interlocutor, - 'messages' => $messages))); ?> + 'messages' => $messages))) ?> + {end} {end} </div> <div class="reply_container"> <form id="reply_message_form" action="/message/show" method="post" onsubmit="return false;"> <label>_{Reply}:</label> <textarea class="textinput" cols="40" id="message_body" name="message[body]" rows="20"></textarea> - <input id="message_recipient" name="message[recipient]" type="hidden" value="{interlocutor.id}" /> - <input id="message_thread_id" name="message[thread_id]" type="hidden" value="{messages-0.thread_id}" /> - <input id="message_subject" name="message[subject]" type="hidden" value="re: {messages-0.subject}" /> + <input id="message_recipient" name="message[recipient]" type="hidden" value="{interlocutor.id?}" /> + <input id="message_thread_id" name="message[thread_id]" type="hidden" value="{messages-0.thread_id?}" /> + <input id="message_subject" name="message[subject]" type="hidden" value="re: {messages-0.subject?}" /> <div class="divide_line"> </div> <div class="submits"> <input class="submitinput" type="submit" value="_{Send}" onclick="new Ajax.Updater('messages', '/message/reply', { method:'post', asynchronous:true, parameters:Form.serialize('reply_message_form')}); $('message_body').clear(); return false;"> <input class="cancelinput" type="button" value="_{Back} <? if ($last_box == 'outbox') { ?>_{to Outbox}<? } else { ?>_{to Inbox}<? } ?>" onclick="change_location('{last_box}')"> </div> - <div class="sub_controls"><a href="#" onclick="delete_single_thread(this)" name="{messages-0.id}">_{Delete}</a></div> + <div class="sub_controls"><a href="#" onclick="delete_single_thread(this)" name="{messages-0.id?}">_{Delete}</a></div> </form> </div> <div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-06-20 07:54:27
|
Revision: 242 http://isocial.svn.sourceforge.net/isocial/?rev=242&view=rev Author: fsnobody Date: 2008-06-20 00:54:35 -0700 (Fri, 20 Jun 2008) Log Message: ----------- hot kakoj nit da camit Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/installers/blogapp/blog_installer.php app/models/blogapp_attachment.php app/models/blogapp_post.php app/views/blogapp/post/index.tpl Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-06-17 09:22:52 UTC (rev 241) +++ app/controllers/blogapp/post_controller.php 2008-06-20 07:54:35 UTC (rev 242) @@ -5,11 +5,23 @@ var $models = array('blogapp', 'blogapp_post', 'blogapp_attachment'); function index () { + $this->posts = $this->BlogappPost->find('all', array('conditions' => array('user_id = ' . $this->current_user->getId()))); + //$this->debug($this->posts); + for ($i = 0 ; $i < count($this->posts) ; $i++) { + $this->posts[$i]->media_item->load(); + $this->posts[$i]->attachments = $this->posts[$i]->attachment->load(); + foreach ($this->posts[$i]->attachments as $k => $attach) { + $attach->stored_file->load(); + } + //$this->debug( count($this->posts[$i]->attachment->load())); + //$this->debug($this->posts[$i]->media_item->find()); + } } function create () { if (!empty($this->params['post']) && $this->Request->isPost() ){ $post = $this->BlogappPost; + $post->user_id = $this->current_user->getId(); $post->media_item->build(); $post->media_item->user_id = $this->current_user->getId(); $post->media_item->setAttributes($this->params['post']); Modified: app/installers/blogapp/blog_installer.php =================================================================== --- app/installers/blogapp/blog_installer.php 2008-06-17 09:22:52 UTC (rev 241) +++ app/installers/blogapp/blog_installer.php 2008-06-20 07:54:35 UTC (rev 242) @@ -9,6 +9,7 @@ "CREATE TABLE `blogapp_posts` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `media_item_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, FOREIGN KEY (media_item_id) REFERENCES media_items(id) ) ENGINE=InnoDB"); Modified: app/models/blogapp_attachment.php =================================================================== --- app/models/blogapp_attachment.php 2008-06-17 09:22:52 UTC (rev 241) +++ app/models/blogapp_attachment.php 2008-06-20 07:54:35 UTC (rev 242) @@ -3,12 +3,13 @@ class BlogappAttachment extends ActiveRecord { - var $belongs_to = array('post' => array('class_name' => 'BlogappPost', - 'primary_key_name' => 'post_id') + var $belongs_to = array( + 'post' => array('class_name' => 'BlogappPost', 'primary_key_name' => 'post_id'), + 'stored_file' => array('class_name' => 'StoredFile', 'primary_key_name' => 'base_file_id') ); - var $has_many = array( 'stored_files' => array('class_name' => 'StoredFile', 'foreign_key' => 'base_file_id') ); +// var $has_many = array( 'stored_files' => array('class_name' => 'StoredFile', 'foreign_key' => 'base_file_id') ); } ?> Modified: app/models/blogapp_post.php =================================================================== --- app/models/blogapp_post.php 2008-06-17 09:22:52 UTC (rev 241) +++ app/models/blogapp_post.php 2008-06-20 07:54:35 UTC (rev 242) @@ -2,15 +2,21 @@ class BlogappPost extends ActiveRecord { - +/* var $has_one = array('media_item' => array('class_name' => 'MediaItem', 'foreign_key' => 'media_item_id') ); +*/ + var $belongs_to = array('media_item' => array('class_name' => 'MediaItem', + 'primary_key_name' => 'media_item_id') + ); + var $has_many = array( 'attachments' => array('class_name' => 'BlogappAttachment', 'foreign_key' => 'post_id') ); + function validateOnCreate () { } Modified: app/views/blogapp/post/index.tpl =================================================================== --- app/views/blogapp/post/index.tpl 2008-06-17 09:22:52 UTC (rev 241) +++ app/views/blogapp/post/index.tpl 2008-06-20 07:54:35 UTC (rev 242) @@ -16,4 +16,14 @@ <div class="clearfix"></div> </div> +<div class="container"> + {loop posts} + <div><?= $post->getId();?></div> + <div><?= $post->media_item->get('title');?></div> + <div><?= $post->attachments[0]->get('base_file_id');?></div> + <div><?= $post->attachments[0]->stored_file->get('name');?></div> + + {end} +</div> + <div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-06-20 15:13:23
|
Revision: 244 http://isocial.svn.sourceforge.net/isocial/?rev=244&view=rev Author: fsnobody Date: 2008-06-20 08:13:32 -0700 (Fri, 20 Jun 2008) Log Message: ----------- step by step, blog is coming (design list , view) Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/views/blogapp/post/_menu.tpl app/views/blogapp/post/index.tpl Added Paths: ----------- app/views/blogapp/post/view.tpl Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-06-20 12:56:44 UTC (rev 243) +++ app/controllers/blogapp/post_controller.php 2008-06-20 15:13:32 UTC (rev 244) @@ -19,6 +19,19 @@ } } + function view () { + $post = $this->BlogappPost->find($this->params['id']); + if ($this->current_user->getId() == $post->user_id ){ + $post->media_item->load(); + $post->attachments = $post->attachment->load(); + foreach ($post->attachments as $k => $attach) { + $attach->stored_file->load(); + } + $this->post = $post; + } + + } + function create () { if (!empty($this->params['post']) && $this->Request->isPost() ){ $post = $this->BlogappPost; Modified: app/views/blogapp/post/_menu.tpl =================================================================== --- app/views/blogapp/post/_menu.tpl 2008-06-20 12:56:44 UTC (rev 243) +++ app/views/blogapp/post/_menu.tpl 2008-06-20 15:13:32 UTC (rev 244) @@ -2,7 +2,7 @@ <div class="left"> <ul class="toggle_tabs"> <li class="first"><a href="/blogapp" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{My Posts}</a></li><? - ?><li><a href="/blogapp" class="<?= in_array($controller->getActionName(), array('edit', 'create')) ? 'selected' : '' ?>">_{Edit / Create Post}</a></li><? + ?><li><a href="/blogapp" class="<?= in_array($controller->getActionName(), array('view', 'edit', 'create')) ? 'selected' : '' ?>">_{Edit / Create Post}</a></li><? ?><li><a href="/blogapp" class="last <?= $controller->getActionName() == 'smth' ? 'selected' : '' ?>">_{Smth}</a></li> </ul> </div> Modified: app/views/blogapp/post/index.tpl =================================================================== --- app/views/blogapp/post/index.tpl 2008-06-20 12:56:44 UTC (rev 243) +++ app/views/blogapp/post/index.tpl 2008-06-20 15:13:32 UTC (rev 244) @@ -36,7 +36,7 @@ </div> </div> <div class="clearfix"></div> - <div class="info">Автор:Капитолина Блоговая | Комментарии (7) | Комментировать</div> + <div class="info">Автор: OWNER | Комментарии (7) | Комментировать</div> </div> {end} </div> Added: app/views/blogapp/post/view.tpl =================================================================== --- app/views/blogapp/post/view.tpl (rev 0) +++ app/views/blogapp/post/view.tpl 2008-06-20 15:13:32 UTC (rev 244) @@ -0,0 +1,24 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<div class="container"> + + <div class="post_item"> + <div class="title"><?= $post->media_item->get('title');?> + <div class="created"><?= $post->media_item->created_at;?></div> + </div> + <div class="clearfix"></div> + <div class="body"> + <div class="text"> + <?= $post->media_item->get('body');?> + </div> + + </div> + <div class="clearfix"></div> + <div class="info">Автор: OWNER | Комментарии (7) | Комментировать</div> + </div> + +</div> + +<div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-24 14:57:56
|
Revision: 246 http://isocial.svn.sourceforge.net/isocial/?rev=246&view=rev Author: dim0s77 Date: 2008-06-24 07:58:01 -0700 (Tue, 24 Jun 2008) Log Message: ----------- popular groups tab utilized, since will show popular group in browse tab Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/_menu.tpl app/views/groupapp/group/browse.tpl Removed Paths: ------------- app/views/groupapp/group/popular.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-24 14:27:06 UTC (rev 245) +++ app/controllers/groupapp/group_controller.php 2008-06-24 14:58:01 UTC (rev 246) @@ -227,9 +227,6 @@ function browse () { } - function popular () { - } - function show_board () { } Modified: app/views/groupapp/group/_menu.tpl =================================================================== --- app/views/groupapp/group/_menu.tpl 2008-06-24 14:27:06 UTC (rev 245) +++ app/views/groupapp/group/_menu.tpl 2008-06-24 14:58:01 UTC (rev 246) @@ -3,7 +3,6 @@ <ul class="toggle_tabs"> <li class="first"><a href="/groupapp" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{My Groups}</a></li><? ?><li><a href="/groupapp/group/browse" class="last <?= $controller->getActionName() == 'browse' ? 'selected' : '' ?>">_{Browse Groups}</a></li><? - ?><li><a href="/groupapp/group/popular" class="<?= $controller->getActionName() == 'popular' ? 'selected' : '' ?>">_{Popular Groups}</a></li><? ?><li><a href="/groupapp/group/create" class="last <?= $controller->getActionName() == 'create' ? 'selected' : '' ?>">_{Create Group}</a></li> </ul> </div> Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-06-24 14:27:06 UTC (rev 245) +++ app/views/groupapp/group/browse.tpl 2008-06-24 14:58:01 UTC (rev 246) @@ -1 +1 @@ -Browse Groups \ No newline at end of file +<?= $controller->renderPartial("menu") ?> Deleted: app/views/groupapp/group/popular.tpl =================================================================== --- app/views/groupapp/group/popular.tpl 2008-06-24 14:27:06 UTC (rev 245) +++ app/views/groupapp/group/popular.tpl 2008-06-24 14:58:01 UTC (rev 246) @@ -1 +0,0 @@ -Popular Groups \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-24 17:45:25
|
Revision: 248 http://isocial.svn.sourceforge.net/isocial/?rev=248&view=rev Author: dim0s77 Date: 2008-06-24 10:45:34 -0700 (Tue, 24 Jun 2008) Log Message: ----------- minor changes Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/help.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-24 16:27:00 UTC (rev 247) +++ app/controllers/groupapp/group_controller.php 2008-06-24 17:45:34 UTC (rev 248) @@ -225,6 +225,10 @@ } function browse () { + if (!empty($this->params['g'])) { + $this->group_types = $this->GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))); + } else { + } } function show_board () { Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-06-24 16:27:00 UTC (rev 247) +++ app/locales/groupapp/group/ru.php 2008-06-24 17:45:34 UTC (rev 248) @@ -140,4 +140,7 @@ $dictionary['Invite People to Join'] = 'Пригласить людей присоединиться'; $dictionary['Leave Group'] = 'Покинуть группу'; +$dictionary['Groups are not found'] = 'Ни одной группы не найдено'; +$dictionary['Create first group'] = 'Создать первую группу'; + ?> Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-06-24 16:27:00 UTC (rev 247) +++ app/views/groupapp/group/browse.tpl 2008-06-24 17:45:34 UTC (rev 248) @@ -1 +1,55 @@ <?= $controller->renderPartial("menu") ?> + +{?groups} + +<div class="two_column"> + <div class="right_small"> + <div class="right_content"> + blablabla + </div> + </div> + + <div class="left_big"> + <div class="groups_list"> + <div class="info">_{You are in groups}: <? if (isset($user_groups)) echo count($user_groups); else echo 0; ?></div> + + <div class="container"> + {loop user_groups} + <div class="row"> + + <div class="actions"> + <ul class="actions_list"> + <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> + <li><a href="#">_{Leave Group}</a></li> + </ul> + </div> + + <div class="avatar"> + <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + </div> + + <div class="info"> + <div class="name"><a href="/groupapp/group/show_group/{user_group.id?}">{user_group.name}</a></div> + <div class="other param">_{Members count}:</div> + <div class="other value">{user_group.members_count}</div> + <div class="clearfix"></div> + <div class="other param">_{Type}:</div> + <div class="other value"><? $id = $user_group->type_id; echo $gt[$id]; ?></div> + <div class="clearfix"></div> + </div> + + <div class="clearfix"></div> + </div> + {end} + </div> + + </div> + </div> + +</div> +{else} +<div class="nogroups"> + _{Groups are not found}. <a href="/groupapp/group/create">_{Create first group}!</a> +</div> +{end} +<div class="clearfix"></div> Modified: app/views/groupapp/group/help.tpl =================================================================== --- app/views/groupapp/group/help.tpl 2008-06-24 16:27:00 UTC (rev 247) +++ app/views/groupapp/group/help.tpl 2008-06-24 17:45:34 UTC (rev 248) @@ -1 +1,2 @@ +<?= $controller->renderPartial("menu") ?> Group Help \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-25 16:23:39
|
Revision: 249 http://isocial.svn.sourceforge.net/isocial/?rev=249&view=rev Author: dim0s77 Date: 2008-06-25 09:23:46 -0700 (Wed, 25 Jun 2008) Log Message: ----------- remove DB triggers. Stabled group's work Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/helpers/auto_complete_helper.php app/installers/groupapp/group_installer.php app/locales/groupapp/group/ru.php app/models/groupapp_member.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/customize.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-24 17:45:34 UTC (rev 248) +++ app/controllers/groupapp/group_controller.php 2008-06-25 16:23:46 UTC (rev 249) @@ -14,17 +14,21 @@ $this->is_guest = true; if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { - if ($this->group = $this->GroupappGroup->findFirst(array( 'id = ?' => $this->params['id'] ))) { - $members = $this->_getGroupMembers($this->group); + $group = $this->GroupappGroup->find( $this->params['id'] ); + if (isset($group) && $group) { + $this->group = $group; + $members = $this->_getGroupMembers($this->group->getId()); $current_user_id = $this->current_user->getId(); - foreach ($members as $member) { - if ($member->groupapp_member_role_id < 3 && $current_user_id == $member->getId()) { - $this->is_admin = true; + if ($members) { + foreach ($members as $member) { + if ($member->groupapp_member_role_id < 3 && $current_user_id == $member->getId()) { + $this->is_admin = true; + } + if ($current_user_id == $member->getId()) { + $this->is_member = true; + $this->is_guest = false; + } } - if ($current_user_id == $member->getId()) { - $this->is_member = true; - $this->is_guest = false; - } } } } @@ -46,6 +50,7 @@ $this->step = 'group_info'; if (!empty($this->params['group'])){ $this->GroupappGroup->setAttributes($this->params['group']); + $this->GroupappGroup->members_count = 1; if ($this->Request->isPost() && $this->GroupappGroup->save()){ $owner = $this->GroupappMemberRole->find(1); $group_member = $this->GroupappGroup->group_member->build(); @@ -54,10 +59,11 @@ if ($group_member->save()) { $this->step = 'group_customize'; $this->redirectTo(array('action' => 'customize', 'id' => $this->GroupappGroup->getId())); + } else { + $this->GroupappGroup->destroy(); } - } else { - $this->importErrors( $this->GroupappGroup->getErrors() ); } + $this->importErrors( $this->GroupappGroup->getErrors() ); } } @@ -109,18 +115,22 @@ if ($this->Request->isPost() && $this->GroupappGroup->save()){ return; } - } else if ($this->group) { - $this->members = $this->_getGroupMembers($this->group); + } else if (isset($this->group)) { + $this->members = $this->_getGroupMembers($this->group->getId()); $this->owners_count = 0; $this->admins_count = 0; $this->moderators_count = 0; $this->members_count = 0; - foreach ($this->members as $member) { - if ($member->groupapp_member_role_id == 1) $this->owners_count++; - elseif ($member->groupapp_member_role_id == 2) $this->admins_count++; - elseif ($member->groupapp_member_role_id == 3) $this->moderators_count++; - elseif ($member->groupapp_member_role_id == 4) $this->members_count++; + if ($members) { + foreach ($this->members as $member) { + if ($member->groupapp_member_role_id == 1) $this->owners_count++; + elseif ($member->groupapp_member_role_id == 2) $this->admins_count++; + elseif ($member->groupapp_member_role_id == 3) $this->moderators_count++; + elseif ($member->groupapp_member_role_id == 4) $this->members_count++; + } } + } else { + $this->redirectTo(array('action' => 'index')); } $this->importErrors( $this->GroupappGroup->getErrors() ); } @@ -130,11 +140,22 @@ !empty($this->params['groupapp_member_role_id']) && !empty($this->params['list_id'])) { $this->group = $this->GroupappGroup->find($this->params['groupapp_group_id']); - $this->GroupappMember->destroyAll("id = " . $this->params['member_id']); - $members = $this->_getGroupMembers(); + if (!$this->group) { return; } + $this->group->members_count -= 1; + if (!$this->group->save()) { return; } + if (!$this->GroupappMember->destroy($this->params['member_id'])) { + $this->group->members_count += 1; + $this->group->save(); + $this->importErrors( $this->GroupappMember->getErrors() ); + return; + }; + + $members = $this->_getGroupMembers($this->group->getId()); $members_count = 0; - foreach ($members as $member) { - if ($member->groupapp_member_role_id == $this->params['groupapp_member_role_id']) { $members_count++; } + if ($members) { + foreach ($members as $member) { + if ($member->groupapp_member_role_id == $this->params['groupapp_member_role_id']) { $members_count++; } + } } $members_group_name = ''; $empty_message = ''; @@ -163,33 +184,37 @@ } } - function _getGroupMembers () { + function _getGroupMembers ($group_id) { return $this->GroupappMember->find('all', array('conditions' => array("groupapp_group_id = ?", - $this->group->getId()), + $group_id), 'include' => 'user')); } function show_group () { if (isset($this->group)) { - $this->members = $this->_getGroupMembers($this->group); - $this->members_count = count($this->members); + $this->members = $this->_getGroupMembers($this->group->getId()); $this->admins = array(); $this->is_admin = false; $this->is_member = false; $this->is_guest = true; $current_user_id = $this->current_user->getId(); - foreach ($this->members as $member) { - if ($member->groupapp_member_role_id < 3) { - $member->role->load(); - $this->admins[] = $member; + if ($members) { + $this->members_count = count($this->members); + foreach ($this->members as $member) { + if ($member->groupapp_member_role_id < 3) { + $member->role->load(); + $this->admins[] = $member; + if ($current_user_id == $member->getId()) { + $this->is_admin = true; + } + } if ($current_user_id == $member->getId()) { - $this->is_admin = true; + $this->is_member = true; + $this->is_guest = false; } } - if ($current_user_id == $member->getId()) { - $this->is_member = true; - $this->is_guest = false; - } + } else { + $this->members_count = 0; } $this->group_type = $this->group->group_type->load()->get('name'); $messages = $this->GroupappMessage->find('all', @@ -225,9 +250,30 @@ } function browse () { + $all_groups = $this->GroupappGroup->find('all'); + $this->all_groups_count = count($all_groups); if (!empty($this->params['g'])) { - $this->group_types = $this->GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))); + $all_group_types = $this->GroupappGroupType->find('all'); + foreach($all_group_types as $group_type) { + if ($group_type->parent_id == 0) { + $gt = array("id" => $group_type->id, "name" => $group_type->get('name')); + $this->group_types[] = $gt; + } else if (is_numeric($this->params['g']) && $group_type->parent_id == $this->params['g']) { + $this->subgroup_types[] = $group_type; + } + } } else { + $all_group_types = $this->GroupappGroupType->find('all'); + $this->group_types = array(); + foreach($all_group_types as $group_type) { + if ($group_type->parent_id == 0) { + $gt = array("name" => $group_type->get('name'), "id" => $group_type->id); + $this->group_types[] = $gt; + } else if ($group_type->parent_id == 1) { + $gt = array("id" => $group_type->id, "name" => $group_type->get('name')); + $this->subgroup_types[] = $gt; + } + } } } Modified: app/helpers/auto_complete_helper.php =================================================================== --- app/helpers/auto_complete_helper.php 2008-06-24 17:45:34 UTC (rev 248) +++ app/helpers/auto_complete_helper.php 2008-06-25 16:23:46 UTC (rev 249) @@ -53,22 +53,22 @@ $this->value = ''; if ($this->object) { - $id = $this->object->get($method); - if ($id) { - $model = @$completion_options['model']; - if (!$model) { - foreach ($this->object->getAssociated('belongsTo') as $name => $association) { - if ($association->getAssociationOption('primary_key_name') == $method) { - $model = $association; - break; - } - } - } - $dep = $model->find($id); - if (!empty($dep)) { + $id = $this->object->get($method); + if ($id) { + $model = @$completion_options['model']; + if (!$model) { + foreach ($this->object->getAssociated('belongsTo') as $name => $association) { + if ($association->getAssociationOption('primary_key_name') == $method) { + $model = $association; + break; + } + } + } + $dep = $model->find($id); + if (!empty($dep)) { $this->value = $dep->name; - } - } + } + } } $tag_options = array_merge(array( Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-06-24 17:45:34 UTC (rev 248) +++ app/installers/groupapp/group_installer.php 2008-06-25 16:23:46 UTC (rev 249) @@ -233,20 +233,6 @@ ) ENGINE=InnoDB"); $this->execute( - "CREATE TRIGGER gapp_group_insert AFTER INSERT ON groupapp_members - FOR EACH ROW BEGIN - UPDATE `groupapp_groups` SET members_count = members_count + 1 WHERE id = NEW.groupapp_group_id; - END; - "); - - $this->execute( - "CREATE TRIGGER gapp_group_delete AFTER DELETE ON groupapp_members - FOR EACH ROW BEGIN - UPDATE `groupapp_groups` SET members_count = members_count - 1 WHERE id = OLD.groupapp_group_id; - END; - "); - - $this->execute( "CREATE TABLE `groupapp_messages` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `groupapp_group_id` int(11) NOT NULL DEFAULT '0', Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-06-24 17:45:34 UTC (rev 248) +++ app/locales/groupapp/group/ru.php 2008-06-25 16:23:46 UTC (rev 249) @@ -63,7 +63,7 @@ $dictionary['Group type is missing'] = 'Тип группы отсутствует'; $dictionary['please enter the group category'] = 'выберите, пожалуйста, категорию группы'; -$dictionary['Edit'] = 'Редактирование'; +$dictionary['Edit group'] = 'Редактирование группы'; $dictionary['Website'] = 'Адрес сайта'; $dictionary['Options'] = 'Настройки'; $dictionary['Show related groups'] = 'Показывать похожие группы'; Modified: app/models/groupapp_member.php =================================================================== --- app/models/groupapp_member.php 2008-06-24 17:45:34 UTC (rev 248) +++ app/models/groupapp_member.php 2008-06-25 16:23:46 UTC (rev 249) @@ -12,6 +12,7 @@ var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', 'foreign_key' => 'user_id') ); + } ?> Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-06-24 17:45:34 UTC (rev 248) +++ app/views/groupapp/group/browse.tpl 2008-06-25 16:23:46 UTC (rev 249) @@ -1,17 +1,20 @@ <?= $controller->renderPartial("menu") ?> -{?groups} - +{?all_groups_count} +<div class="info">_{You are in groups}: <? if (isset($user_groups)) echo count($user_groups); else echo 0; ?></div> <div class="two_column"> <div class="right_small"> <div class="right_content"> - blablabla + <ul class="actions_list"> + {loop group_types} + <li><a href="#">{group_type-name}</a></li> + {end} + </ul> </div> </div> <div class="left_big"> <div class="groups_list"> - <div class="info">_{You are in groups}: <? if (isset($user_groups)) echo count($user_groups); else echo 0; ?></div> <div class="container"> {loop user_groups} Modified: app/views/groupapp/group/customize.tpl =================================================================== --- app/views/groupapp/group/customize.tpl 2008-06-24 17:45:34 UTC (rev 248) +++ app/views/groupapp/group/customize.tpl 2008-06-25 16:23:46 UTC (rev 249) @@ -2,7 +2,7 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">_{Edit} {group.name?}</div> + <div class="name groupapp">_{Edit group} '{group.name?}'</div> </div> </div> <div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-03 14:30:05
|
Revision: 261 http://isocial.svn.sourceforge.net/isocial/?rev=261&view=rev Author: dim0s77 Date: 2008-07-03 07:30:15 -0700 (Thu, 03 Jul 2008) Log Message: ----------- added link to group members Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/members.tpl app/views/groupapp/group/show_group.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-03 13:53:04 UTC (rev 260) +++ app/controllers/groupapp/group_controller.php 2008-07-03 14:30:15 UTC (rev 261) @@ -272,6 +272,9 @@ $this->groups = $this->GroupappGroup->find('all', $options); } + function members () { + } + function show_board () { } Modified: app/views/groupapp/group/members.tpl =================================================================== --- app/views/groupapp/group/members.tpl 2008-07-03 13:53:04 UTC (rev 260) +++ app/views/groupapp/group/members.tpl 2008-07-03 14:30:15 UTC (rev 261) @@ -0,0 +1 @@ +Displaying members of my group. Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-03 13:53:04 UTC (rev 260) +++ app/views/groupapp/group/show_group.tpl 2008-07-03 14:30:15 UTC (rev 261) @@ -137,7 +137,7 @@ <div class="box_title">_{Members}</div> </div> <div class="menu"> - <div class="action"><a href="#">_{See all}</a></div> + <div class="action"><a href="/groupapp/group/members/{group.id?}">_{See all}</a></div> <div class="info">_{Members count}: {members_count?}</div> </div> <div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-03 19:15:29
|
Revision: 264 http://isocial.svn.sourceforge.net/isocial/?rev=264&view=rev Author: dim0s77 Date: 2008-07-03 12:15:38 -0700 (Thu, 03 Jul 2008) Log Message: ----------- added menu to the group members page Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/_editbar.tpl app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/members.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-03 19:04:46 UTC (rev 263) +++ app/controllers/groupapp/group_controller.php 2008-07-03 19:15:38 UTC (rev 264) @@ -115,19 +115,7 @@ return; } } else if (isset($this->group)) { - $this->members = $this->_getGroupMembers($this->group->getId()); - $this->owners_count = 0; - $this->admins_count = 0; - $this->moderators_count = 0; - $this->members_count = 0; - if ($this->members) { - foreach ($this->members as $member) { - if ($member->groupapp_member_role_id == 1) $this->owners_count++; - elseif ($member->groupapp_member_role_id == 2) $this->admins_count++; - elseif ($member->groupapp_member_role_id == 3) $this->moderators_count++; - elseif ($member->groupapp_member_role_id == 4) $this->members_count++; - } - } + $this->_calcGroupMembersCount(); } else { $this->redirectTo(array('action' => 'index')); } @@ -189,6 +177,21 @@ 'include' => 'user')); } + function _calcGroupMembersCount () { + $this->owners_count = 0; + $this->admins_count = 0; + $this->moderators_count = 0; + $this->members_count = 0; + if ($this->group_members) { + foreach ($this->group_members as $member) { + $this->members_count++; + if ($member->groupapp_member_role_id == 1) $this->owners_count++; + elseif ($member->groupapp_member_role_id == 2) $this->admins_count++; + elseif ($member->groupapp_member_role_id == 3) $this->moderators_count++; + } + } + } + function show_group () { if (isset($this->group)) { $this->members = $this->_getGroupMembers($this->group->getId()); @@ -257,11 +260,34 @@ $this->groups = $this->GroupappGroup->find('all', $options); } - function members () { - if ($this->group_members) { - } + function show_members () { + $this->step = 'show_members'; + $this->_members(); + $this->renderAction('members.tpl'); } + function show_moderators () { + $this->step = 'show_moderators'; + $this->_members(); + $this->renderAction('members.tpl'); + } + + function show_administrators () { + $this->step = 'show_administrators'; + $this->_members(); + $this->renderAction('members.tpl'); + } + + function show_owners () { + $this->step = 'show_owners'; + $this->_members(); + $this->renderAction('members.tpl'); + } + + function _members () { + $this->_calcGroupMembersCount(); + } + function show_board () { } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-03 19:04:46 UTC (rev 263) +++ app/locales/groupapp/group/ru.php 2008-07-03 19:15:38 UTC (rev 264) @@ -159,5 +159,6 @@ $dictionary['View Profile'] = 'Посмотреть профиль'; $dictionary['Send a Message'] = 'Отправить сообщение'; $dictionary['View Friends'] = 'Друзья пользователя'; +$dictionary['All Members'] = 'Все участники'; ?> Modified: app/views/groupapp/group/_editbar.tpl =================================================================== --- app/views/groupapp/group/_editbar.tpl 2008-07-03 19:04:46 UTC (rev 263) +++ app/views/groupapp/group/_editbar.tpl 2008-07-03 19:15:38 UTC (rev 264) @@ -1,9 +1,9 @@ <div class="minitabs"> <div class="left"> <ul class="toggle_minitabs"> - <li><a href="/groupapp/group/edit_info/{group.id?}" class="<?= $step == 'edit_info' ? 'selected' : '' ?>">_{Group Info}</a> - </li><li><a href="/groupapp/group/edit_customize/{group.id?}" class="<?= $step == 'edit_customize' ? 'selected' : '' ?>">_{Customize}</a> - </li><li><a href="/groupapp/group/edit_members/{group.id?}" class="<?= $step == 'edit_members' ? 'selected' : '' ?>">_{Members}</a></li> + <li><a href="/groupapp/group/edit_info/{group.id?}" class="<?= !empty($step) && $step == 'edit_info' ? 'selected' : '' ?>">_{Group Info}</a> + </li><li><a href="/groupapp/group/edit_customize/{group.id?}" class="<?= !empty($step) && $step == 'edit_customize' ? 'selected' : '' ?>">_{Customize}</a> + </li><li><a href="/groupapp/group/edit_members/{group.id?}" class="<?= !empty($step) && $step == 'edit_members' ? 'selected' : '' ?>">_{Members}</a></li> </ul> </div> <div class="right"> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-07-03 19:04:46 UTC (rev 263) +++ app/views/groupapp/group/edit_members.tpl 2008-07-03 19:15:38 UTC (rev 264) @@ -18,6 +18,7 @@ </div> <div class="members"> + <div class="submenushort"> <div class="menu_block selector"> <label for="action_select">_{Show}: @@ -32,98 +33,97 @@ <div id="owners_list"> <div class="list_header">_{Owners}: {?owners_count}{owners_count}{else}0{end}</div> - <? if (isset($owners_count) && $owners_count > 0) { ?> + <? if (isset($owners_count) && $owners_count > 0): ?> <div class="members_list"> <ul> - {?members}{loop members} - <? if ($member->groupapp_member_role_id == 1) { ?> + {?group_members}{loop group_members} + <? if ($group_member->groupapp_member_role_id == 1): ?> <li> - <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> <span class="change_status"> - <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 1); return false;" name="{member.id}">_{change status}</a> + <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> </span> - <a href="#" onclick="remove_member(this, {group.id?}, 'owners_list', 1); return false;" name="{member.id?}">_{remove}</a> + <a href="#" onclick="remove_member(this, {group.id}, 'owners_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id?}">_{remove}</a> </li> - <? } ?> + <? endif ?> {end}{end} </ul> </div> - <? } else { ?> + <? else: ?> <div class="empty_list">_{Group has no owner}</div> - <? } ?> + <? endif ?> </div> <div id="admins_list"> <div class="list_header">_{Administrators}: {?admins_count}{admins_count}{else}0{end}</div> - <? if (isset($admins_count) && $admins_count > 0) { ?> + <? if (isset($admins_count) && $admins_count > 0): ?> <div class="members_list"> <ul> - {?members}{loop members} - <? if ($member->groupapp_member_role_id == 2) { ?> + {?group_members}{loop group_members} + <? if ($group_member->groupapp_member_role_id == 2): ?> <li> - <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> <span class="change_status"> - <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 2); return false;" name="{member.id}">_{change status}</a> + <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> </span> - <a href="#" onclick="remove_member(this, {group.id}, 'admins_list', 2); return false;" name="{member.id}">_{remove}</a> + <a href="#" onclick="remove_member(this, {group.id}, 'admins_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{remove}</a> </li> - <? } ?> + <? endif ?> {end}{end} </ul> </div> - <? } else { ?> + <? else: ?> <div class="empty_list">_{Group has no administrators}</div> - <? } ?> + <? endif ?> </div> <div id="moderators_list"> <div class="list_header">_{Moderators}: {?moderators_count}{moderators_count}{else}0{end}</div> - <? if (isset($moderators_count) && $moderators_count > 0) { ?> + <? if (isset($moderators_count) && $moderators_count > 0): ?> <div class="members_list"> <ul> - {?members}{loop members} - <? if ($member->groupapp_member_role_id == 3) { ?> + {?group_members}{loop group_members} + <? if ($group_member->groupapp_member_role_id == 3): ?> <li> - <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> <span class="change_status"> - <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 3); return false;" name="{member.id}">_{change status}</a> + <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> </span> - <a href="#" onclick="remove_member(this, {group.id}, 'moderators_list', 3); return false;" name="{member.id}">_{remove}</a> + <a href="#" onclick="remove_member(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{remove}</a> </li> - <? } ?> + <? endif ?> {end}{end} </ul> </div> - <? } else { ?> + <? else: ?> <div class="empty_list">_{Group has no moderators}</div> - <? } ?> + <? endif ?> </div> <div id="members_list"> <div class="list_header">_{Members}: {?members_count}{members_count}{else}0{end}</div> - <? if (isset($members_count) && $members_count > 0) { ?> - <div class="members_list_container"> - <div class="members_list"> - <ul> - {?members}{loop members} - <? if ($member->groupapp_member_role_id == 4) { ?> - <li> - <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> - <span class="change_status"> - <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', 4); return false;" name="{member.id}">_{change status}</a> - </span> - <a href="#" onclick="remove_member(this, {group.id}, 'members_list', 4); return false;" name="{member.id}">_{remove}</a> - </li> - <? } ?> - {end}{end} - </ul> - </div> + <? if (isset($members_count) && $members_count > 0): ?> + <div class="members_list"> + <ul> + {?group_members}{loop group_members} + <li> + <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> + <? if ($group_member->groupapp_member_role_id == 4): ?> + <span class="change_status"> + <a href="#" onclick="change_member_status(this, {group.id}, 'moderators_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{change status}</a> + </span> + <a href="#" onclick="remove_member(this, {group.id}, 'members_list', {group_member.groupapp_member_role_id}); return false;" name="{group_member.id}">_{remove}</a> + <? endif ?> + </li> + {end}{end} + </ul> </div> - <? } else { ?> + <? else: ?> <div class="empty_list">_{Could not find any members. Invite some more people.}</div> - <? } ?> + <? endif ?> </div> + </div> <div class="clearfix"></div> </form> Modified: app/views/groupapp/group/members.tpl =================================================================== --- app/views/groupapp/group/members.tpl 2008-07-03 19:04:46 UTC (rev 263) +++ app/views/groupapp/group/members.tpl 2008-07-03 19:15:38 UTC (rev 264) @@ -1,10 +1,14 @@ <div class="title_bar gray"> <div class="head"> - <div class="name groupapp">_{Displaying members of group} '<a href="/groupapp/group/show_group/{group.id?}">{group.name?}</a>'</div> + <div class="name groupapp"> + _{Displaying members of group} '<a href="/groupapp/group/show_group/{group.id?}">{group.name?}</a>' + </div> </div> </div> <div class="clearfix"></div> +<?= $controller->renderPartial("membersbar") ?> + {?group_members} <div class="groups_list"> <div class="container"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-04 14:44:50
|
Revision: 267 http://isocial.svn.sourceforge.net/isocial/?rev=267&view=rev Author: dim0s77 Date: 2008-07-04 07:44:59 -0700 (Fri, 04 Jul 2008) Log Message: ----------- added array_pagination_helper Modified Paths: -------------- app/application_controller.php Added Paths: ----------- app/helpers/array_pagination_helper.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-07-04 11:02:10 UTC (rev 266) +++ app/application_controller.php 2008-07-04 14:44:59 UTC (rev 267) @@ -21,7 +21,7 @@ var $_errors = array(); var $app_models = array('User', 'Message', 'BaseFile', 'StoredFile'); - var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField'); + var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField', 'ArrayPagination'); var $uploaded_files = array(); var $current_user; Added: app/helpers/array_pagination_helper.php =================================================================== --- app/helpers/array_pagination_helper.php (rev 0) +++ app/helpers/array_pagination_helper.php 2008-07-04 14:44:59 UTC (rev 267) @@ -0,0 +1,46 @@ +<?php + +class ArrayPaginationHelper extends PaginationHelper +{ + function getPaginator($paginator_name, $items, $options = array()) + { + $default_options = array( + 'items_per_page' => 15, + 'page_var_on_url' => 'page', + 'count_method' => 'count', + 'count_conditions' => null, + 'count_joins' => null + ); + + $options = array_merge($default_options, $options); + $this->$paginator_name = new AkPaginator($this->_controller, + count($items), + $options['items_per_page'], + @$this->_controller->params[$options['page_var_on_url']]); + $this->$paginator_name->_ak_options =& $options; + return $this->$paginator_name; + } + + function getPageItems($paginator_name, $items) + { + if (!isset($this->$paginator_name)) { + return $items; + } + + $items_per_page = $this->$paginator_name->getItemsPerPage(); + $offset = $this->$paginator_name->getOffset(); + $page_items = array(); + + for ($i = 0; $i < count($items); $i++) { + if (($offset == 0 && $i < $items_per_page) || + ($i < $items_per_page * $offset && $i >= $items_per_page * ($offset - 1))) + { + $page_items[] = $items[$i]; + } + } + + return $page_items; + } +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-08 17:32:37
|
Revision: 276 http://isocial.svn.sourceforge.net/isocial/?rev=276&view=rev Author: dim0s77 Date: 2008-07-08 10:32:46 -0700 (Tue, 08 Jul 2008) Log Message: ----------- changed rus translate Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-08 17:25:53 UTC (rev 275) +++ app/controllers/groupapp/group_controller.php 2008-07-08 17:32:46 UTC (rev 276) @@ -211,7 +211,7 @@ $this->admins_count = 0; $this->moderators_count = 0; $this->members_count = 0; - if ($this->group_members) { + if (!empty($this->group_members)) { foreach ($this->group_members as $member) { $this->members_count++; if ($member->groupapp_member_role_id == 1) $this->owners_count++; Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-08 17:25:53 UTC (rev 275) +++ app/locales/groupapp/group/ru.php 2008-07-08 17:32:46 UTC (rev 276) @@ -80,11 +80,11 @@ $dictionary['This group is closed'] = 'Это закрытая группа'; $dictionary['This group is secret'] = 'Это засекреченная группа'; $dictionary['Anyone can join and invite others to join. Anyone can see the group information. Anyone can see the following: the discussion board, the wall, videos and photos.'] = - 'Каждый может присоединиться и пригласить других. Информацию о группе может увидеть каждый. Любой может увидеть форум, доску объявлений, видео и фото.'; + 'В эту группу может вступить каждый и пригласить всех желающих. Каждый может смотреть информацию о группе и ее содержание.'; $dictionary['Administrative approval is required for new members to join. Anyone can see the group information. Only the members will be able to see the following: the discussion board, the wall, videos and photos.'] = - 'Для присоединения нового участника требуется разрешение администраторов. Информацию о группе может увидеть только участник группы. Только участники группы смогут увидеть форум, доску объявлений, видео и фото.'; + 'Для вступления в группу необходимо разрешение администратора. Все могут смотреть описание группы, ее содержание доступно только участникам.'; $dictionary['The group will not appear in search results or in the profiles of its members. Membership is by invitation only, and only members can see the group information. Only the members will be able to see the following: the discussion board, the wall, videos and photos.'] = - 'Эта группа не будет отображаться в результатах поиска или в профилях своих участников. Членство в группе возможно только по приглашению, и только участники группы могут видеть информацию о группе. Только участники смогут увидеть форум, доску объявлений, видео и фото.'; + 'Группа не будет отображаться в результатах поиска или в профилях ее участников. Вступить можно только по приглашениям, и только члены могут видеть информацию и содержание группы.'; $dictionary['This is an open group. Anyone can join and invite others to join.'] = 'Это открытая группа. Каждый может присоединиться и пригласить других.'; $dictionary['This is a closed group. Members must be invited or approved by an admin.'] = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-08 19:03:40
|
Revision: 277 http://isocial.svn.sourceforge.net/isocial/?rev=277&view=rev Author: dim0s77 Date: 2008-07-08 12:03:50 -0700 (Tue, 08 Jul 2008) Log Message: ----------- fixes for groupapp->group->show_group Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/show_group.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-08 17:32:46 UTC (rev 276) +++ app/controllers/groupapp/group_controller.php 2008-07-08 19:03:50 UTC (rev 277) @@ -22,14 +22,17 @@ $this->group_picture = $group->stored_file_id ? $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; $this->group = $group; + $members = $this->_getGroupMembers($this->group->getId()); + $this->members_count = 0; $current_user_id = $this->current_user->getId(); - if ($members) { + if (!empty($members)) { + $this->members_count = count($members); foreach ($members as $member) { - if ($member->groupapp_member_role_id < 3 && $current_user_id == $member->getId()) { + if ($member->groupapp_member_role_id < 3 && $current_user_id == $member->user_id) { $this->is_admin = true; } - if ($current_user_id == $member->getId()) { + if ($current_user_id == $member->user_id) { $this->is_member = true; $this->is_guest = false; } @@ -223,15 +226,8 @@ function show_group () { if (isset($this->group)) { - $this->members = $this->_getGroupMembers($this->group->getId()); - $this->admins = array(); - $this->is_admin = false; - $this->is_member = false; - $this->is_guest = true; - $current_user_id = $this->current_user->getId(); - $this->members_count = $this->members ? count($this->members) : 0; - - $this->group_type = $this->group->group_type->load()->get('name'); + $this->_extract_group_types(); + $this->group->category_id = floor($this->group->type_id / 100); $messages = $this->GroupappMessage->find('all', array( 'conditions' => array("groupapp_group_id = ?", $this->group->getId()), Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-08 17:32:46 UTC (rev 276) +++ app/views/groupapp/group/browse.tpl 2008-07-08 19:03:50 UTC (rev 277) @@ -93,8 +93,8 @@ <div class="name"><a href="/groupapp/group/show_group/{group.id?}">{group.name}</a></div> <div class="other"><span class="param">_{Members count}:</span> {group.members_count}</div> <div class="other"><span class="param">_{Type}:</span> </div> - <a href="/groupapp/group/browse/?g={group_type_id?}"><?= $gt[$group_type_id] ?></a> - - <a href="/groupapp/group/browse/?g={group_type_id?}&sg={group.type_id?}"><?= $gt[$group->type_id] ?></a> + <a href="/groupapp/group/browse/?g={group_type_id}"><?= $gt[$group_type_id] ?></a> - + <a href="/groupapp/group/browse/?g={group_type_id}&sg={group.type_id}"><?= $gt[$group->type_id] ?></a> </div> </div> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-08 17:32:46 UTC (rev 276) +++ app/views/groupapp/group/show_group.tpl 2008-07-08 19:03:50 UTC (rev 277) @@ -54,9 +54,13 @@ </div> <div class="body"> <ul class="simple_list"> - {loop admins} - <li><a href="/profile/show/{admin.user.id?}">{admin.user.name?}</a> <span>(<?= $admin->role->get('name') ?>)</span></li> + {?group_members} + {loop group_members} + <? if ($group_member->groupapp_member_role_id < 3): ?> + <li><a href="/profile/show/{group_member.user.id?}">{group_member.user.name?}</a> <span>(<?= $group_member->role->load()->get('name') ?>)</span></li> + <? endif ?> {end} + {end} </ul> </div> <div class="clearfix"></div> @@ -74,12 +78,11 @@ </div> <div class="clearfix"></div> <div class="body"> - <div class="other param">_{Type}:</div> - <div class="other value">{group_type?}</div> + <div class="other"><span class="param">_{Type}:</span> </div> + <a href="/groupapp/group/browse/?g={group.category_id}"><?= $gt[$group->category_id] ?></a> - + <a href="/groupapp/group/browse/?g={group.category_id?}&sg={group.type_id?}"><?= $gt[$group->type_id] ?></a> + <div class="other"><span class="param">_{Description}:</span> {group.description?}</div> <div class="clearfix"></div> - <div class="other param">_{Description}:</div> - <div class="other value">{group.description?}</div> - <div class="clearfix"></div> </div> </div> @@ -148,15 +151,15 @@ </div> </div> - <div class="box"> - <div class="header"> - <div class="box_title">_{The Wall}</div> - </div> - <div class="clearfix"></div> - <div class="emptyblock"> - _{No one has said anything...yet}. {?is_member}<a href="#">_{Write something}</a>.{end} - </div> - </div> + <!-- <div class="box"> --> + <!-- <div class="header"> --> + <!-- <div class="box_title">_{The Wall}</div> --> + <!-- </div> --> + <!-- <div class="clearfix"></div> --> + <!-- <div class="emptyblock"> --> + <!-- _{No one has said anything...yet}. {?is_member}<a href="#">_{Write something}</a>.{end} --> + <!-- </div> --> + <!-- </div> --> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |