isocial-svn Mailing List for isocial
Status: Pre-Alpha
Brought to you by:
aguidrevitch
You can subscribe to this list here.
2008 |
Jan
|
Feb
(11) |
Mar
(80) |
Apr
(22) |
May
(90) |
Jun
(28) |
Jul
(33) |
Aug
(12) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|
From: <fsn...@us...> - 2008-09-05 09:25:52
|
Revision: 304 http://isocial.svn.sourceforge.net/isocial/?rev=304&view=rev Author: fsnobody Date: 2008-09-05 09:25:58 +0000 (Fri, 05 Sep 2008) Log Message: ----------- javascript fix error Modified Paths: -------------- public/javascripts/tiny_mce/plugins/advimage/jscripts/functions.js Modified: public/javascripts/tiny_mce/plugins/advimage/jscripts/functions.js =================================================================== --- public/javascripts/tiny_mce/plugins/advimage/jscripts/functions.js 2008-09-04 17:34:11 UTC (rev 303) +++ public/javascripts/tiny_mce/plugins/advimage/jscripts/functions.js 2008-09-05 09:25:58 UTC (rev 304) @@ -59,7 +59,7 @@ document.getElementById("imagelistsrcrow").style.display = 'none'; else document.getElementById("imagelistsrccontainer").innerHTML = html; - +/* // Image list oversrc html = getImageListHTML('imagelistover','onmouseoversrc'); if (html == "") @@ -73,22 +73,23 @@ document.getElementById("imagelistoutrow").style.display = 'none'; else document.getElementById("imagelistoutcontainer").innerHTML = html; +*/ // Src browser - html = getBrowserHTML('srcbrowser','src','image','advimage'); - document.getElementById("srcbrowsercontainer").innerHTML = html; +// html = getBrowserHTML('srcbrowser','src','image','advimage'); +// document.getElementById("srcbrowsercontainer").innerHTML = html; // Over browser - html = getBrowserHTML('oversrcbrowser','onmouseoversrc','image','advimage'); - document.getElementById("onmouseoversrccontainer").innerHTML = html; +// html = getBrowserHTML('oversrcbrowser','onmouseoversrc','image','advimage'); +// document.getElementById("onmouseoversrccontainer").innerHTML = html; // Out browser - html = getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','advimage'); - document.getElementById("onmouseoutsrccontainer").innerHTML = html; +// html = getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','advimage'); +// document.getElementById("onmouseoutsrccontainer").innerHTML = html; // Longdesc browser - html = getBrowserHTML('longdescbrowser','longdesc','file','advimage'); - document.getElementById("longdesccontainer").innerHTML = html; +// html = getBrowserHTML('longdescbrowser','longdesc','file','advimage'); +// document.getElementById("longdesccontainer").innerHTML = html; // Resize some elements if (isVisible('srcbrowser')) @@ -107,7 +108,8 @@ if (elm != null && elm.nodeName == "IMG") action = "update"; - formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); + if (formObj.insert) + formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); if (action == "update") { var src = tinyMCE.getAttrib(elm, 'src'); @@ -146,8 +148,8 @@ formObj.hspace.value = tinyMCE.getAttrib(elm, 'hspace'); formObj.width.value = orgImageWidth; formObj.height.value = orgImageHeight; - formObj.onmouseoversrc.value = onmouseoversrc; - formObj.onmouseoutsrc.value = onmouseoutsrc; +// formObj.onmouseoversrc.value = onmouseoversrc; +// formObj.onmouseoutsrc.value = onmouseoutsrc; formObj.id.value = tinyMCE.getAttrib(elm, 'id'); formObj.dir.value = tinyMCE.getAttrib(elm, 'dir'); formObj.lang.value = tinyMCE.getAttrib(elm, 'lang'); @@ -181,7 +183,8 @@ formObj.constrain.checked = true; // Check swap image if valid data - if (formObj.onmouseoversrc.value != "" || formObj.onmouseoutsrc.value != "") + if (formObj.onmouseoversrc && formObj.onmouseoutsrc) + if ( formObj.onmouseoversrc.value != "" || formObj.onmouseoutsrc.value != "") setSwapImageDisabled(false); else setSwapImageDisabled(true); @@ -308,8 +311,8 @@ setAttrib(elm, 'hspace'); setAttrib(elm, 'width'); setAttrib(elm, 'height'); - setAttrib(elm, 'onmouseover', onmouseoversrc); - setAttrib(elm, 'onmouseout', onmouseoutsrc); +// setAttrib(elm, 'onmouseover', onmouseoversrc); +// setAttrib(elm, 'onmouseout', onmouseoutsrc); setAttrib(elm, 'id'); setAttrib(elm, 'dir'); setAttrib(elm, 'lang'); @@ -340,8 +343,8 @@ html += makeAttrib('hspace'); html += makeAttrib('width'); html += makeAttrib('height'); - html += makeAttrib('onmouseover', onmouseoversrc); - html += makeAttrib('onmouseout', onmouseoutsrc); +// html += makeAttrib('onmouseover', onmouseoversrc); +// html += makeAttrib('onmouseout', onmouseoutsrc); html += makeAttrib('id'); html += makeAttrib('dir'); html += makeAttrib('lang'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-09-04 17:34:29
|
Revision: 303 http://isocial.svn.sourceforge.net/isocial/?rev=303&view=rev Author: fsnobody Date: 2008-09-04 17:34:11 +0000 (Thu, 04 Sep 2008) Log Message: ----------- add timy mce v0.1 Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/controllers/photoapp/album_controller.php Added Paths: ----------- app/views/blogapp/post/image_list.tpl public/javascripts/tiny_mce/ public/javascripts/tiny_mce/blank.htm public/javascripts/tiny_mce/langs/ public/javascripts/tiny_mce/langs/en.js public/javascripts/tiny_mce/langs/readme.txt public/javascripts/tiny_mce/license.txt public/javascripts/tiny_mce/plugins/ public/javascripts/tiny_mce/plugins/_template/ public/javascripts/tiny_mce/plugins/_template/editor_plugin.js public/javascripts/tiny_mce/plugins/_template/editor_plugin_src.js public/javascripts/tiny_mce/plugins/_template/images/ public/javascripts/tiny_mce/plugins/_template/images/template.gif public/javascripts/tiny_mce/plugins/_template/langs/ public/javascripts/tiny_mce/plugins/_template/langs/en.js public/javascripts/tiny_mce/plugins/_template/popup.htm public/javascripts/tiny_mce/plugins/_template/readme.txt public/javascripts/tiny_mce/plugins/advhr/ public/javascripts/tiny_mce/plugins/advhr/css/ public/javascripts/tiny_mce/plugins/advhr/css/advhr.css public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js public/javascripts/tiny_mce/plugins/advhr/images/ public/javascripts/tiny_mce/plugins/advhr/images/advhr.gif public/javascripts/tiny_mce/plugins/advhr/jscripts/ public/javascripts/tiny_mce/plugins/advhr/jscripts/rule.js public/javascripts/tiny_mce/plugins/advhr/langs/ public/javascripts/tiny_mce/plugins/advhr/langs/en.js public/javascripts/tiny_mce/plugins/advhr/readme.txt public/javascripts/tiny_mce/plugins/advhr/rule.htm public/javascripts/tiny_mce/plugins/advimage/ public/javascripts/tiny_mce/plugins/advimage/css/ public/javascripts/tiny_mce/plugins/advimage/css/advimage.css public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js public/javascripts/tiny_mce/plugins/advimage/image.htm public/javascripts/tiny_mce/plugins/advimage/images/ public/javascripts/tiny_mce/plugins/advimage/images/sample.gif public/javascripts/tiny_mce/plugins/advimage/jscripts/ public/javascripts/tiny_mce/plugins/advimage/jscripts/functions.js public/javascripts/tiny_mce/plugins/advimage/langs/ public/javascripts/tiny_mce/plugins/advimage/langs/en.js public/javascripts/tiny_mce/plugins/advimage/readme.txt public/javascripts/tiny_mce/plugins/advlink/ public/javascripts/tiny_mce/plugins/advlink/css/ public/javascripts/tiny_mce/plugins/advlink/css/advlink.css public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js public/javascripts/tiny_mce/plugins/advlink/jscripts/ public/javascripts/tiny_mce/plugins/advlink/jscripts/functions.js public/javascripts/tiny_mce/plugins/advlink/langs/ public/javascripts/tiny_mce/plugins/advlink/langs/en.js public/javascripts/tiny_mce/plugins/advlink/link.htm public/javascripts/tiny_mce/plugins/advlink/readme.txt public/javascripts/tiny_mce/plugins/autosave/ public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js public/javascripts/tiny_mce/plugins/autosave/langs/ public/javascripts/tiny_mce/plugins/autosave/langs/en.js public/javascripts/tiny_mce/plugins/autosave/readme.txt public/javascripts/tiny_mce/plugins/bbcode/ public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js public/javascripts/tiny_mce/plugins/cleanup/ public/javascripts/tiny_mce/plugins/cleanup/editor_plugin.js public/javascripts/tiny_mce/plugins/cleanup/editor_plugin_src.js public/javascripts/tiny_mce/plugins/cleanup/readme.txt public/javascripts/tiny_mce/plugins/contextmenu/ public/javascripts/tiny_mce/plugins/contextmenu/css/ public/javascripts/tiny_mce/plugins/contextmenu/css/contextmenu.css public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js public/javascripts/tiny_mce/plugins/contextmenu/images/ public/javascripts/tiny_mce/plugins/contextmenu/images/spacer.gif public/javascripts/tiny_mce/plugins/contextmenu/readme.txt public/javascripts/tiny_mce/plugins/devkit/ public/javascripts/tiny_mce/plugins/devkit/css/ public/javascripts/tiny_mce/plugins/devkit/css/devkit.css public/javascripts/tiny_mce/plugins/devkit/css/devkit_ui.css public/javascripts/tiny_mce/plugins/devkit/devkit.htm public/javascripts/tiny_mce/plugins/devkit/editor_plugin.js public/javascripts/tiny_mce/plugins/devkit/editor_plugin_src.js public/javascripts/tiny_mce/plugins/devkit/images/ public/javascripts/tiny_mce/plugins/devkit/images/flip_down.gif public/javascripts/tiny_mce/plugins/devkit/images/flip_up.gif public/javascripts/tiny_mce/plugins/devkit/jscripts/ public/javascripts/tiny_mce/plugins/devkit/jscripts/devkit.js public/javascripts/tiny_mce/plugins/devkit/jscripts/diff.js public/javascripts/tiny_mce/plugins/devkit/langs/ public/javascripts/tiny_mce/plugins/devkit/langs/en.js public/javascripts/tiny_mce/plugins/directionality/ public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js public/javascripts/tiny_mce/plugins/directionality/images/ public/javascripts/tiny_mce/plugins/directionality/images/ltr.gif public/javascripts/tiny_mce/plugins/directionality/images/rtl.gif public/javascripts/tiny_mce/plugins/directionality/langs/ public/javascripts/tiny_mce/plugins/directionality/langs/en.js public/javascripts/tiny_mce/plugins/directionality/readme.txt public/javascripts/tiny_mce/plugins/emotions/ public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js public/javascripts/tiny_mce/plugins/emotions/emotions.htm public/javascripts/tiny_mce/plugins/emotions/images/ public/javascripts/tiny_mce/plugins/emotions/images/emotions.gif public/javascripts/tiny_mce/plugins/emotions/images/readme.txt public/javascripts/tiny_mce/plugins/emotions/images/smiley-cool.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-cry.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-embarassed.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-foot-in-mouth.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-frown.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-innocent.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-kiss.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-laughing.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-money-mouth.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-sealed.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-smile.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-surprised.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-tongue-out.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-undecided.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-wink.gif public/javascripts/tiny_mce/plugins/emotions/images/smiley-yell.gif public/javascripts/tiny_mce/plugins/emotions/jscripts/ public/javascripts/tiny_mce/plugins/emotions/jscripts/functions.js public/javascripts/tiny_mce/plugins/emotions/langs/ public/javascripts/tiny_mce/plugins/emotions/langs/en.js public/javascripts/tiny_mce/plugins/emotions/readme.txt public/javascripts/tiny_mce/plugins/flash/ public/javascripts/tiny_mce/plugins/flash/css/ public/javascripts/tiny_mce/plugins/flash/css/content.css public/javascripts/tiny_mce/plugins/flash/css/flash.css public/javascripts/tiny_mce/plugins/flash/editor_plugin.js public/javascripts/tiny_mce/plugins/flash/editor_plugin_src.js public/javascripts/tiny_mce/plugins/flash/flash.htm public/javascripts/tiny_mce/plugins/flash/images/ public/javascripts/tiny_mce/plugins/flash/images/flash.gif public/javascripts/tiny_mce/plugins/flash/jscripts/ public/javascripts/tiny_mce/plugins/flash/jscripts/flash.js public/javascripts/tiny_mce/plugins/flash/langs/ public/javascripts/tiny_mce/plugins/flash/langs/en.js public/javascripts/tiny_mce/plugins/flash/readme.txt public/javascripts/tiny_mce/plugins/fullpage/ public/javascripts/tiny_mce/plugins/fullpage/blank.htm public/javascripts/tiny_mce/plugins/fullpage/css/ public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm public/javascripts/tiny_mce/plugins/fullpage/images/ public/javascripts/tiny_mce/plugins/fullpage/images/add.gif public/javascripts/tiny_mce/plugins/fullpage/images/fullpage.gif public/javascripts/tiny_mce/plugins/fullpage/images/move_down.gif public/javascripts/tiny_mce/plugins/fullpage/images/move_up.gif public/javascripts/tiny_mce/plugins/fullpage/images/remove.gif public/javascripts/tiny_mce/plugins/fullpage/jscripts/ public/javascripts/tiny_mce/plugins/fullpage/jscripts/fullpage.js public/javascripts/tiny_mce/plugins/fullpage/langs/ public/javascripts/tiny_mce/plugins/fullpage/langs/en.js public/javascripts/tiny_mce/plugins/fullscreen/ public/javascripts/tiny_mce/plugins/fullscreen/css/ public/javascripts/tiny_mce/plugins/fullscreen/css/page.css public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm public/javascripts/tiny_mce/plugins/fullscreen/images/ public/javascripts/tiny_mce/plugins/fullscreen/images/fullscreen.gif public/javascripts/tiny_mce/plugins/fullscreen/langs/ public/javascripts/tiny_mce/plugins/fullscreen/langs/en.js public/javascripts/tiny_mce/plugins/fullscreen/readme.txt public/javascripts/tiny_mce/plugins/iespell/ public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js public/javascripts/tiny_mce/plugins/iespell/images/ public/javascripts/tiny_mce/plugins/iespell/images/iespell.gif public/javascripts/tiny_mce/plugins/iespell/langs/ public/javascripts/tiny_mce/plugins/iespell/langs/en.js public/javascripts/tiny_mce/plugins/iespell/readme.txt public/javascripts/tiny_mce/plugins/inlinepopups/ public/javascripts/tiny_mce/plugins/inlinepopups/css/ public/javascripts/tiny_mce/plugins/inlinepopups/css/inlinepopup.css public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js public/javascripts/tiny_mce/plugins/inlinepopups/images/ public/javascripts/tiny_mce/plugins/inlinepopups/images/spacer.gif public/javascripts/tiny_mce/plugins/inlinepopups/images/window_close.gif public/javascripts/tiny_mce/plugins/inlinepopups/images/window_maximize.gif public/javascripts/tiny_mce/plugins/inlinepopups/images/window_minimize.gif public/javascripts/tiny_mce/plugins/inlinepopups/images/window_resize.gif public/javascripts/tiny_mce/plugins/inlinepopups/jscripts/ public/javascripts/tiny_mce/plugins/inlinepopups/jscripts/mcwindows.js public/javascripts/tiny_mce/plugins/inlinepopups/readme.txt public/javascripts/tiny_mce/plugins/insertdatetime/ public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js public/javascripts/tiny_mce/plugins/insertdatetime/images/ public/javascripts/tiny_mce/plugins/insertdatetime/images/insertdate.gif public/javascripts/tiny_mce/plugins/insertdatetime/images/inserttime.gif public/javascripts/tiny_mce/plugins/insertdatetime/langs/ public/javascripts/tiny_mce/plugins/insertdatetime/langs/en.js public/javascripts/tiny_mce/plugins/insertdatetime/readme.txt public/javascripts/tiny_mce/plugins/layer/ public/javascripts/tiny_mce/plugins/layer/editor_plugin.js public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js public/javascripts/tiny_mce/plugins/layer/images/ public/javascripts/tiny_mce/plugins/layer/images/absolute.gif public/javascripts/tiny_mce/plugins/layer/images/backward.gif public/javascripts/tiny_mce/plugins/layer/images/forward.gif public/javascripts/tiny_mce/plugins/layer/images/insert_layer.gif public/javascripts/tiny_mce/plugins/layer/images/insertlayer.gif public/javascripts/tiny_mce/plugins/layer/images/movebackward.gif public/javascripts/tiny_mce/plugins/layer/images/moveforward.gif public/javascripts/tiny_mce/plugins/layer/langs/ public/javascripts/tiny_mce/plugins/layer/langs/en.js public/javascripts/tiny_mce/plugins/layer/readme.txt public/javascripts/tiny_mce/plugins/media/ public/javascripts/tiny_mce/plugins/media/css/ public/javascripts/tiny_mce/plugins/media/css/content.css public/javascripts/tiny_mce/plugins/media/css/media.css public/javascripts/tiny_mce/plugins/media/editor_plugin.js public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js public/javascripts/tiny_mce/plugins/media/images/ public/javascripts/tiny_mce/plugins/media/images/flash.gif public/javascripts/tiny_mce/plugins/media/images/media.gif public/javascripts/tiny_mce/plugins/media/images/quicktime.gif public/javascripts/tiny_mce/plugins/media/images/realmedia.gif public/javascripts/tiny_mce/plugins/media/images/shockwave.gif public/javascripts/tiny_mce/plugins/media/images/windowsmedia.gif public/javascripts/tiny_mce/plugins/media/jscripts/ public/javascripts/tiny_mce/plugins/media/jscripts/embed.js public/javascripts/tiny_mce/plugins/media/jscripts/media.js public/javascripts/tiny_mce/plugins/media/langs/ public/javascripts/tiny_mce/plugins/media/langs/en.js public/javascripts/tiny_mce/plugins/media/media.htm public/javascripts/tiny_mce/plugins/nonbreaking/ public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js public/javascripts/tiny_mce/plugins/nonbreaking/images/ public/javascripts/tiny_mce/plugins/nonbreaking/images/nonbreaking.gif public/javascripts/tiny_mce/plugins/nonbreaking/langs/ public/javascripts/tiny_mce/plugins/nonbreaking/langs/en.js public/javascripts/tiny_mce/plugins/noneditable/ public/javascripts/tiny_mce/plugins/noneditable/css/ public/javascripts/tiny_mce/plugins/noneditable/css/noneditable.css public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js public/javascripts/tiny_mce/plugins/noneditable/readme.txt public/javascripts/tiny_mce/plugins/paste/ public/javascripts/tiny_mce/plugins/paste/blank.htm public/javascripts/tiny_mce/plugins/paste/css/ public/javascripts/tiny_mce/plugins/paste/css/blank.css public/javascripts/tiny_mce/plugins/paste/css/pasteword.css public/javascripts/tiny_mce/plugins/paste/editor_plugin.js public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js public/javascripts/tiny_mce/plugins/paste/images/ public/javascripts/tiny_mce/plugins/paste/images/pastetext.gif public/javascripts/tiny_mce/plugins/paste/images/pasteword.gif public/javascripts/tiny_mce/plugins/paste/images/selectall.gif public/javascripts/tiny_mce/plugins/paste/jscripts/ public/javascripts/tiny_mce/plugins/paste/jscripts/pastetext.js public/javascripts/tiny_mce/plugins/paste/jscripts/pasteword.js public/javascripts/tiny_mce/plugins/paste/langs/ public/javascripts/tiny_mce/plugins/paste/langs/en.js public/javascripts/tiny_mce/plugins/paste/pastetext.htm public/javascripts/tiny_mce/plugins/paste/pasteword.htm public/javascripts/tiny_mce/plugins/paste/readme.txt public/javascripts/tiny_mce/plugins/preview/ public/javascripts/tiny_mce/plugins/preview/editor_plugin.js public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js public/javascripts/tiny_mce/plugins/preview/example.html public/javascripts/tiny_mce/plugins/preview/images/ public/javascripts/tiny_mce/plugins/preview/images/preview.gif public/javascripts/tiny_mce/plugins/preview/jscripts/ public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js public/javascripts/tiny_mce/plugins/preview/langs/ public/javascripts/tiny_mce/plugins/preview/langs/en.js public/javascripts/tiny_mce/plugins/preview/readme.txt public/javascripts/tiny_mce/plugins/print/ public/javascripts/tiny_mce/plugins/print/editor_plugin.js public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js public/javascripts/tiny_mce/plugins/print/images/ public/javascripts/tiny_mce/plugins/print/images/print.gif public/javascripts/tiny_mce/plugins/print/langs/ public/javascripts/tiny_mce/plugins/print/langs/en.js public/javascripts/tiny_mce/plugins/print/readme.txt public/javascripts/tiny_mce/plugins/readme.txt public/javascripts/tiny_mce/plugins/save/ public/javascripts/tiny_mce/plugins/save/editor_plugin.js public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js public/javascripts/tiny_mce/plugins/save/images/ public/javascripts/tiny_mce/plugins/save/images/cancel.gif public/javascripts/tiny_mce/plugins/save/images/save.gif public/javascripts/tiny_mce/plugins/save/langs/ public/javascripts/tiny_mce/plugins/save/langs/en.js public/javascripts/tiny_mce/plugins/save/readme.txt public/javascripts/tiny_mce/plugins/searchreplace/ public/javascripts/tiny_mce/plugins/searchreplace/css/ public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js public/javascripts/tiny_mce/plugins/searchreplace/images/ public/javascripts/tiny_mce/plugins/searchreplace/images/replace.gif public/javascripts/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif public/javascripts/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif public/javascripts/tiny_mce/plugins/searchreplace/images/search.gif public/javascripts/tiny_mce/plugins/searchreplace/jscripts/ public/javascripts/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js public/javascripts/tiny_mce/plugins/searchreplace/langs/ public/javascripts/tiny_mce/plugins/searchreplace/langs/en.js public/javascripts/tiny_mce/plugins/searchreplace/readme.txt public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm public/javascripts/tiny_mce/plugins/style/ public/javascripts/tiny_mce/plugins/style/css/ public/javascripts/tiny_mce/plugins/style/css/props.css public/javascripts/tiny_mce/plugins/style/editor_plugin.js public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js public/javascripts/tiny_mce/plugins/style/images/ public/javascripts/tiny_mce/plugins/style/images/apply_button_bg.gif public/javascripts/tiny_mce/plugins/style/images/style_info.gif public/javascripts/tiny_mce/plugins/style/images/styleprops.gif public/javascripts/tiny_mce/plugins/style/jscripts/ public/javascripts/tiny_mce/plugins/style/jscripts/props.js public/javascripts/tiny_mce/plugins/style/langs/ public/javascripts/tiny_mce/plugins/style/langs/en.js public/javascripts/tiny_mce/plugins/style/props.htm public/javascripts/tiny_mce/plugins/style/readme.txt public/javascripts/tiny_mce/plugins/table/ public/javascripts/tiny_mce/plugins/table/cell.htm public/javascripts/tiny_mce/plugins/table/css/ public/javascripts/tiny_mce/plugins/table/css/cell.css public/javascripts/tiny_mce/plugins/table/css/row.css public/javascripts/tiny_mce/plugins/table/css/table.css public/javascripts/tiny_mce/plugins/table/editor_plugin.js public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js public/javascripts/tiny_mce/plugins/table/images/ public/javascripts/tiny_mce/plugins/table/images/buttons.gif public/javascripts/tiny_mce/plugins/table/images/table.gif public/javascripts/tiny_mce/plugins/table/images/table_cell_props.gif public/javascripts/tiny_mce/plugins/table/images/table_delete.gif public/javascripts/tiny_mce/plugins/table/images/table_delete_col.gif public/javascripts/tiny_mce/plugins/table/images/table_delete_row.gif public/javascripts/tiny_mce/plugins/table/images/table_insert_col_after.gif public/javascripts/tiny_mce/plugins/table/images/table_insert_col_before.gif public/javascripts/tiny_mce/plugins/table/images/table_insert_row_after.gif public/javascripts/tiny_mce/plugins/table/images/table_insert_row_before.gif public/javascripts/tiny_mce/plugins/table/images/table_merge_cells.gif public/javascripts/tiny_mce/plugins/table/images/table_row_props.gif public/javascripts/tiny_mce/plugins/table/images/table_split_cells.gif public/javascripts/tiny_mce/plugins/table/jscripts/ public/javascripts/tiny_mce/plugins/table/jscripts/cell.js public/javascripts/tiny_mce/plugins/table/jscripts/merge_cells.js public/javascripts/tiny_mce/plugins/table/jscripts/row.js public/javascripts/tiny_mce/plugins/table/jscripts/table.js public/javascripts/tiny_mce/plugins/table/langs/ public/javascripts/tiny_mce/plugins/table/langs/en.js public/javascripts/tiny_mce/plugins/table/merge_cells.htm public/javascripts/tiny_mce/plugins/table/readme.txt public/javascripts/tiny_mce/plugins/table/row.htm public/javascripts/tiny_mce/plugins/table/table.htm public/javascripts/tiny_mce/plugins/template/ public/javascripts/tiny_mce/plugins/template/blank.htm public/javascripts/tiny_mce/plugins/template/css/ public/javascripts/tiny_mce/plugins/template/css/template.css public/javascripts/tiny_mce/plugins/template/editor_plugin.js public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js public/javascripts/tiny_mce/plugins/template/images/ public/javascripts/tiny_mce/plugins/template/images/template.gif public/javascripts/tiny_mce/plugins/template/jscripts/ public/javascripts/tiny_mce/plugins/template/jscripts/template.js public/javascripts/tiny_mce/plugins/template/langs/ public/javascripts/tiny_mce/plugins/template/langs/en.js public/javascripts/tiny_mce/plugins/template/template.htm public/javascripts/tiny_mce/plugins/visualchars/ public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js public/javascripts/tiny_mce/plugins/visualchars/images/ public/javascripts/tiny_mce/plugins/visualchars/images/visualchars.gif public/javascripts/tiny_mce/plugins/visualchars/langs/ public/javascripts/tiny_mce/plugins/visualchars/langs/en.js public/javascripts/tiny_mce/plugins/xhtmlxtras/ public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm public/javascripts/tiny_mce/plugins/xhtmlxtras/css/ public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css public/javascripts/tiny_mce/plugins/xhtmlxtras/css/xhtmlxtras.css public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js public/javascripts/tiny_mce/plugins/xhtmlxtras/images/ public/javascripts/tiny_mce/plugins/xhtmlxtras/images/abbr.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/images/acronym.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/images/attribs.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/images/cite.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/images/date_time.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/images/del.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/images/ins.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/images/remove_button_bg.gif public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/ public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/abbr.js public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/acronym.js public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/attributes.js public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/cite.js public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/del.js public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/element_common.js public/javascripts/tiny_mce/plugins/xhtmlxtras/jscripts/ins.js public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/ public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en.js public/javascripts/tiny_mce/plugins/zoom/ public/javascripts/tiny_mce/plugins/zoom/editor_plugin.js public/javascripts/tiny_mce/plugins/zoom/editor_plugin_src.js public/javascripts/tiny_mce/plugins/zoom/readme.txt public/javascripts/tiny_mce/themes/ public/javascripts/tiny_mce/themes/advanced/ public/javascripts/tiny_mce/themes/advanced/about.htm public/javascripts/tiny_mce/themes/advanced/anchor.htm public/javascripts/tiny_mce/themes/advanced/charmap.htm public/javascripts/tiny_mce/themes/advanced/color_picker.htm public/javascripts/tiny_mce/themes/advanced/css/ public/javascripts/tiny_mce/themes/advanced/css/colorpicker.css public/javascripts/tiny_mce/themes/advanced/css/editor_content.css public/javascripts/tiny_mce/themes/advanced/css/editor_popup.css public/javascripts/tiny_mce/themes/advanced/css/editor_ui.css public/javascripts/tiny_mce/themes/advanced/docs/ public/javascripts/tiny_mce/themes/advanced/docs/en/ public/javascripts/tiny_mce/themes/advanced/docs/en/about.htm public/javascripts/tiny_mce/themes/advanced/docs/en/common_buttons.htm public/javascripts/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm public/javascripts/tiny_mce/themes/advanced/docs/en/images/ public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_anchor_window.gif public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_image_window.gif public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_link_window.gif public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_table_window.gif public/javascripts/tiny_mce/themes/advanced/docs/en/index.htm public/javascripts/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm public/javascripts/tiny_mce/themes/advanced/docs/en/insert_image_button.htm public/javascripts/tiny_mce/themes/advanced/docs/en/insert_link_button.htm public/javascripts/tiny_mce/themes/advanced/docs/en/insert_table_button.htm public/javascripts/tiny_mce/themes/advanced/docs/en/style.css public/javascripts/tiny_mce/themes/advanced/editor_template.js public/javascripts/tiny_mce/themes/advanced/editor_template_src.js public/javascripts/tiny_mce/themes/advanced/image.htm public/javascripts/tiny_mce/themes/advanced/images/ public/javascripts/tiny_mce/themes/advanced/images/anchor.gif public/javascripts/tiny_mce/themes/advanced/images/anchor_symbol.gif public/javascripts/tiny_mce/themes/advanced/images/backcolor.gif public/javascripts/tiny_mce/themes/advanced/images/bold.gif public/javascripts/tiny_mce/themes/advanced/images/bold_de_se.gif public/javascripts/tiny_mce/themes/advanced/images/bold_es.gif public/javascripts/tiny_mce/themes/advanced/images/bold_fr.gif public/javascripts/tiny_mce/themes/advanced/images/bold_ru.gif public/javascripts/tiny_mce/themes/advanced/images/bold_tw.gif public/javascripts/tiny_mce/themes/advanced/images/browse.gif public/javascripts/tiny_mce/themes/advanced/images/bullist.gif public/javascripts/tiny_mce/themes/advanced/images/button_menu.gif public/javascripts/tiny_mce/themes/advanced/images/buttons.gif public/javascripts/tiny_mce/themes/advanced/images/cancel_button_bg.gif public/javascripts/tiny_mce/themes/advanced/images/charmap.gif public/javascripts/tiny_mce/themes/advanced/images/cleanup.gif public/javascripts/tiny_mce/themes/advanced/images/close.gif public/javascripts/tiny_mce/themes/advanced/images/code.gif public/javascripts/tiny_mce/themes/advanced/images/color.gif public/javascripts/tiny_mce/themes/advanced/images/colors.jpg public/javascripts/tiny_mce/themes/advanced/images/copy.gif public/javascripts/tiny_mce/themes/advanced/images/custom_1.gif public/javascripts/tiny_mce/themes/advanced/images/cut.gif public/javascripts/tiny_mce/themes/advanced/images/forecolor.gif public/javascripts/tiny_mce/themes/advanced/images/help.gif public/javascripts/tiny_mce/themes/advanced/images/hr.gif public/javascripts/tiny_mce/themes/advanced/images/image.gif public/javascripts/tiny_mce/themes/advanced/images/indent.gif public/javascripts/tiny_mce/themes/advanced/images/insert_button_bg.gif public/javascripts/tiny_mce/themes/advanced/images/italic.gif public/javascripts/tiny_mce/themes/advanced/images/italic_de_se.gif public/javascripts/tiny_mce/themes/advanced/images/italic_es.gif public/javascripts/tiny_mce/themes/advanced/images/italic_ru.gif public/javascripts/tiny_mce/themes/advanced/images/italic_tw.gif public/javascripts/tiny_mce/themes/advanced/images/justifycenter.gif public/javascripts/tiny_mce/themes/advanced/images/justifyfull.gif public/javascripts/tiny_mce/themes/advanced/images/justifyleft.gif public/javascripts/tiny_mce/themes/advanced/images/justifyright.gif public/javascripts/tiny_mce/themes/advanced/images/link.gif public/javascripts/tiny_mce/themes/advanced/images/menu_check.gif public/javascripts/tiny_mce/themes/advanced/images/newdocument.gif public/javascripts/tiny_mce/themes/advanced/images/numlist.gif public/javascripts/tiny_mce/themes/advanced/images/opacity.png public/javascripts/tiny_mce/themes/advanced/images/outdent.gif public/javascripts/tiny_mce/themes/advanced/images/paste.gif public/javascripts/tiny_mce/themes/advanced/images/redo.gif public/javascripts/tiny_mce/themes/advanced/images/removeformat.gif public/javascripts/tiny_mce/themes/advanced/images/separator.gif public/javascripts/tiny_mce/themes/advanced/images/spacer.gif public/javascripts/tiny_mce/themes/advanced/images/statusbar_resize.gif public/javascripts/tiny_mce/themes/advanced/images/strikethrough.gif public/javascripts/tiny_mce/themes/advanced/images/sub.gif public/javascripts/tiny_mce/themes/advanced/images/sup.gif public/javascripts/tiny_mce/themes/advanced/images/underline.gif public/javascripts/tiny_mce/themes/advanced/images/underline_es.gif public/javascripts/tiny_mce/themes/advanced/images/underline_fr.gif public/javascripts/tiny_mce/themes/advanced/images/underline_ru.gif public/javascripts/tiny_mce/themes/advanced/images/underline_tw.gif public/javascripts/tiny_mce/themes/advanced/images/undo.gif public/javascripts/tiny_mce/themes/advanced/images/unlink.gif public/javascripts/tiny_mce/themes/advanced/images/visualaid.gif public/javascripts/tiny_mce/themes/advanced/images/xp/ public/javascripts/tiny_mce/themes/advanced/images/xp/tab_bg.gif public/javascripts/tiny_mce/themes/advanced/images/xp/tab_end.gif public/javascripts/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif public/javascripts/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif public/javascripts/tiny_mce/themes/advanced/images/xp/tabs_bg.gif public/javascripts/tiny_mce/themes/advanced/jscripts/ public/javascripts/tiny_mce/themes/advanced/jscripts/about.js public/javascripts/tiny_mce/themes/advanced/jscripts/anchor.js public/javascripts/tiny_mce/themes/advanced/jscripts/charmap.js public/javascripts/tiny_mce/themes/advanced/jscripts/color_picker.js public/javascripts/tiny_mce/themes/advanced/jscripts/image.js public/javascripts/tiny_mce/themes/advanced/jscripts/link.js public/javascripts/tiny_mce/themes/advanced/jscripts/source_editor.js public/javascripts/tiny_mce/themes/advanced/langs/ public/javascripts/tiny_mce/themes/advanced/langs/en.js public/javascripts/tiny_mce/themes/advanced/link.htm public/javascripts/tiny_mce/themes/advanced/source_editor.htm public/javascripts/tiny_mce/themes/simple/ public/javascripts/tiny_mce/themes/simple/css/ public/javascripts/tiny_mce/themes/simple/css/editor_content.css public/javascripts/tiny_mce/themes/simple/css/editor_popup.css public/javascripts/tiny_mce/themes/simple/css/editor_ui.css public/javascripts/tiny_mce/themes/simple/editor_template.js public/javascripts/tiny_mce/themes/simple/editor_template_src.js public/javascripts/tiny_mce/themes/simple/images/ public/javascripts/tiny_mce/themes/simple/images/bold.gif public/javascripts/tiny_mce/themes/simple/images/bold_de_se.gif public/javascripts/tiny_mce/themes/simple/images/bold_fr.gif public/javascripts/tiny_mce/themes/simple/images/bold_ru.gif public/javascripts/tiny_mce/themes/simple/images/bold_tw.gif public/javascripts/tiny_mce/themes/simple/images/bullist.gif public/javascripts/tiny_mce/themes/simple/images/buttons.gif public/javascripts/tiny_mce/themes/simple/images/cleanup.gif public/javascripts/tiny_mce/themes/simple/images/italic.gif public/javascripts/tiny_mce/themes/simple/images/italic_de_se.gif public/javascripts/tiny_mce/themes/simple/images/italic_ru.gif public/javascripts/tiny_mce/themes/simple/images/italic_tw.gif public/javascripts/tiny_mce/themes/simple/images/numlist.gif public/javascripts/tiny_mce/themes/simple/images/redo.gif public/javascripts/tiny_mce/themes/simple/images/separator.gif public/javascripts/tiny_mce/themes/simple/images/spacer.gif public/javascripts/tiny_mce/themes/simple/images/strikethrough.gif public/javascripts/tiny_mce/themes/simple/images/underline.gif public/javascripts/tiny_mce/themes/simple/images/underline_fr.gif public/javascripts/tiny_mce/themes/simple/images/underline_ru.gif public/javascripts/tiny_mce/themes/simple/images/underline_tw.gif public/javascripts/tiny_mce/themes/simple/images/undo.gif public/javascripts/tiny_mce/tiny_mce.js public/javascripts/tiny_mce/tiny_mce_dev.js public/javascripts/tiny_mce/tiny_mce_popup.js public/javascripts/tiny_mce/tiny_mce_src.js public/javascripts/tiny_mce/utils/ public/javascripts/tiny_mce/utils/editable_selects.js public/javascripts/tiny_mce/utils/form_utils.js public/javascripts/tiny_mce/utils/mclayer.js public/javascripts/tiny_mce/utils/mctabs.js public/javascripts/tiny_mce/utils/validate.js Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-09-01 14:10:35 UTC (rev 302) +++ app/controllers/blogapp/post_controller.php 2008-09-04 17:34:11 UTC (rev 303) @@ -34,6 +34,33 @@ } // view + function upload_img () { + if ($this->uploaded_files) { + $album = $this->PhotoappAlbum->findFirst(array('owner' => $this->current_user->getId(), 'is_default' => 1 )); + + foreach ($this->uploaded_files as $file) { + unset($photo); + $photo = $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->title = $this->params['photo']['title']; + $photo->media_item->body = $this->params['photo']['body']; + $photo->media_item->save(); + $photo->media_item_id = $photo->media_item->getId(); + $photo->save(); + $album->photos_count += 1; + } + $album->save(); + + + } + //$this->debug($this->params); + $this->redirectTo('/javascripts/tiny_mce/plugins/advimage/image.htm'); + //die(); + } + function image_list () { $user_id = $this->current_user->getId(); if ($user_id) { @@ -44,29 +71,24 @@ $_filter = array('conditions' => "album_id =" . $album->getId()); $photos = $this->PhotoappPhoto->find('all', $_filter); - //print_r($photos); - //echo "#" . count($photos) . "#"; - $file = new StoredFile(); $file->user_id = $this->current_user->getId(); $path = $file->path(); -/* - $imgs = array_diff(scandir(AK_PUBLIC_DIR . DS . $path), array('.', '..')); -*/ - - $script = "var tinyMCEImageList = new Array( "; - if ($photos) { - foreach ($photos as $k => $photo) { - $photo->media_item->load(); - $photo->stored_file->load(); - $img_name = $photo->stored_file->name; - //print_r($photo->media_item->title); - $script .= "[\"" . $img_name . "\", \"" . "/preview/100x100/" . $path . $img_name . "\"],"; - } // foreach - $script = substr($script, 0, strlen($script) - 1); - }// photos - $script .=");"; - + + $script = "var tinyMCEImageList = new Array( "; + if ($photos) { + foreach ($photos as $k => $photo) { + $photo->media_item->load(); + $photo->stored_file->load(); + $img_name = $photo->stored_file->name; + $img_title = $photo->media_item->title; + //print_r($photo->media_item->title); + $script .= "[\"" . $img_title . "\", \"" . "/preview/100x100/" . $path . $img_name . "\"],"; + } // foreach + $script = substr($script, 0, strlen($script) - 1); + }// photos + $script .=");"; + } Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-09-01 14:10:35 UTC (rev 302) +++ app/controllers/photoapp/album_controller.php 2008-09-04 17:34:11 UTC (rev 303) @@ -6,8 +6,7 @@ function index () { - $_filter_pagination = array('items_per_page' => 5, 'count_conditions' => 'owner = ' . $this->current_user->getId() ); - + $_filter_pagination = array('items_per_page' => 5, 'count_conditions' => 'owner = ' . $this->current_user->getId()); $this->album_pages = $this->pagination_helper->getPaginator($this->PhotoappAlbum, $_filter_pagination);// paginator $_filter = array('conditions' => 'owner = ' . $this->current_user->getId()); Added: app/views/blogapp/post/image_list.tpl =================================================================== --- app/views/blogapp/post/image_list.tpl (rev 0) +++ app/views/blogapp/post/image_list.tpl 2008-09-04 17:34:11 UTC (rev 303) @@ -0,0 +1,12 @@ +/* + ["Logo 1", "/home/eerunov/development/local/tmp/editor_javascript/tinymce/examples/logo.jpg"], + ["Logo 2 Over", "/home/eerunov/development/local/tmp/editor_javascript/tinymce/examples/logo_over.jpg"] +*/ +<!-- tinyMCE --> +var tinyMCEImageList = new Array( + // Name, URL + +{loop locals} + ["<?= $local.description; ?>", "<?= $local->url; ?>"], +{end} +); Added: public/javascripts/tiny_mce/blank.htm =================================================================== --- public/javascripts/tiny_mce/blank.htm (rev 0) +++ public/javascripts/tiny_mce/blank.htm 2008-09-04 17:34:11 UTC (rev 303) @@ -0,0 +1,9 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>blank_page</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +</head> +<body class="mceContentBody"> + +</body> +</html> Added: public/javascripts/tiny_mce/langs/en.js =================================================================== --- public/javascripts/tiny_mce/langs/en.js (rev 0) +++ public/javascripts/tiny_mce/langs/en.js 2008-09-04 17:34:11 UTC (rev 303) @@ -0,0 +1,41 @@ +// UK lang variables + +tinyMCE.addToLang('',{ +bold_desc : 'Bold (Ctrl+B)', +italic_desc : 'Italic (Ctrl+I)', +underline_desc : 'Underline (Ctrl+U)', +striketrough_desc : 'Strikethrough', +justifyleft_desc : 'Align left', +justifycenter_desc : 'Align center', +justifyright_desc : 'Align right', +justifyfull_desc : 'Align full', +bullist_desc : 'Unordered list', +numlist_desc : 'Ordered list', +outdent_desc : 'Outdent', +indent_desc : 'Indent', +undo_desc : 'Undo (Ctrl+Z)', +redo_desc : 'Redo (Ctrl+Y)', +link_desc : 'Insert/edit link', +unlink_desc : 'Unlink', +image_desc : 'Insert/edit image', +cleanup_desc : 'Cleanup messy code', +focus_alert : 'A editor instance must be focused before using this command.', +edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?', +insert_link_title : 'Insert/edit link', +insert : 'Insert', +update : 'Update', +cancel : 'Cancel', +insert_link_url : 'Link URL', +insert_link_target : 'Target', +insert_link_target_same : 'Open link in the same window', +insert_link_target_blank : 'Open link in a new window', +insert_image_title : 'Insert/edit image', +insert_image_src : 'Image URL', +insert_image_alt : 'Image description', +help_desc : 'Help', +bold_img : "bold.gif", +italic_img : "italic.gif", +underline_img : "underline.gif", +clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?', +popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.' +}); Added: public/javascripts/tiny_mce/langs/readme.txt =================================================================== --- public/javascripts/tiny_mce/langs/readme.txt (rev 0) +++ public/javascripts/tiny_mce/langs/readme.txt 2008-09-04 17:34:11 UTC (rev 303) @@ -0,0 +1,9 @@ +Beginning with version 2.0.5 the language packs are no +longer included with the core distribution. +Language packs can be downloaded from the TinyMCE website: +http://tinymce.moxiecode.com/download.php + +The language pack codes are based on ISO-639-1: +http://www.loc.gov/standards/iso639-2/englangn.html + +Plrease try using entities if possible. Like å etc for non a-z characters. Added: public/javascripts/tiny_mce/license.txt =================================================================== --- public/javascripts/tiny_mce/license.txt (rev 0) +++ public/javascripts/tiny_mce/license.txt 2008-09-04 17:34:11 UTC (rev 303) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's ... [truncated message content] |
From: <di...@us...> - 2008-09-01 14:10:27
|
Revision: 302 http://isocial.svn.sourceforge.net/isocial/?rev=302&view=rev Author: dim0s77 Date: 2008-09-01 14:10:35 +0000 (Mon, 01 Sep 2008) Log Message: ----------- maked search of groups by group name Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/browse.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-08-29 13:44:26 UTC (rev 301) +++ app/controllers/groupapp/group_controller.php 2008-09-01 14:10:35 UTC (rev 302) @@ -287,8 +287,29 @@ } } + function _get_conditions_for_group( $to_ascii = true ) { + $query = $this->params['group_name']; + $aquery = utf8_to_ascii($query); + if ($to_ascii && $aquery != $query) { + $conditions = 'name LIKE "%' . $query . '%" OR name LIKE "%' . $aquery . '%"'; + } else { + $conditions = 'name LIKE "%' . $query . '%"'; + } + return $conditions; + } + function browse () { - $all_groups = $this->GroupappGroup->find('all'); + $all_groups = array(); + if (empty($this->params['group_name'])) { + $all_groups = $this->GroupappGroup->find('all'); + } else { + $all_groups = $this->GroupappGroup->find('all', + array('conditions' => $this->_get_conditions_for_group(), + 'order' => 'name' + )); + $this->group_name = $this->params['group_name']; + } + if (!($this->all_groups_count = count($all_groups))) { return; } $this->_extract_group_types(); @@ -304,6 +325,9 @@ " BETWEEN " . $this->group_type_id * 100 . " and " . ($this->group_type_id + 1) * 100; $_filter_pagination['count_conditions'] = "type_id" . $type_id; $_filter['conditions'] = 'type_id' . $type_id; + } elseif (!empty($this->params['group_name'])) { + $_filter_pagination['count_conditions'] = $this->_get_conditions_for_group(); + $_filter['conditions'] = $_filter_pagination['count_conditions']; } $group_pages = $this->pagination_helper->getPaginator($this->GroupappGroup, $_filter_pagination);// paginator Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-08-29 13:44:26 UTC (rev 301) +++ app/views/groupapp/group/browse.tpl 2008-09-01 14:10:35 UTC (rev 302) @@ -33,8 +33,8 @@ <div class="right_content"> <div class="title_text">_{Search groups}:</div> - <form> - <input class="mediumtextinput search" id="searchfield" name="" type="text" value="_{Search by name}" onclick="on_search_group_click(this)" onblur="on_search_group_blur(this)" /><a class="submitsearchbtn">_{Search}</a> + <form name="search_group" action="/groupapp/group/browse" method="get"> + <input class="mediumtextinput search" id="searchfield" name="group_name" type="text" value="{?group_name}{group_name}{else}_{Search by name}{end}" onclick="on_search_group_click(this)" onblur="on_search_group_blur(this)" /><a class="submitsearchbtn" onclick="document.search_group.submit();">_{Search}</a> </form> <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-08-29 13:44:16
|
Revision: 301 http://isocial.svn.sourceforge.net/isocial/?rev=301&view=rev Author: dim0s77 Date: 2008-08-29 13:44:26 +0000 (Fri, 29 Aug 2008) Log Message: ----------- added filter and sorting for groups list Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/index.tpl public/stylesheets/groupapp/Group.css Added Paths: ----------- app/views/groupapp/group/_groups_list.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-08-28 13:34:12 UTC (rev 300) +++ app/controllers/groupapp/group_controller.php 2008-08-29 13:44:26 UTC (rev 301) @@ -43,27 +43,36 @@ function index () { $user_groups = $this->current_user->groupapp_group->load(); - $this->user_groups_count = count($user_groups); - $this->sort_type = !empty($this->params['s']) ? $this->params['s'] : ''; - $_filter_pagination = array('items_per_page' => 10); $group_pages = $this->array_pagination_helper->getPaginator("user_group_pages", $user_groups, $_filter_pagination);// paginator + + $this->filter_you_admin = ''; + if (!empty($this->params['you_admin'])) { + $user_groups = $this->_get_group_administrated($user_groups); + $this->filter_you_admin = 'checked'; + } + if (!empty($this->params['sort']) && !empty($this->params['direction'])) { $user_groups = $this->array_pagination_helper->sortByColumn($user_groups, $this->GroupappGroup, $this->params['sort'], $this->params['direction'] ); + $this->sort_column = $this->params['sort']; + $this->sort_direction = $this->params['direction']; } $links = $group_pages->paginator->getLinks(); $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next' ] . ' ' . $links['last']; + $this->sort_by_name_link = $this->array_pagination_helper->sortable_link('name'); + $this->sort_by_members_count_link = $this->array_pagination_helper->sortable_link('members_count'); + $this->user_groups = $this->array_pagination_helper->getPageItems("user_group_pages", $user_groups); $this->user_picture = $this->_current_user_picture(); @@ -436,6 +445,22 @@ return $this->current_user->basic_profile->load()->stored_file_id ? $this->current_user->basic_profile->picture->load()->url() : 'USER_DEFAULT_PICTURE_URL'; } + + function _get_group_administrated($groups) { + $group_administrated = array(); + foreach ($groups as $group) { + $members = $group->groupapp_member->load(); + foreach ($members as $member) { + if ($member->user_id == $this->current_user->getId()) { + if ($member->groupapp_member_role_id < 3) { + $group_administrated[] = $group; + } + continue; + } + } + } + return $group_administrated; + } } ?> Added: app/views/groupapp/group/_groups_list.tpl =================================================================== --- app/views/groupapp/group/_groups_list.tpl (rev 0) +++ app/views/groupapp/group/_groups_list.tpl 2008-08-29 13:44:26 UTC (rev 301) @@ -0,0 +1,50 @@ + <div class="paginationUnder2"> + {pages_links?} + </div> + + <div class="container"> + {loop user_groups} + <div class="group_row"> + + <div class="actions"> + <ul class="actions_list"> + <? $members = $user_group->groupapp_member->load() ?> + {loop members} + <? if ($member->user_id == $current_user->getId() && $member->groupapp_member_role_id < 3): ?> + <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> + <? endif ?> + {end} + <li><a href="#" onclick="leave_this_group(this); return false;" id="{user_group.id?}" name="{user_group.name?}">_{Leave Group}</a></li> + </ul> + </div> + + <div class="avatar"> + {?user_group.stored_file_id} + <? $group_picture = $user_group->picture->load()->url(); ?> + {else} + <? $group_picture = GROUPAPP_DEFAULT_PICTURE_URL; ?> + {end} + <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/preview/100x100/{group_picture}"></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"><span class="param">_{Members count}:</span> + <a href="/groupapp/group/show_members/{user_group.id?}">{user_group.members_count}</a> + </div> + <div class="other"><span class="param">_{Type}:</span> + <? $subtype_id = $user_group->type_id; $type_id = $subgroup_types[$subtype_id]; ?> + <a href="/groupapp/group/browse/?g={type_id?}"><?= $gt[$type_id] ?></a> - + <a href="/groupapp/group/browse/?g={type_id?}&sg={subtype_id?}"><?= $gt[$subtype_id] ?></a> + </div> + </div> + + <div class="clearfix"></div> + </div> + {end} + + </div> + <div class="paginationAbove2"> + {pages_links?} + </div> + <div class="clearfix"></div> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-08-28 13:34:12 UTC (rev 300) +++ app/views/groupapp/group/index.tpl 2008-08-29 13:44:26 UTC (rev 301) @@ -8,7 +8,7 @@ </div> <div class="info"> <div class="header"> - <div class="name groupapp">_{My Groups}</div> + <div class="name groupapp">_{My Groups} ({user_groups_count})</div> </div> <div class="clearfix"></div> <div class="subheader"><a href="/groupapp/group/create">_{Create a New Group}</a></div> @@ -17,73 +17,21 @@ </div> {?user_groups_count} -<div class="submenu_separator"> </div> -<div class="submenu"> - <div class="menu_block selector"> - <label for="action_select">_{Show}: - <select onchange="javascript: window.location.href='?s=' + this.options[this.selectedIndex].value"> - <option <? if(empty($sort_type) || $sort_type == "all"): ?>selected="selected" <? endif ?> value="all">_{All groups}</option> - <option <? if(!empty($sort_type) && $sort_type == "members"): ?>selected="selected" <? endif ?> value="members">_{By Group Member Size}</option> - <option <? if(!empty($sort_type) && $sort_type == "admin"): ?>selected="selected" <? endif ?> value="admin">_{Groups You Admin}</option> - </select> - </label> - </div> -</div> -<div class="clearfix"></div> +<div class="submenu_separator"></div> <div class="groups_list"> - <div class="head">_{You are in groups}: {user_groups_count}</div> - <div class="paginationUnder2"> - {pages_links?} - </div> - - <div class="container"> - {loop user_groups} - <div class="group_row"> - - <div class="actions"> - <ul class="actions_list"> - <? if ($members = $user_group->groupapp_member->load()): ?> - {loop members} - <? if ($member->user_id == $current_user->getId() && $member->groupapp_member_role_id < 3): ?> - <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> - <? endif ?> - {end} - <? endif ?> - <li><a href="#" onclick="leave_this_group(this); return false;" id="{user_group.id?}" name="{user_group.name?}">_{Leave Group}</a></li> - </ul> - </div> - - <div class="avatar"> - {?user_group.stored_file_id} - <? $group_picture = $user_group->picture->load()->url(); ?> - {else} - <? $group_picture = GROUPAPP_DEFAULT_PICTURE_URL; ?> - {end} - <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/preview/100x100/{group_picture}"></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"><span class="param">_{Members count}:</span> - <a href="/groupapp/group/show_members/{user_group.id?}">{user_group.members_count}</a> - </div> - <div class="other"><span class="param">_{Type}:</span> - <? $subtype_id = $user_group->type_id; $type_id = $subgroup_types[$subtype_id]; ?> - <a href="/groupapp/group/browse/?g={type_id?}"><?= $gt[$type_id] ?></a> - - <a href="/groupapp/group/browse/?g={type_id?}&sg={subtype_id?}"><?= $gt[$subtype_id] ?></a> - </div> - </div> - - <div class="clearfix"></div> + <div class="head"> + <div class="left">_{Sort by}: {sort_by_name_link}; {sort_by_members_count_link}</div> + <div class="right"><?= $form_helper->check_box('filter', 'you_admin', array('class' => 'checkboxinput', + 'onclick' => 'filter_you_admin();', + 'checked' => $filter_you_admin)) ?> + _{Groups You Admin} </div> - {end} - + <div class="clearfix"></div> </div> - <div class="paginationAbove2"> - {pages_links?} + <div class="body"> + <?= $controller->renderPartial("groups_list") ?> </div> - <div class="clearfix"></div> </div> {else} @@ -128,7 +76,10 @@ </div> <div class="clearfix"></div> </div> +<input type="hidden" id="sort_column" name="sort_column" value="{sort_column?}" /> +<input type="hidden" id="sort_direction" name="sort_direction" value="{sort_direction?}" /> + <script type="text/javascript"> function leave_this_group (element) { new Dialog.Box(element, { @@ -148,4 +99,16 @@ return false; } +function filter_you_admin() { + var href = ''; + if ($('sort_column').value && $('sort_direction').value) { + href = 'sort=' + $('sort_column').value + '&direction=' + $('sort_direction').value; + } + if ($('filter_you_admin').checked) { + href += href != '' ? '&' : ''; + href += 'you_admin=1'; + } + window.location.href = '?' + href; +} + </script> Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-08-28 13:34:12 UTC (rev 300) +++ public/stylesheets/groupapp/Group.css 2008-08-29 13:44:26 UTC (rev 301) @@ -156,6 +156,10 @@ float: left; } +.groups_list .head .right { + float: right; +} + .groups_list .container { padding: 5px 10px 5px 10px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-08-28 13:34:02
|
Revision: 300 http://isocial.svn.sourceforge.net/isocial/?rev=300&view=rev Author: dim0s77 Date: 2008-08-28 13:34:12 +0000 (Thu, 28 Aug 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/_info.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-08-28 12:03:39 UTC (rev 299) +++ app/controllers/groupapp/group_controller.php 2008-08-28 13:34:12 UTC (rev 300) @@ -73,10 +73,9 @@ function create () { $this->step = 'group_info'; if (!empty($this->params['group'])){ - if (empty($this->params['group']['type_id']) || $this->params['group']['type_id'] == 0) { - $this->addError('_common', 'Group type is missing', 'please select the group type'); - return; - } + if (!isset($group)) { $this->group = new GroupappGroup(); } + $this->group->setAttributes($this->params['group']); + $this->group->category_id = $this->params['group']['category_id']; $this->GroupappGroup->setAttributes($this->params['group']); $this->GroupappGroup->members_count = 1; if ($this->Request->isPost() && $this->GroupappGroup->save()){ Modified: app/views/groupapp/group/_info.tpl =================================================================== --- app/views/groupapp/group/_info.tpl 2008-08-28 12:03:39 UTC (rev 299) +++ app/views/groupapp/group/_info.tpl 2008-08-28 13:34:12 UTC (rev 300) @@ -22,13 +22,13 @@ <label class="required">_{Group Type}:<br><small>(_{required})</small></label> <div class="formcol"> <select id="group_category_id" name="group[category_id]" onchange="on_category_change('group_category_id', category_subtypes, category_sublabels);" typefor="group_type_id"> - <option <? if (!empty($group) && !$group->category_id): ?>selected="selected" <? endif ?>value="">_{Select Category:}</option> + <option <? if (!empty($group) && empty($group->category_id)): ?>selected="selected" <? endif ?>value="">_{Select Category:}</option> {loop group_types} - <option <? if (!empty($group) && $group->category_id == $group_type->id): ?>selected="selected" <? endif ?>value="{group_type.id?}"><?= $gt[$group_type->id] ?></option> + <option <? if (!empty($group) && !empty($group->category_id) && $group->category_id == $group_type->id): ?>selected="selected" <? endif ?>value="{group_type.id?}"><?= $gt[$group_type->id] ?></option> {end} </select> <select id="group_type_id" name="group[type_id]" subtypefor="group_category_id" <? if (empty($group) || !$group->category_id): ?>disabled="disabled" <? endif ?>> - <option <? if (!empty($group) && (!$group->category_id || !$group->type_id)): ?>selected="selected" <? endif ?>value="">_{Select Type:}</option> + <option <? if (!empty($group) && (empty($group->category_id) || empty($group->type_id))): ?>selected="selected" <? endif ?>value="">_{Select Type:}</option> {loop subgroup_types} <? if (empty($group) || $group->category_id != $subgroup_type) continue; ?> <option <? if ($group->type_id == $subgroup_type_loop_key): ?>selected="selected" <? endif ?>value="{subgroup_type_loop_key}"><?= $gt[$subgroup_type_loop_key] ?></option> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-08-28 12:03:31
|
Revision: 299 http://isocial.svn.sourceforge.net/isocial/?rev=299&view=rev Author: dim0s77 Date: 2008-08-28 12:03:39 +0000 (Thu, 28 Aug 2008) Log Message: ----------- Added sorting by column to array_paginator_helper Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/helpers/array_pagination_helper.php app/locales/groupapp/group/ru.php app/views/groupapp/group/index.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-08-26 12:35:38 UTC (rev 298) +++ app/controllers/groupapp/group_controller.php 2008-08-28 12:03:39 UTC (rev 299) @@ -46,13 +46,25 @@ $this->user_groups_count = count($user_groups); + $this->sort_type = !empty($this->params['s']) ? $this->params['s'] : ''; + $_filter_pagination = array('items_per_page' => 10); - $group_pages = $this->array_pagination_helper->getPaginator("user_group_pages", $user_groups, $_filter_pagination);// paginator - + $group_pages = $this->array_pagination_helper->getPaginator("user_group_pages", + $user_groups, + $_filter_pagination);// paginator + if (!empty($this->params['sort']) && !empty($this->params['direction'])) { + $user_groups = $this->array_pagination_helper->sortByColumn($user_groups, + $this->GroupappGroup, + $this->params['sort'], + $this->params['direction'] + ); + } $links = $group_pages->paginator->getLinks(); - $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; - $this->user_groups = $this->array_pagination_helper->getPageItems("user_group_pages", $user_groups); + $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . + $links['pages'] . ' ' . + $links['next' ] . ' ' . $links['last']; + $this->user_groups = $this->array_pagination_helper->getPageItems("user_group_pages", $user_groups); $this->user_picture = $this->_current_user_picture(); $this->_extract_group_types(); Modified: app/helpers/array_pagination_helper.php =================================================================== --- app/helpers/array_pagination_helper.php 2008-08-26 12:35:38 UTC (rev 298) +++ app/helpers/array_pagination_helper.php 2008-08-28 12:03:39 UTC (rev 299) @@ -39,6 +39,28 @@ return $page_items; } + + function sortByColumn($items, $active_record, $column_name, $direction) + { + if (!$active_record->hasColumn($column_name)) { + return $items; + } + switch ($active_record->getColumnType($column_name)) { + case "string": + $f = '$val = strcmp($a->' . $column_name . ', $b->' . $column_name . '); '. + 'return ("' . $direction . '" == "asc") ? $val : $val * -1;'; + usort($items, create_function('$a,$b', $f)); + break; + case "integer": + $f = 'if ($a->' . $column_name . ' == $b->' . $column_name. ') { return 0; } ' . + '$val = ($a->' . $column_name . ' > $b->' . $column_name . ') ? 1 : -1; ' . + 'return ("' . $direction . '" == "asc") ? $val : $val * -1;'; + usort($items, create_function('$a,$b', $f)); + break; + } + return $items; + } + } ?> \ No newline at end of file Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-08-26 12:35:38 UTC (rev 298) +++ app/locales/groupapp/group/ru.php 2008-08-28 12:03:39 UTC (rev 299) @@ -22,10 +22,9 @@ $dictionary['persons'] = 'участников'; $dictionary['Start New Topic'] = 'Начать новую тему'; $dictionary['Topics count'] = 'Обсуждаемых тем'; -$dictionary['All groups'] = 'Все Ваши группы'; -$dictionary['Recently Updated'] = 'Обновленные последними'; +$dictionary['All groups'] = 'Все мои группы'; $dictionary['By Group Member Size'] = 'По количеству пользователей'; -$dictionary['Groups You Admin'] = 'Администрируемые Вами'; +$dictionary['Groups You Admin'] = 'Администрируемые мной'; $dictionary['You are in groups'] = 'Число групп, в которых Вы состоите'; $dictionary['Step'] = 'Шаг'; Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-08-26 12:35:38 UTC (rev 298) +++ app/views/groupapp/group/index.tpl 2008-08-28 12:03:39 UTC (rev 299) @@ -21,11 +21,10 @@ <div class="submenu"> <div class="menu_block selector"> <label for="action_select">_{Show}: - <select onchange="doselect(this)" id="action_select" name="action_select"> - <option selected="selected" value="none">_{All groups}</option> - <option value="read">_{Recently Updated}</option> - <option value="unread">_{By Group Member Size}</option> - <option value="all">_{Groups You Admin}</option> + <select onchange="javascript: window.location.href='?s=' + this.options[this.selectedIndex].value"> + <option <? if(empty($sort_type) || $sort_type == "all"): ?>selected="selected" <? endif ?> value="all">_{All groups}</option> + <option <? if(!empty($sort_type) && $sort_type == "members"): ?>selected="selected" <? endif ?> value="members">_{By Group Member Size}</option> + <option <? if(!empty($sort_type) && $sort_type == "admin"): ?>selected="selected" <? endif ?> value="admin">_{Groups You Admin}</option> </select> </label> </div> @@ -148,4 +147,5 @@ }); return false; } + </script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-08-26 12:35:28
|
Revision: 298 http://isocial.svn.sourceforge.net/isocial/?rev=298&view=rev Author: fsnobody Date: 2008-08-26 12:35:38 +0000 (Tue, 26 Aug 2008) Log Message: ----------- image_list created on system album photos Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/installers/blogapp/blog_installer.php Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-08-26 11:36:51 UTC (rev 297) +++ app/controllers/blogapp/post_controller.php 2008-08-26 12:35:38 UTC (rev 298) @@ -2,7 +2,7 @@ class Blogapp_PostController extends ApplicationController { - var $models = array('blogapp', 'blogapp_post', 'blogapp_attachment', ); + var $models = array('blogapp', 'blogapp_post', 'PhotoappPhoto', 'PhotoappAlbum'); function index () { $this->posts = $this->BlogappPost->find('all', array('conditions' => array('user_id = ' . $this->current_user->getId()))); @@ -22,11 +22,13 @@ function view () { $post = $this->BlogappPost->find($this->params['id']); if ($this->current_user->getId() == $post->user_id ){ +/* $post->media_item->load(); $this->attachments = $post->attachment->load(); foreach ($this->attachments as $k => $attach) { $attach->stored_file->load(); } +*/ $this->post = $post; } @@ -36,22 +38,39 @@ $user_id = $this->current_user->getId(); if ($user_id) { -// $photos = $this->PhotoappPhoto->find('all', array('conditions' => array('album_id = ' . $this->params['id']))); - $file = new StoredFile(); - $file->user_id = $this->current_user->getId(); - $path = $file->path(); - $imgs = array_diff(scandir(AK_PUBLIC_DIR . DS . $path), array('.', '..')); + $album = $this->PhotoappAlbum->findFirst(array('owner' => $this->params['id'], 'is_default' => 1 )); + $photos = array(); + if ($album){ + $_filter = array('conditions' => "album_id =" . $album->getId()); + $photos = $this->PhotoappPhoto->find('all', $_filter); - if (count($imgs) > 0) { - $script = "var tinyMCEImageList = new Array("; - foreach ($imgs as $nn => $img_name) { - $script .= "[\"" . $img_name . "\", \"" . "/preview/100x100/" . $path . $img_name . "\"],"; - } - $script = substr($script, 0, strlen($script) - 1); - $script .=");"; + //print_r($photos); + //echo "#" . count($photos) . "#"; + + $file = new StoredFile(); + $file->user_id = $this->current_user->getId(); + $path = $file->path(); +/* + $imgs = array_diff(scandir(AK_PUBLIC_DIR . DS . $path), array('.', '..')); +*/ + + $script = "var tinyMCEImageList = new Array( "; + if ($photos) { + foreach ($photos as $k => $photo) { + $photo->media_item->load(); + $photo->stored_file->load(); + $img_name = $photo->stored_file->name; + //print_r($photo->media_item->title); + $script .= "[\"" . $img_name . "\", \"" . "/preview/100x100/" . $path . $img_name . "\"],"; + } // foreach + $script = substr($script, 0, strlen($script) - 1); + }// photos + $script .=");"; + } + //$str = $this->renderToString(array( 'template' => 'image_list.tpl', 'locals' => $locals )); //$this->debug($str); return $this->renderText( $script ); Modified: app/installers/blogapp/blog_installer.php =================================================================== --- app/installers/blogapp/blog_installer.php 2008-08-26 11:36:51 UTC (rev 297) +++ app/installers/blogapp/blog_installer.php 2008-08-26 12:35:38 UTC (rev 298) @@ -27,8 +27,8 @@ function down_1() { - $this->dropTable('blogapp_attachments'); - //$this->dropTable('blogapp_posts'); + //$this->dropTable('blogapp_attachments'); + $this->dropTable('blogapp_posts'); } } ?> \ 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-08-26 11:36:41
|
Revision: 297 http://isocial.svn.sourceforge.net/isocial/?rev=297&view=rev Author: fsnobody Date: 2008-08-26 11:36:51 +0000 (Tue, 26 Aug 2008) Log Message: ----------- system album created - only on confirmation, + ui fix Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/controllers/photoapp/album_controller.php app/controllers/user_controller.php Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-08-26 11:14:57 UTC (rev 296) +++ app/controllers/blogapp/post_controller.php 2008-08-26 11:36:51 UTC (rev 297) @@ -2,7 +2,7 @@ class Blogapp_PostController extends ApplicationController { - var $models = array('blogapp', 'blogapp_post', 'blogapp_attachment'); + 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()))); Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-08-26 11:14:57 UTC (rev 296) +++ app/controllers/photoapp/album_controller.php 2008-08-26 11:36:51 UTC (rev 297) @@ -253,6 +253,9 @@ } else if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { // pre delete $this->album = $this->PhotoappAlbum->find($this->params['id']); + if ($this->album->is_default == 1) { + $this->redirectTo(array('action' => 'index')); // system album - not permited for edit + } } } Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-08-26 11:14:57 UTC (rev 296) +++ app/controllers/user_controller.php 2008-08-26 11:36:51 UTC (rev 297) @@ -42,10 +42,11 @@ $user = $this->User->login($email, $password); if ($user && $user->active) { $this->_login($user->id); +/* $system_album = $this->PhotoappAlbum->findFirst(array('owner' => $user->id, 'is_default' => 1)); if (!$system_album) $this->create_system_photoalbum($user); - +*/ if ($remember_me) { setcookie(session_name(), session_id(), time() + 60 * 60 * 24 * 365 * 3, '/'); } @@ -58,9 +59,9 @@ // create system PhotoAlbum $system_album = new $this->PhotoappAlbum; $album_opt = array( - 'name' => 'system', + 'name' => 'unsorted', 'owner' => $user->getId(), - 'description' => 'system storage', + 'description' => 'unsorted, uploaded by blog images', 'is_default' => 1 ); $system_album->setAttributes($album_opt); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-08-26 11:14:47
|
Revision: 296 http://isocial.svn.sourceforge.net/isocial/?rev=296&view=rev Author: fsnobody Date: 2008-08-26 11:14:57 +0000 (Tue, 26 Aug 2008) Log Message: ----------- close ui for edit or delete system(default) album Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/controllers/photoapp/album_controller.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/index.tpl Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-08-26 11:13:00 UTC (rev 295) +++ app/controllers/blogapp/post_controller.php 2008-08-26 11:14:57 UTC (rev 296) @@ -33,19 +33,15 @@ } // view function image_list () { -$script = "var tinyMCEImageList = new Array( - [\"Logo 1\", \"/home/eerunov/development/local/tmp/editor_javascript/tinymce/examples/logo.jpg\"], - [\"Logo 2 Over\", \"/home/eerunov/development/local/tmp/editor_javascript/tinymce/examples/logo_over.jpg\"] -);"; - $user_id = $this->current_user->getId(); if ($user_id) { + +// $photos = $this->PhotoappPhoto->find('all', array('conditions' => array('album_id = ' . $this->params['id']))); $file = new StoredFile(); $file->user_id = $this->current_user->getId(); $path = $file->path(); - //$this->debug($path); $imgs = array_diff(scandir(AK_PUBLIC_DIR . DS . $path), array('.', '..')); - //$this->debug($imgs); + if (count($imgs) > 0) { $script = "var tinyMCEImageList = new Array("; foreach ($imgs as $nn => $img_name) { Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-08-26 11:13:00 UTC (rev 295) +++ app/controllers/photoapp/album_controller.php 2008-08-26 11:14:57 UTC (rev 296) @@ -221,6 +221,9 @@ } } else if ($this->params['id']) { $this->album = $this->PhotoappAlbum->find($this->params['id']); + if ($this->album->is_default == 1) { + $this->redirectTo(array('action' => 'index')); // system album - not permited for edit + } return; } } @@ -232,8 +235,8 @@ if (!empty($this->params['album']) ){ // delete $album = $this->PhotoappAlbum->find($this->params['id']); - if ($album && $album->get('owner') == $this->current_user->getId() && $this->Request->isPost()) { - + + if ($album && $album->get('owner') == $this->current_user->getId() && $this->Request->isPost() && $album->is_default == 0) { $photos = $this->PhotoappPhoto->find('all', array('conditions' => array('album_id = ' . $this->params['id']))); if ($photos) { $this->PhotoappPhoto->destroyAll("album_id = " . $this->params['id']); // delete photos in album @@ -244,6 +247,8 @@ } else { $this->importErrors( $this->PhotoappAlbum->getErrors() ); } + } else { + $this->redirectTo(array('action' => 'index')); // can't be deleted } } else if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { // pre delete Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-08-26 11:13:00 UTC (rev 295) +++ app/views/photoapp/album/_edit_menu.tpl 2008-08-26 11:14:57 UTC (rev 296) @@ -4,8 +4,8 @@ <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> + ?><? if ($album->is_default == 0) {?><li><a href="/photoapp/album/edit/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit info}</a></li><?}?><? + ?><? if ($album->is_default == 0) {?><li><a href="/photoapp/album/delete/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li><?}?> </ul> </div> </div> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-08-26 11:13:00 UTC (rev 295) +++ app/views/photoapp/album/index.tpl 2008-08-26 11:14:57 UTC (rev 296) @@ -40,7 +40,7 @@ <ul class="actions_list"> <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> + <? if ($my_album->is_default == 0) {?><li><a href="/photoapp/album/delete/<?= $my_album->getId()?>">_{Delete Album}</a></li><?}?> </ul> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-08-26 11:12:50
|
Revision: 295 http://isocial.svn.sourceforge.net/isocial/?rev=295&view=rev Author: dim0s77 Date: 2008-08-26 11:13:00 +0000 (Tue, 26 Aug 2008) Log Message: ----------- Show all groups in browse page by default Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/browse.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-08-26 10:23:36 UTC (rev 294) +++ app/controllers/groupapp/group_controller.php 2008-08-26 11:13:00 UTC (rev 295) @@ -273,13 +273,19 @@ $this->_extract_group_types(); $all_group_types = $this->GroupappGroupType->find('all'); - $this->group_type_id = (!empty($this->params['g']) && is_numeric($this->params['g'])) ? $this->params['g'] : 2; + $this->group_type_id = (!empty($this->params['g']) && is_numeric($this->params['g'])) ? $this->params['g'] : 0; $this->subgroup_type_id = (!empty($this->params['sg']) && is_numeric($this->params['sg'])) ? $this->params['sg'] : 0; - $type_id = $this->subgroup_type_id > 0 ? " = " . $this->subgroup_type_id : - " BETWEEN " . $this->group_type_id * 100 . " and " . ($this->group_type_id + 1) * 100; + $type_id = ''; + $_filter_pagination = array('items_per_page' => 10); + $_filter = array('include' => 'picture'); + if ($this->group_type_id) { + $type_id = $this->subgroup_type_id > 0 ? " = " . $this->subgroup_type_id : + " BETWEEN " . $this->group_type_id * 100 . " and " . ($this->group_type_id + 1) * 100; + $_filter_pagination['count_conditions'] = "type_id" . $type_id; + $_filter['conditions'] = 'type_id' . $type_id; + } - $_filter_pagination = array('items_per_page' => 10, 'count_conditions' => "type_id" . $type_id ); $group_pages = $this->pagination_helper->getPaginator($this->GroupappGroup, $_filter_pagination);// paginator $this->first_group = ($group_pages->getCurrentPage() - 1) * $group_pages->getItemsPerPage() + 1; $this->last_group = ($group_pages->getCurrentPage() * $group_pages->getItemsPerPage() < $group_pages->getItemCount()) ? @@ -289,7 +295,6 @@ $links = $group_pages->paginator->getLinks(); $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; - $_filter = array('conditions' => 'type_id' . $type_id, 'include' => 'picture'); $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); $this->groups = $this->GroupappGroup->find('all', $options); Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-08-26 10:23:36 UTC (rev 294) +++ app/views/groupapp/group/browse.tpl 2008-08-26 11:13:00 UTC (rev 295) @@ -43,11 +43,13 @@ <div class="title_text">_{Filter groups by}:</div> <div class="filter_name">_{type}</div> <select id="group_type_id" onchange="javascript: window.location.href='?g=' + this.options[this.selectedIndex].value"> + <option <? if($group_type_id == 0): ?>selected="selected" <? endif ?>value="0">_{All}</option> {loop group_types} <option <? $this_group_type_id = $group_type->id ?><? if($this_group_type_id == $group_type_id): ?>selected="selected" <? endif ?>value="{group_type.id?}"><?= $gt[$this_group_type_id] ?></option> {end} </select> + <? if($group_type_id): ?> <div class="filter_name">_{subtype}</div> <ul class="subgroups_list"> <? if ($subgroup_type_id == 0): ?> @@ -64,6 +66,8 @@ <? endif ?> {end} </ul> + <? endif ?> + </div> </div> @@ -99,7 +103,7 @@ <a href="/groupapp/group/show_members/{group.id?}">{group.members_count}</a> </div> <div class="other"><span class="param">_{Type}:</span> - <a href="/groupapp/group/browse/?g={group_type_id}"><?= $gt[$group_type_id] ?></a> - + <a href="/groupapp/group/browse/?g={group_type_id}"><?= $gt[$subgroup_types[$group->type_id]] ?></a> - <a href="/groupapp/group/browse/?g={group_type_id}&sg={group.type_id}"><?= $gt[$group->type_id] ?></a> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-08-26 10:23:27
|
Revision: 294 http://isocial.svn.sourceforge.net/isocial/?rev=294&view=rev Author: fsnobody Date: 2008-08-26 10:23:36 +0000 (Tue, 26 Aug 2008) Log Message: ----------- create system photoalbum on confirm or first login (is_default=1) Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/controllers/user_controller.php app/installers/blogapp/blog_installer.php app/installers/photoapp/album_installer.php app/models/blogapp_post.php app/views/blogapp/post/_form.tpl Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-08-25 12:48:57 UTC (rev 293) +++ app/controllers/blogapp/post_controller.php 2008-08-26 10:23:36 UTC (rev 294) @@ -8,7 +8,7 @@ $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]->media_item->load(); /* $this->posts[$i]->attachments = $this->posts[$i]->attachment->load(); foreach ($this->posts[$i]->attachments as $k => $attach) { @@ -32,6 +32,36 @@ } // view + function image_list () { +$script = "var tinyMCEImageList = new Array( + [\"Logo 1\", \"/home/eerunov/development/local/tmp/editor_javascript/tinymce/examples/logo.jpg\"], + [\"Logo 2 Over\", \"/home/eerunov/development/local/tmp/editor_javascript/tinymce/examples/logo_over.jpg\"] +);"; + + $user_id = $this->current_user->getId(); + if ($user_id) { + $file = new StoredFile(); + $file->user_id = $this->current_user->getId(); + $path = $file->path(); + //$this->debug($path); + $imgs = array_diff(scandir(AK_PUBLIC_DIR . DS . $path), array('.', '..')); + //$this->debug($imgs); + if (count($imgs) > 0) { + $script = "var tinyMCEImageList = new Array("; + foreach ($imgs as $nn => $img_name) { + $script .= "[\"" . $img_name . "\", \"" . "/preview/100x100/" . $path . $img_name . "\"],"; + } + $script = substr($script, 0, strlen($script) - 1); + $script .=");"; + } + + + //$str = $this->renderToString(array( 'template' => 'image_list.tpl', 'locals' => $locals )); + //$this->debug($str); + return $this->renderText( $script ); + } + } // image_list + function create () { if (!empty($this->params['post']) && $this->Request->isPost() ){ $post = $this->BlogappPost; Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-08-25 12:48:57 UTC (rev 293) +++ app/controllers/user_controller.php 2008-08-26 10:23:36 UTC (rev 294) @@ -2,7 +2,7 @@ class UserController extends ApplicationController { - var $models = array('User', 'Confirmation', 'GroupappGroup'); + var $models = array('User', 'Confirmation', 'GroupappGroup', 'PhotoappAlbum'); function beforeAction ( $method = '' ) { @@ -42,6 +42,10 @@ $user = $this->User->login($email, $password); if ($user && $user->active) { $this->_login($user->id); + $system_album = $this->PhotoappAlbum->findFirst(array('owner' => $user->id, 'is_default' => 1)); + if (!$system_album) + $this->create_system_photoalbum($user); + if ($remember_me) { setcookie(session_name(), session_id(), time() + 60 * 60 * 24 * 365 * 3, '/'); } @@ -50,6 +54,19 @@ return false; } + function create_system_photoalbum($user) { + // create system PhotoAlbum + $system_album = new $this->PhotoappAlbum; + $album_opt = array( + 'name' => 'system', + 'owner' => $user->getId(), + 'description' => 'system storage', + 'is_default' => 1 + ); + $system_album->setAttributes($album_opt); + $system_album->save(); + } + function logout () { $this->_logout(); $this->redirectToAction( 'login' ); @@ -84,6 +101,8 @@ $user->active = 1; if ($user->save()) { $confirmation->destroy(); + $this->create_system_photoalbum($user); + $this->sendMail($user->email); return; } Modified: app/installers/blogapp/blog_installer.php =================================================================== --- app/installers/blogapp/blog_installer.php 2008-08-25 12:48:57 UTC (rev 293) +++ app/installers/blogapp/blog_installer.php 2008-08-26 10:23:36 UTC (rev 294) @@ -13,6 +13,7 @@ FOREIGN KEY (media_item_id) REFERENCES media_items(id) ) ENGINE=InnoDB"); +/* $this->execute( "CREATE TABLE `blogapp_attachments` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -20,12 +21,14 @@ `base_file_id` int(11) NOT NULL, FOREIGN KEY (base_file_id) REFERENCES base_files(id) ) ENGINE=InnoDB"); +*/ } + function down_1() { $this->dropTable('blogapp_attachments'); - $this->dropTable('blogapp_posts'); + //$this->dropTable('blogapp_posts'); } } ?> \ No newline at end of file Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-08-25 12:48:57 UTC (rev 293) +++ app/installers/photoapp/album_installer.php 2008-08-26 10:23:36 UTC (rev 294) @@ -15,7 +15,8 @@ `privacy` char(100) NOT NULL DEFAULT '', `description` char(255) NOT NULL DEFAULT '', `created_at` datetime NOT NULL , - `img` char(255) NOT NULL DEFAULT '' + `img` char(255) NOT NULL DEFAULT '', + `is_default` int(1) NOT NULL DEFAULT 0 ) ENGINE=InnoDB"); Modified: app/models/blogapp_post.php =================================================================== --- app/models/blogapp_post.php 2008-08-25 12:48:57 UTC (rev 293) +++ app/models/blogapp_post.php 2008-08-26 10:23:36 UTC (rev 294) @@ -11,8 +11,7 @@ 'primary_key_name' => 'media_item_id') ); - var $has_many = array( 'attachments' => array('class_name' => 'BlogappAttachment', - 'foreign_key' => 'post_id') ); + //var $has_many = array( 'attachments' => array('class_name' => 'BlogappAttachment', 'foreign_key' => 'post_id') ); Modified: app/views/blogapp/post/_form.tpl =================================================================== --- app/views/blogapp/post/_form.tpl 2008-08-25 12:48:57 UTC (rev 293) +++ app/views/blogapp/post/_form.tpl 2008-08-26 10:23:36 UTC (rev 294) @@ -1,3 +1,33 @@ +<script src="/javascripts/tiny_mce/tiny_mce.js" type="text/javascript"></script> +<!-- tinyMCE --> +<script language="javascript" type="text/javascript"> + // Notice: The simple theme does not use all options some of them are limited to the advanced theme + tinyMCE.init({ + mode : "textareas", + theme : "advanced", + plugins : "advimage", + external_image_list_url : "http://isocial/blogapp/post/image_list", + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,image", + theme_advanced_buttons2 : "", + theme_advanced_buttons3 : "", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "center", + file_browser_callback : "fileBrowserCallBack", + extended_valid_elements : "a[name|href|target|title|onclick]" + + }); + + + function fileBrowserCallBack(field_name, url, type, win) { + // This is where you insert your custom filebrowser logic + //alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type); + //alert(win.document.getElementById(field_name)); + // win.document.getElementById(field_name).select(); + // Insert new URL, this would normaly be done in a popup + //win.document.forms[0].elements[field_name].value = "someurl.htm"; + } +</script> +<!-- /tinyMCE --> <div class="formrow"> <?= $controller->renderErrors() ?> </div> @@ -14,10 +44,16 @@ <label class="required">_{Body}:<br><small>(_{required})</small></label> <div class="formcol"> <?= $form_helper->text_area('post', 'body', array('rows' => '5')) ?> + <!--textarea id="elm1" name="elm1" rows="10" cols="40"> + Some <b>element</b>, this is to be editor 1. + <p>Some paragraph. <a href="http://www.sourceforge.net">Some link</a></p> + <img src="logo.jpg"> + </textarea --> </div> <div class="clearfix"></div> </div> +<!-- <div class="formrow"> <label class="required">_{Attach}:<br><small>(_{required})</small></label> <div class="formcol"> @@ -25,4 +61,5 @@ </div> <div class="clearfix"></div> </div> +--> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-08-25 12:49:14
|
Revision: 293 http://isocial.svn.sourceforge.net/isocial/?rev=293&view=rev Author: aguidrevitch Date: 2008-08-25 12:48:57 +0000 (Mon, 25 Aug 2008) Log Message: ----------- warning fixed Modified Paths: -------------- app/application_controller.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-08-25 12:41:19 UTC (rev 292) +++ app/application_controller.php 2008-08-25 12:48:57 UTC (rev 293) @@ -193,8 +193,10 @@ $headers = array(); $lines = preg_split('/\r?\n/', $header); foreach ($lines as $line) { - list( $name, $value ) = preg_split('/\s*:\s*/', $line, 2); - $headers[$name] = $value; + @list( $name, $value ) = preg_split('/\s*:\s*/', $line, 2); + if ($name && $value) { + $headers[$name] = $value; + } } return $headers; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-08-25 12:41:15
|
Revision: 292 http://isocial.svn.sourceforge.net/isocial/?rev=292&view=rev Author: aguidrevitch Date: 2008-08-25 12:41:19 +0000 (Mon, 25 Aug 2008) Log Message: ----------- patch against latest akelos Modified Paths: -------------- akelos.diff Modified: akelos.diff =================================================================== --- akelos.diff 2008-08-25 12:39:39 UTC (rev 291) +++ akelos.diff 2008-08-25 12:41:19 UTC (rev 292) @@ -1,8 +1,8 @@ Index: lib/Ak.php =================================================================== ---- lib/Ak.php (revision 834) +--- lib/Ak.php (revision 1030) +++ lib/Ak.php (working copy) -@@ -183,6 +183,11 @@ +@@ -186,6 +186,11 @@ return @$string[$try_whith_lang]; } @@ -14,7 +14,7 @@ if(isset($controller) && !isset($framework_dictionary[$controller.'_dictionary']) && is_file(AK_APP_DIR.DS.'locales'.DS.$controller.DS.$lang.'.php')){ require(AK_APP_DIR.DS.'locales'.DS.$controller.DS.$lang.'.php'); $framework_dictionary[$controller.'_dictionary'] = (array)$dictionary; -@@ -190,6 +195,8 @@ +@@ -193,6 +198,8 @@ if(isset($controller) && isset($framework_dictionary[$controller.'_dictionary'][$string])){ $string = $framework_dictionary[$controller.'_dictionary'][$string]; @@ -23,17 +23,17 @@ }else { $string = isset($framework_dictionary[$string]) ? $framework_dictionary[$string] : $string; } -@@ -351,7 +358,6 @@ +@@ -354,7 +361,6 @@ if(!is_dir(dirname($options['base_path'].DS.$file_name))){ Ak::make_dir(dirname($options['base_path'].DS.$file_name), $options); } - if(!$result = file_put_contents($options['base_path'].DS.$file_name, $content)){ if(!empty($content)){ - Ak::trace("Please change file/dir permissions or enable FTP file handling by". + Ak::trace("Could not write to file: \"".$options['base_path'].DS."$file_name\". Please change file/dir permissions or enable FTP file handling by". Index: lib/AkActionController.php =================================================================== ---- lib/AkActionController.php (revision 834) +--- lib/AkActionController.php (revision 1030) +++ lib/AkActionController.php (working copy) @@ -749,7 +749,14 @@ */ @@ -63,7 +63,7 @@ Index: lib/AkInstaller.php =================================================================== ---- lib/AkInstaller.php (revision 834) +--- lib/AkInstaller.php (revision 1030) +++ lib/AkInstaller.php (working copy) @@ -358,11 +358,13 @@ @@ -86,7 +86,7 @@ } Index: lib/AkActionView/helpers/text_helper.php =================================================================== ---- lib/AkActionView/helpers/text_helper.php (revision 834) +--- lib/AkActionView/helpers/text_helper.php (revision 1030) +++ lib/AkActionView/helpers/text_helper.php (working copy) @@ -518,8 +518,18 @@ */ @@ -111,9 +111,9 @@ /** Index: lib/AkActiveRecord.php =================================================================== ---- lib/AkActiveRecord.php (revision 834) +--- lib/AkActiveRecord.php (revision 1030) +++ lib/AkActiveRecord.php (working copy) -@@ -5013,6 +5013,7 @@ +@@ -4998,6 +4998,7 @@ $sql .= empty($options['joins']) ? '' : " {$options['joins']} "; @@ -121,7 +121,7 @@ empty($options['conditions']) ? null : $this->addConditions($sql, $options['conditions']); if (!empty($options['group'])){ -@@ -5023,6 +5024,11 @@ +@@ -5008,6 +5009,11 @@ $sql .= empty($options['order']) ? '' : " ORDER BY {$options['order']} "; $this->_db->addLimitAndOffset($sql, $options); $sql .= $use_workaround ? ')' : ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-08-25 12:39:30
|
Revision: 291 http://isocial.svn.sourceforge.net/isocial/?rev=291&view=rev Author: aguidrevitch Date: 2008-08-25 12:39:39 +0000 (Mon, 25 Aug 2008) Log Message: ----------- warning suppressed Modified Paths: -------------- app/controllers/groupapp/group_controller.php Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-08-15 07:26:28 UTC (rev 290) +++ app/controllers/groupapp/group_controller.php 2008-08-25 12:39:39 UTC (rev 291) @@ -418,7 +418,7 @@ function _current_user_picture () { return $this->current_user->basic_profile->load()->stored_file_id ? - $this->current_user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; + $this->current_user->basic_profile->picture->load()->url() : 'USER_DEFAULT_PICTURE_URL'; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-08-15 07:26:18
|
Revision: 290 http://isocial.svn.sourceforge.net/isocial/?rev=290&view=rev Author: dim0s77 Date: 2008-08-15 07:26:28 +0000 (Fri, 15 Aug 2008) Log Message: ----------- added friend selector helper Added Paths: ----------- app/helpers/friend_selector_helper.php Added: app/helpers/friend_selector_helper.php =================================================================== --- app/helpers/friend_selector_helper.php (rev 0) +++ app/helpers/friend_selector_helper.php 2008-08-15 07:26:28 UTC (rev 290) @@ -0,0 +1,141 @@ +<? + +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'tag_helper.php'); +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'form_helper.php'); + +class FriendSelectorHelper extends AkActionViewHelper +{ + function row_selector ($object, $method, $options = array()) { + $groups_title = $this->t('groups'); + $friends_title = $this->t('friends'); + + $show_groups = (!empty($options['show_groups']) && $options['show_groups']) ? true : false; + + $content = ''; + if ($show_groups) { + $groups = $this->_user_groups(); + $content .= $this->_add_selector_content('group', $groups, 'row', $groups_title); + } + $friends = $this->_user_friends(); + $content .= $this->_add_selector_content('user', $friends, 'row', $friends_title); + + return $this->_selector($content, $options); + } + + function thumb_selector ($object, $method, $options = array()) { + return $this->_selector(); + } + + function _selector ($content, $options) { + $div = TagHelper::content_tag('div', + $content, + array('class' => 'friend_selector') + ); + return $div; + } + + function _user_groups () { + $current_user = $this->_controller->current_user; + $user_groups = $current_user->groupapp_group->load(); + + $groups = array(); + foreach ($user_groups as $user_group) { + if ($members = $user_group->groupapp_member->load()) { + foreach($members as $member) { + if ($member->user_id == $current_user->getId() && $member->groupapp_member_role_id < 3) { + $groups[] = $user_group; + } + } + } + } + return $groups; + } + + function _user_friends () { + $current_user = $this->_controller->current_user; + return $current_user->getFriends(); + } + + function _add_selector_content ($object, $content_data, $style, $title_text) { + if (empty($content_data)) { return; } + + $all = $this->t('All'); + + $title = TagHelper::content_tag('div', + $title_text, + array('class' => 'content_title') + ); + + $check_box = $this->_controller->form_helper->check_box('all_' . $object); + $check_box_div = TagHelper::content_tag('div', + $check_box, + array('class' => 'friend_check') + ); + + $photo = '<img src="/preview/30x30//images/nophoto_group.gif">'; + $photo_div = TagHelper::content_tag('div', + $photo, + array('class' => 'friend_photo') + ); + + $clearfix = TagHelper::content_tag('div', '', array('class' => 'clearfix')); + + $name_div = TagHelper::content_tag('div', + $all, + array('class' => 'friend_name') + ); + + $friend_row = TagHelper::content_tag('div', + $check_box_div . "\n". $photo_div . "\n" . $name_div . "\n" . $clearfix, + array('class' => 'friend_row') + ); + + foreach ($content_data as $data) { + $check_box = $this->_controller->form_helper->check_box($object, $data->getId()); + $check_box_div = TagHelper::content_tag('div', + $check_box, + array('class' => 'friend_check') + ); + + $picture = ''; + $href = ''; + if ($object == 'group') { + $picture = $data->stored_file_id ? $data->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + $href = '/groupapp/group/show_group/'; + } else { + $picture = $data->basic_profile->load()->stored_file_id ? $data->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; + $href = '/profile/show/'; + } + $href .= $data->getId(); + + $photo = '<img src="/preview/30x30/' . $picture . '">'; + $photo_div = TagHelper::content_tag('div', + $photo, + array('class' => 'friend_photo') + ); + + $clearfix = TagHelper::content_tag('div', '', array('class' => 'clearfix')); + + $name_div = TagHelper::content_tag('div', + $data->name, + array('class' => 'friend_name') + ); + + $profile_url = TagHelper::content_tag('a', $photo_div . "\n" . $name_div, array('href' => $href)); + + $friend_row .= TagHelper::content_tag('div', + $check_box_div . "\n". $profile_url . "\n" . $clearfix, + array('class' => 'friend_row') + ); + } + + + $content = TagHelper::content_tag('div', + $title . "\n" . $friend_row, + array('class' => 'content') + ); + return $content; + } +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-15 18:55:43
|
Revision: 289 http://isocial.svn.sourceforge.net/isocial/?rev=289&view=rev Author: dim0s77 Date: 2008-07-15 11:55:52 -0700 (Tue, 15 Jul 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/application_controller.php app/controllers/groupapp/group_controller.php app/views/groupapp/board/index.tpl app/views/groupapp/group/show_group.tpl config/DEFAULT-config.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-07-15 18:39:12 UTC (rev 288) +++ app/application_controller.php 2008-07-15 18:55:52 UTC (rev 289) @@ -4,8 +4,6 @@ require_once(AK_VENDOR_DIR.DS.'phputf8'.DS.'ucfirst.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); -define('USER_DEFAULT_PICTURE_URL', "/images/nophoto_men_sm.gif"); - /** * This file is application-wide controller file. You can put all * application-wide controller-related methods here. Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-15 18:39:12 UTC (rev 288) +++ app/controllers/groupapp/group_controller.php 2008-07-15 18:55:52 UTC (rev 289) @@ -1,7 +1,5 @@ <?php -define('GROUPAPP_DEFAULT_PICTURE_URL', "/images/nophoto_group.gif"); - class Groupapp_GroupController extends ApplicationController { var $models = array('GroupappGroup', 'GroupappGroupType', Modified: app/views/groupapp/board/index.tpl =================================================================== --- app/views/groupapp/board/index.tpl 2008-07-15 18:39:12 UTC (rev 288) +++ app/views/groupapp/board/index.tpl 2008-07-15 18:55:52 UTC (rev 289) @@ -57,7 +57,7 @@ <div class="row<? if ($topic_loop_counter != 1) echo ' notfirst'; ?>"> <div class="topic_info"> - <div class="subject"><a href="/groupapp/board/show_topic/{topic-first.topic_id?}">{topic-first.subject?}</a></div> + <div class="subject"><a href="/groupapp/board/show_topic/{group.id}/?t={topic-first.topic_id?}">{topic-first.subject?}</a></div> <div class="subtext black">_{posts}: {topic-posts?}; _{persons}: {topic-persons?}</div> <div class="subtext">_{Created on} {topic-first.created_at?}</div> </div> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-15 18:39:12 UTC (rev 288) +++ app/views/groupapp/group/show_group.tpl 2008-07-15 18:55:52 UTC (rev 289) @@ -125,7 +125,7 @@ <div class="simple_list"> {loop topics} <div class="row"> - <div class="box_title">{topic-first.subject?}</div> + <div class="box_title"><a href="/groupapp/board/show_topic/{group.id}/?t={topic-first.topic_id?}">{topic-first.subject?}</a></div> <div class="subtext black">_{posts}: {topic-posts?}; _{persons}: {topic-persons?}</div> <div class="subtext">_{Updated on} {topic-last.created_at?}</div> </div> Modified: config/DEFAULT-config.php =================================================================== --- config/DEFAULT-config.php 2008-07-15 18:39:12 UTC (rev 288) +++ config/DEFAULT-config.php 2008-07-15 18:55:52 UTC (rev 289) @@ -56,6 +56,9 @@ define('PROJECT_NAME', 'iSocial'); define('NOREPLY_EMAIL', 'no-reply <no-...@is...>'); +define('USER_DEFAULT_PICTURE_URL', "/images/nophoto_men_sm.gif"); +define('GROUPAPP_DEFAULT_PICTURE_URL', "/images/nophoto_group.gif"); + if (!defined('NOREPLY_EMAIL') || !defined('PROJECT_NAME')) { die("NOREPLY_EMAIL, PROJECT_NAME should be defined"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-15 18:39:02
|
Revision: 288 http://isocial.svn.sourceforge.net/isocial/?rev=288&view=rev Author: dim0s77 Date: 2008-07-15 11:39:12 -0700 (Tue, 15 Jul 2008) Log Message: ----------- added user photo to profile and groupapp. refactoring Modified Paths: -------------- app/application_controller.php app/controllers/groupapp/board_controller.php app/controllers/groupapp/group_controller.php app/controllers/profile_controller.php app/installers/user_installer.php app/locales/groupapp/group/ru.php app/locales/layout/ru.php app/models/basic_profile.php app/models/groupapp_message.php app/models/user.php app/views/groupapp/board/_head.tpl app/views/groupapp/board/_menu.tpl app/views/groupapp/board/reply_to_post.tpl app/views/groupapp/board/reply_to_topic.tpl app/views/groupapp/board/show_topic.tpl app/views/groupapp/group/_picture_upload.tpl app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/index.tpl app/views/groupapp/group/show_group.tpl app/views/layouts/application.tpl app/views/profile/picture.tpl public/stylesheets/friend_selector.css public/stylesheets/groupapp/Group.css Added Paths: ----------- public/stylesheets/upload_picture.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/application_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -4,6 +4,8 @@ require_once(AK_VENDOR_DIR.DS.'phputf8'.DS.'ucfirst.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); +define('USER_DEFAULT_PICTURE_URL', "/images/nophoto_men_sm.gif"); + /** * This file is application-wide controller file. You can put all * application-wide controller-related methods here. Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/controllers/groupapp/board_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -4,15 +4,28 @@ { var $models = array('GroupappMessage', 'GroupappGroup', 'GroupappMember', 'User'); + function beforeAction ( $method = '' ) { + parent::beforeAction($method); + + if (!empty($this->params['id'])) { + $group = $this->GroupappGroup->find( $this->params['id'] ); + if (isset($group)) { + $this->group = $group; + $this->groupapp_group_id = $group->getId(); + $this->group_name = $group->name; + $this->group_picture = $this->_group_picture($group); + } + } + } + function index () { - if (!empty($this->params['id'])) { + if (isset($this->group)) { $messages = $this->GroupappMessage->find('all', array( - 'conditions' => array("groupapp_group_id = ?", $this->params['id']), - 'include' => 'user' + 'conditions' => array("groupapp_group_id" => $this->group->getId()), + 'include' => 'user' ) ); - $group = $this->GroupappGroup->find( $this->params['id'] ); $topics = array(); $persons = array(); if(!empty($messages)) { @@ -33,30 +46,28 @@ $topics[$message->topic_id]['last'] = $message; } } - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; $this->topics = $topics; } } function show_topic () { - if (!empty($this->params['id'])) { + if (isset($this->group) && !empty($this->params['t'])) { $messages = $this->GroupappMessage->find('all', - array( - 'conditions' => array("topic_id = ?", $this->params['id']), - 'include' => 'user' - ) - ); + array( + 'conditions' => array( + "groupapp_group_id" => $this->group->getId(), + "topic_id" => $this->params['t']), + 'include' => 'user' + ) + ); if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, - 'user_id' => $this->current_user->getId() - )); - $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); - if (($group && $group->access == 1) || $member) { + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + )); + if ($this->group->access == 1 || $member) { $this->messages = $messages; - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $messages[0]->topic_id; + $this->topic_id = $this->params['t']; } else { $this->addError('_common', 'Access denied', 'Group id closed. You can\'t to see this topic'); } @@ -65,131 +76,142 @@ } $this->addError('_common', 'Topic not found', 'This topic is not founded'); } - + function start_topic () { - if (!empty($this->params['topic']) && - !empty($this->params['topic']['groupapp_group_id']) && - !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), - 'user_id' => $this->current_user->getId() - )); - if ($member) { - $message = $member->message->build(); - $message->setAttributes($this->params['topic']); - if (empty($message->subject)) { - $message->subject = $this->t('(no topic)'); - } - if ($message->save()) { - if (!$message->topic_id) { - $message->topic_id = $message->getId(); - if ($message->save()) { - $this->redirectTo(array('action' => 'show_topic', 'id' => $message->getId())); - return; - } - } - } - } + if (!isset($this->group)) { + $this->addError('_common', 'Start topic error', 'please, specify group'); + return; + } + if (empty($this->params['topic']) && empty($this->params['topic']['body'])) { + $this->topic = $this->group->message->build(); + $this->topic_id = $this->topic->getId(); + } else { + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + )); + if (empty($member)) { + $this->addError('_common', 'Sending message error', 'please, try again'); + return; } - $this->addError('_common', 'Sending message error', 'please, try again'); - } else if (!empty($this->params['id'])) { - if ( $group = $this->GroupappGroup->find( $this->params['id'] ) ) { - $this->topic = $group->message->build(); - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $this->topic->getId(); + + $message = $this->current_user->groupapp_message->build(); + $message->setAttributes($this->params['topic']); + $message->assign($this->group); + + if (empty($message->subject)) { $message->subject = $this->t('(no topic)'); } + + if ($message->save()) { + $message->topic_id = $message->getId(); + $message->save(); + $this->redirectToAction('show_topic', array('id' => $this->group->getId(), + 't' => $message->topic_id)); } - } else { - $this->addError('_common', 'Start topic error', 'please, specify group'); } } + function reply_to_topic () { + if (!isset($this->group) || empty($this->params['t'])) { + $this->addError('_common', 'Reply to topic error', 'please, specify topic'); + return; + } - function reply_to_topic () { - if (!empty($this->params['topic']) && - !empty($this->params['topic']['groupapp_group_id']) && - !empty($this->params['topic']['topic_id']) && - !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), - 'user_id' => $this->current_user->getId() - )); - if ($member) { - $message = $member->message->build(); - $message->setAttributes($this->params['topic']); - if ($message->save()) { - $this->redirectTo(array('action' => 'show_topic', 'id' => $message->topic_id)); - return; - } + $topic = $this->GroupappMessage->find('all', + array( + 'conditions' => array( + "groupapp_group_id" => $this->group->getId(), + "topic_id" => $this->params['t']) + ) + ); + if (empty($topic)) { + $this->addError('_common', 'Reply to topic error', 'topic not found'); + return; + } + + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + ) + ); + $this->topic_id = $this->params['t']; + + if ($this->Request->isPost() && + !empty($this->params['topic']) && + !empty($this->params['topic']['body']) + ) { + if ($member) { + $message = $this->current_user->groupapp_message->build(); + $message->setAttributes($this->params['topic']); + $message->group->assign($this->group); + if ($message->save()) { + $this->redirectToAction('show_topic', array('id' => $this->group->getId(), + 't' => $message->topic_id)); } } $this->addError('_common', 'Sending message error', 'please, try again'); - } else if (!empty($this->params['id'])) { - $messages = $this->GroupappMessage->find('all', array( - 'conditions' => array("topic_id = ?", $this->params['id']) - ) - ); - if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, - 'user_id' => $this->current_user->getId() - )); - $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); - if (($group && $group->access == 1) || $member) { - $this->messages = $messages; - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $messages[0]->topic_id; - } else { - $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this topic'); - } - return; + } else { + if ($this->group->access == 1 || $member) { + $this->messages = $topic; + } else { + $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this topic'); } } - $this->addError('_common', 'Topic not found', 'This topic is not founded'); } function reply_to_post () { - if (!empty($this->params['topic'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), - 'user_id' => $this->current_user->getId() - )); - if ($member) { - $message = $member->message->build(); - $message->setAttributes($this->params['topic']); - if ($message->save()) { - $this->redirectTo(array('action' => 'show_topic', 'id' => $message->topic_id)); - return; - } + if (!isset($this->group) || empty($this->params['p'])) { + $this->addError('_common', 'Reply to post error', 'please, specify post'); + return; + } + + $message = $this->GroupappMessage->find('all', + array( + 'conditions' => array( + "groupapp_group_id" => $this->group->getId(), + "id" => $this->params['p']), + 'include' => 'user' + ) + ); + if (empty($message)) { + $this->addError('_common', 'Reply to post error', 'post not found'); + return; + } + + $member = $this->GroupappMember->findFirst(array( + 'groupapp_group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + ) + ); + $this->topic_id = $message[0]->topic_id; + + if ($this->Request->isPost() && + !empty($this->params['topic']) && + !empty($this->params['topic']['body']) + ) { + if ($member) { + $message = $this->current_user->groupapp_message->build(); + $message->setAttributes($this->params['topic']); + $message->group->assign($this->group); + if ($message->save()) { + $this->redirectToAction('show_topic', array('id' => $this->group->getId(), + 't' => $message->topic_id)); } + $this->addError('_common', 'Sending message error', 'please, try again'); } - $this->addError('_common', 'Sending message error', 'please, try again'); - } else if (!empty($this->params['id'])) { - $message = $this->GroupappMessage->findFirst( - array( - 'conditions' => array("id = ?", $this->params['id']), - 'include' => 'user' - ) - ); - if ($message) { - $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $message->groupapp_group_id, - 'user_id' => $this->current_user->getId() - )); - $group = $this->GroupappGroup->find( $message->groupapp_group_id ); - if (($group && $group->access == 1) || $member) { - $this->message_to_reply = $message; - $this->groupapp_group_id = $group->getId(); - $this->group_name = $group->name; - $this->topic_id = $message->topic_id; - } else { - $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this message'); - } - return; + } else { + if ($this->group->access == 1 || $member) { + $this->message_to_reply = $message[0]; + } else { + $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this message'); } } - $this->addError('_common', 'Topic not found', 'This topic is not founded'); } + function _group_picture ($group) { + return $group->stored_file_id ? + $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + } + } ?> Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/controllers/groupapp/group_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -19,8 +19,7 @@ if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { $group = $this->GroupappGroup->find( $this->params['id'] ); if (isset($group) && $group) { - $this->group_picture = $group->stored_file_id ? - $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + $this->group_picture = $this->_group_picture($group); $this->group = $group; $members = $this->_getGroupMembers($this->group->getId()); @@ -56,6 +55,8 @@ $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; $this->user_groups = $this->array_pagination_helper->getPageItems("user_group_pages", $user_groups); + $this->user_picture = $this->_current_user_picture(); + $this->_extract_group_types(); } @@ -88,9 +89,9 @@ function customize () { if (isset($this->group)) { $this->step = 'group_customize'; - if (!empty($this->params['group'])){ + if ($this->Request->isPost() && !empty($this->params['group'])){ $this->group->setAttributes($this->params['group']); - if ($this->Request->isPost() && $this->group->save()) { + if ($this->group->save()) { $this->step = 'group_members'; $this->redirectTo(array('action' => 'edit_members', 'id' => $this->group->getId())); return; @@ -105,7 +106,7 @@ function edit_group () { if (isset($this->group)) { $this->group->category_id = floor($this->group->type_id / 100); - if (!empty($this->params['group'])){ + if ($this->Request->isPost() && !empty($this->params['group'])){ if (isset($this->params['group']['stored_file_id']) && !empty($this->params['group']['stored_file_id']) && $this->params['group']['stored_file_id'] != $this->group->stored_file_id @@ -117,9 +118,8 @@ $this->group->picture->build(); } $this->group->setAttributes($this->params['group']); - if ($this->Request->isPost() && $this->group->save()) { - $this->group_picture = $this->group->stored_file_id ? - $this->group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + if ($this->group->save()) { + $this->group_picture = $this->_group_picture($this->group); return; } } @@ -148,9 +148,9 @@ if (!$this->is_admin) { $this->redirectTo(array('action' => 'index')); } $this->step = 'edit_members'; - if (!empty($this->params['member'])){ + if ($this->Request->isPost() && !empty($this->params['member'])){ $this->GroupappGroup->setAttributes($this->params['member']); - if ($this->Request->isPost() && $this->GroupappGroup->save()){ + if ($this->GroupappGroup->save()){ return; } } else if (isset($this->group)) { @@ -412,6 +412,16 @@ } $this->gt = $gt; } + + function _group_picture ($group) { + return $group->stored_file_id ? + $group->picture->load()->url() : GROUPAPP_DEFAULT_PICTURE_URL; + } + + function _current_user_picture () { + return $this->current_user->basic_profile->load()->stored_file_id ? + $this->current_user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; + } } ?> Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/controllers/profile_controller.php 2008-07-15 18:39:12 UTC (rev 288) @@ -120,8 +120,27 @@ } function picture () { + $this->basic_profile = $this->current_user->basic_profile->load(); + if ($this->Request->isPost() && !empty($this->params['basic_profile'])) { + if (isset($this->params['basic_profile']['stored_file_id']) && + !empty($this->params['basic_profile']['stored_file_id']) && + $this->params['basic_profile']['stored_file_id'] != $this->basic_profile->stored_file_id + ) { + $stored_file = $this->StoredFile->findFirst(array( 'id' => $this->params['basic_profile']['stored_file_id'] )); + $this->basic_profile->picture->assign($stored_file); + } else { + $this->basic_profile->stored_file_id = NULL; + $this->basic_profile->picture->build(); + } + $this->basic_profile->setAttributes($this->params['basic_profile']); + if (!$this->basic_profile->save()) { + $this->importErrors( $this->Profile->getErrors() ); + return; + } + } + $this->user_picture = $this->basic_profile->stored_file_id ? + $this->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; } - } ?> \ No newline at end of file Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/installers/user_installer.php 2008-07-15 18:39:12 UTC (rev 288) @@ -197,6 +197,7 @@ `city_other` char(100), `country_id` int(11), `birthdate` date DEFAULT NULL, + `stored_file_id` int(11) DEFAULT NULL, `political_view_id` int(11), `religious_view_id` int(11), `created_at` datetime NOT NULL, @@ -207,6 +208,7 @@ FOREIGN KEY (country_id) REFERENCES countries(id), FOREIGN KEY (political_view_id) REFERENCES political_views(id), FOREIGN KEY (religious_view_id) REFERENCES religious_views(id), + FOREIGN KEY (stored_file_id) REFERENCES base_files(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/locales/groupapp/group/ru.php 2008-07-15 18:39:12 UTC (rev 288) @@ -93,15 +93,6 @@ 'Это засекреченная группа. Эта группа не будет отображаться в результатах поиска или в профилях своих участников.'; $dictionary['Publicize'] = 'Опубликовать'; $dictionary['Show this group in search results'] = 'Показывать эту группу в результатах поиска'; -$dictionary['Current picture'] = 'Текущее изображение'; -$dictionary['Upload Picture'] = 'Загрузить изображение'; -$dictionary['You can upload a JPG, GIF or PNG file'] = 'Вы можете загрузить изображение в формате JPG, GIF или PNG'; -$dictionary['I certify that I have the right to distribute this picture and that it does not violate the'] = 'Подтверждаю то, что я обладаю правами на распространение этого изображения и оно не нарушает'; -$dictionary['Terms of Use'] = 'Условия пользования'; -$dictionary['Remove Picture'] = 'Удалить изображение'; -$dictionary['You can remove this picture, but be sure to upload another or we will display a question mark in its place'] = 'Вы можете удалить текущее изображение, но не забудьте загрузить другое или на этом месте появится картинка, используемая по-умолчанию для групп'; -$dictionary['Note'] = 'Примечание'; -$dictionary['to preserve the new images do not forget to save the parameters group'] = 'для сохранения нового изображения не забудьте сохранить параметры группы'; $dictionary['Invite people to group'] = 'Пригласить людей в группу'; $dictionary['Show'] = 'Показать'; Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/locales/layout/ru.php 2008-07-15 18:39:12 UTC (rev 288) @@ -20,6 +20,9 @@ $dictionary['edit'] = 'настроить'; $dictionary['Friends'] = 'Друзья'; $dictionary['Messages'] = 'Сообщения'; +$dictionary['friends'] = 'друзья'; +$dictionary['groups'] = 'группы'; +$dictionary['All'] = 'Все'; $dictionary['Save Changes'] = 'Сохранить'; $dictionary['Save'] = 'Сохранить'; @@ -49,4 +52,14 @@ $dictionary['Address field'] = 'Домашний адрес'; $dictionary['Website field'] = 'URL веб сайта'; +$dictionary['Current picture'] = 'Текущее изображение'; +$dictionary['Upload Picture'] = 'Загрузить изображение'; +$dictionary['You can upload a JPG, GIF or PNG file'] = 'Вы можете загрузить изображение в формате JPG, GIF или PNG'; +$dictionary['I certify that I have the right to distribute this picture and that it does not violate the'] = 'Подтверждаю то, что я обладаю правами на распространение этого изображения и оно не нарушает'; +$dictionary['Terms of Use'] = 'Условия пользования'; +$dictionary['Remove Picture'] = 'Удалить изображение'; +$dictionary['You can remove this picture, but be sure to upload another or we will display a question mark in its place'] = 'Вы можете удалить текущее изображение, но не забудьте загрузить другое или на этом месте появится картинка, используемая по-умолчанию'; +$dictionary['Note'] = 'Примечание'; +$dictionary['to preserve the new images do not forget to save the parameters group'] = 'для сохранения нового изображения не забудьте сохранить параметры группы'; +$dictionary['to preserve the new images do not forget to save the user profile'] = 'для сохранения нового изображения не забудьте сохранить профиль пользователя'; ?> Modified: app/models/basic_profile.php =================================================================== --- app/models/basic_profile.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/models/basic_profile.php 2008-07-15 18:39:12 UTC (rev 288) @@ -2,7 +2,9 @@ class BasicProfile extends ActiveRecord { - var $belongs_to = array('User', 'City', 'PoliticalView', 'ReligiousView', 'Sex'); + var $belongs_to = array('User', 'City', 'PoliticalView', 'ReligiousView', 'Sex', + 'picture' => array('class_name' => 'StoredFile', + 'primary_key_name' => 'stored_file_id')); } ?> Modified: app/models/groupapp_message.php =================================================================== --- app/models/groupapp_message.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/models/groupapp_message.php 2008-07-15 18:39:12 UTC (rev 288) @@ -8,6 +8,7 @@ 'foreign_key' => 'groupapp_group_id') ); + /* function validateOnCreate () */ /* { */ /* $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); */ Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-07-14 18:35:39 UTC (rev 287) +++ app/models/user.php 2008-07-15 18:39:12 UTC (rev 288) @@ -18,6 +18,8 @@ 'foreign_key' => 'user_id'), 'work_profiles' => array('class_name' => 'WorkProfile', 'foreign_key' => 'user_id'), + 'groupapp_messages' => array('class_name' => 'GroupappMessage', + 'foreign_key' => 'user_id'), ); var $has_and_belongs_to_many = array('groupapp_groups' => array('join_table' => 'groupapp_members')); Modified: app/views/groupapp/board/_head.tpl =================================================================== --- app/views/groupapp/board/_head.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/_head.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="avatar"> - <a href="/profile/show/"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <a href="/profile/show/"><img src="/preview/50x50/{group_picture}"></a> </div> <div class="info"> <div class="header"> Modified: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/_menu.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -5,11 +5,11 @@ if ($controller->getActionName() == 'show_topic' || $controller->getActionName() == 'reply_to_topic' || $controller->getActionName() == 'reply_to_post' - ) { ?><li><a href="/groupapp/board/show_topic/{topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? + ) { ?><li><a href="/groupapp/board/show_topic/{group.id}/?t={topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? if ($controller->getActionName() == 'reply_to_topic') { ?> - <li><a href="/groupapp/board/reply_to_topic/{topic_id?}" class="last selected">_{Post Reply}</a></li> <? } + <li><a href="/groupapp/board/reply_to_topic/{group.id}/?t={topic_id?}" class="last selected">_{Post Reply}</a></li> <? } else if ($controller->getActionName() == 'reply_to_post') { ?> - <li><a href="/groupapp/board/reply_to_post/{message_to_reply.id?}" class="last selected">_{Post Reply}</a></li> + <li><a href="/groupapp/board/reply_to_post/{group.id}/?p={message_to_reply.id?}" class="last selected">_{Post Reply}</a></li> <? } ?> </ul> </div> Modified: app/views/groupapp/board/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/reply_to_post.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -6,7 +6,7 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{message_to_reply.topic_id}">{message_to_reply.subject?}</a></div> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{group.id}/?t={message_to_reply.topic_id}">{message_to_reply.subject?}</a></div> </div> </div> <div class="clearfix"></div> @@ -17,14 +17,15 @@ </div> <div class="avatar"> - <a href="/profile/show/{message_to_reply.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <? $user_picture = $message_to_reply->user->basic_profile->load()->stored_file_id ? $message_to_reply->user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; ?> + <a href="/profile/show/{message_to_reply.user_id}"><img src="/preview/50x50/{user_picture}"></a> </div> <div class="message"> <div class="head"> <span class="sender"> - <? if ($current_user->getId() == $message_to_reply->user_id) { ?><span class="current_user">_{You}</span> - <? } else { ?><a href="/profile/show/{message_to_reply.user_id?}"><span class="other_user">{message_to_reply.user.name?}</span></a><? } ?> + <? if ($current_user->getId() == $message_to_reply->user_id): ?><span class="current_user">_{You}</span> + <? else: ?><a href="/profile/show/{message_to_reply.user_id?}"><span class="other_user">{message_to_reply.user.name?}</span></a><? endif ?> </span> _{wrote} <div class="subtext">{message_to_reply.created_at?}</div> @@ -38,7 +39,7 @@ <div class="clearfix"></div> <div class="board_from_background"> -<form action="/groupapp/board/reply_to_topic/{message_to_reply.topic_id?}" method="post"> +<form action="/groupapp/board/reply_to_topic/{group.id}/?t={message_to_reply.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> <label> </label><span class="label">_{Your reply}</span><br> @@ -46,10 +47,9 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $message_to_reply->groupapp_group_id))?> - <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id))?> - <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject))?> - <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId()))?> + <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id)) ?> + <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject)) ?> + <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId())) ?> </label> <input class="submitinput" type="submit" value="_{Post reply}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: app/views/groupapp/board/reply_to_topic.tpl =================================================================== --- app/views/groupapp/board/reply_to_topic.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/reply_to_topic.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -6,13 +6,13 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{group.id}/?t={messages-0.topic_id}">{messages-0.subject?}</a></div> </div> </div> <div class="clearfix"></div> <div class="board_from_background"> -<form action="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" method="post"> +<form action="/groupapp/board/reply_to_topic/{group.id}/?t={messages-0.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> <label> </label><span class="label">_{Your reply}</span><br> @@ -20,7 +20,6 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $messages[0]->groupapp_group_id))?> <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $messages[0]->topic_id))?> <?= $form_helper->hidden_field('topic', 'subject', array('value' => $messages[0]->subject))?> </label> Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/board/show_topic.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -4,11 +4,11 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{group.id}/?t={messages-0.topic_id}">{messages-0.subject?}</a></div> </div> <div class="menu_block right"> - <a href="/groupapp/board/reply_to_topic/{messages-0.topic_id?}">_{Reply to Topic}</a> + <a href="/groupapp/board/reply_to_topic/{group.id}/?t={messages-0.topic_id?}">_{Reply to Topic}</a> </div> </div> @@ -22,7 +22,7 @@ <div class="actions"> <ul class="actions_list"> - <li><a href="/groupapp/board/reply_to_post/{message.id?}">_{Reply} <? if ($current_user->getId() == $message->user_id) echo $text_helper->translate('to Your Post'); ?></a></li> + <li><a href="/groupapp/board/reply_to_post/{group.id}/?p={message.id?}">_{Reply} <? if ($current_user->getId() == $message->user_id) echo $text_helper->translate('to Your Post'); ?></a></li> <? if ($current_user->getId() != $message->user_id) { ?> <li><a href="#">_{Mark as Irrelevant}</a></li> <li><a href="#">_{Report}</a></li> @@ -32,7 +32,8 @@ </div> <div class="avatar"> - <a href="/profile/show/{message.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <? $user_picture = $message->user->basic_profile->load()->stored_file_id ? $message->user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; ?> + <a href="/profile/show/{message.user.id}"><img src="/preview/50x50/{user_picture}"></a> <div class="subtext">#{message_loop_counter}</div> <?= $form_helper->hidden_field('message_id', $message->id, array('value' => $message_loop_counter))?> </div> Modified: app/views/groupapp/group/_picture_upload.tpl =================================================================== --- app/views/groupapp/group/_picture_upload.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/_picture_upload.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -54,7 +54,7 @@ </div> <div class="right_big"> - <div class="left_content"> + <div class="right_content"> <div class="upload_picture"> @@ -70,9 +70,9 @@ <?= $form_helper->file_field('upload', 'photo', array('class' => 'textinput small')) ?> </div> - <div class="filter_name certify"> - <?= $form_helper->check_box('upload', 'certify', array('onclick' => "onCertifyClick(this)")) ?> - <label for="group_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> + <div class="certify"> + <?= $form_helper->check_box('picture', 'certify', array('onclick' => "onCertifyClick(this)")) ?> + <label for="picture_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> </div> <div class="upload_submit"> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/edit_members.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -43,7 +43,7 @@ {?group_members}{loop group_members} <? if ($group_member->groupapp_member_role_id == 1): ?> <li> - <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a></span> <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> @@ -66,7 +66,7 @@ {?group_members}{loop group_members} <? if ($group_member->groupapp_member_role_id == 2): ?> <li> - <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a></span> <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> @@ -89,7 +89,7 @@ {?group_members}{loop group_members} <? if ($group_member->groupapp_member_role_id == 3): ?> <li> - <span class="member_name"><a href="/profile/show/{group_member.id}">{group_member.user.name}</a></span> + <span class="member_name"><a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a></span> <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> @@ -113,7 +113,7 @@ <? if ($group_member->groupapp_member_role_id == 4): ?> <li> <span class="member_name"> - <a href="/profile/show/{group_member.id}">{group_member.user.name}</a> + <a href="/profile/show/{group_member.user_id}">{group_member.user.name}</a> </span> <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> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/index.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -4,7 +4,7 @@ <div class="title_bar"> <div class="avatar"> - <a href="/profile/show/"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + <a href="/profile/show/"><img src="/preview/50x50/{user_picture}" alt="" class=""></a> </div> <div class="info"> <div class="header"> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/groupapp/group/show_group.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -153,9 +153,10 @@ <div class="body"> {?group_members} {loop group_members} + <? $user_picture = $group_member->user->basic_profile->load()->stored_file_id ? $group_member->user->basic_profile->picture->load()->url() : USER_DEFAULT_PICTURE_URL; ?> <span class="member_ceil"> - <a href="/profile/show/{group_member.user.id?}"> - <img src="/preview/70x70//images/nophoto_men_sm.gif"><br>{group_member.user.name?} + <a href="/profile/show/{group_member.user.id}"> + <img src="/preview/70x70/{user_picture}"><br>{group_member.user.name?} </a> </span> <? if ($group_member_loop_counter >= 5) break; ?> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/layouts/application.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -7,6 +7,7 @@ <link href="/stylesheets/dialog.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/Application.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/friend_selector.css" rel="stylesheet" type="text/css"> +<link href="/stylesheets/upload_picture.css" rel="stylesheet" type="text/css"> <? if ($controller->getModuleName()) : ?> <link href="/stylesheets/<?= $controller->getModuleName() . '/' . ucfirst($controller->getModuleName()) ?>.css" rel="stylesheet" type="text/css"> <? endif ?> Modified: app/views/profile/picture.tpl =================================================================== --- app/views/profile/picture.tpl 2008-07-14 18:35:39 UTC (rev 287) +++ app/views/profile/picture.tpl 2008-07-15 18:39:12 UTC (rev 288) @@ -2,4 +2,133 @@ <?= $controller->renderErrors() ?> -<p class="indent">Coming soon</p> \ No newline at end of file +<script type="text/javascript"> + function startCallback() { + return true; + } + + function completeCallback(response) { + $('upload_photo').value = ''; + var uploaded = response.evalJSON(true); + if (uploaded.length) { + $('current_picture').innerHTML = '<img src="/preview/200x200/' + uploaded[0].url + '">'; + $('basic_profile_stored_file_id').value = uploaded[0].id; + $('picture_note').show(); + } + } + + function onCertifyClick (el) { + if (el.checked) { + $('upload_submit_btn').enable(); + $('upload_submit_btn').writeAttribute('class', 'submitinput'); + } else { + $('upload_submit_btn').disable(); + $('upload_submit_btn').writeAttribute('class', 'cancelinput'); + } + } + + function removePicture() { + <? $default_picture = USER_DEFAULT_PICTURE_URL; ?> + $('current_picture').innerHTML = '<img src="/preview/200x200/{default_picture}">'; + $('basic_profile_stored_file_id').value = ''; + $('picture_note').show(); + } + +</script> + +<form enctype="multipart/form-data" method="post" id="picture_upload_form" action="/upload" onsubmit="return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})"> + +<div class="picture"> + <div class="two_column"> + + <div class="left_small"> + <div class="left_content"> + + <div class="imghead">_{Current picture}:<br><br> + <div id="current_picture"> + <img src="/preview/200x200/{user_picture}"> + </div> + </div> + + <div class="note" id="picture_note" style="display: none"> + <strong>_{Note}</strong>: _{to preserve the new images do not forget to save the user profile}! + </div> + + </div> + </div> + + <div class="right_big"> + <div class="right_content"> + + <div class="upload_picture"> + + <div class="upload_title"> + _{Upload Picture} + </div> + + <div class="upload_text"> + _{You can upload a JPG, GIF or PNG file}. + </div> + + <div class="upload_field"> + <?= $form_helper->file_field('upload', 'photo', array('class' => 'textinput small')) ?> + </div> + + <div class="certify"> + <?= $form_helper->check_box('picture', 'certify', array('onclick' => "onCertifyClick(this)")) ?> + <label for="picture_certify">_{I certify that I have the right to distribute this picture and that it does not violate the} <a href="#">_{Terms of Use}</a>.</label> + </div> + + <div class="upload_submit"> + <input class="cancelinput" type="submit" value="_{Upload Picture}" disabled="disabled" id="upload_submit_btn" name="upload_submit_btn" /> + </div> + + {?basic_profile.stored_file_id} + <div class="spacer"> </div> + <div class="upload_title"> + _{Remove Picture} + </div> + + <div class="upload_text"> + _{You can remove this picture, but be sure to upload another or we will display a question mark in its place}. + </div> + + <div class="upload_submit"> + <input class="submitinput" type="button" value="_{Remove Picture}" id="remove_submit_btn" name="remove_submit_btn" onclick="removePicture()" /> + </div> + {end} + + </div> + + </div> + </div> + + </div> + <div class="clearfix"></div> +</div> +</form> + +<form id="profile_picture_form" action="/profile/picture" method="post"> + <div class="two_column"> + <div class="left_small"> + <div class="left_content"> + + </div> + </div> + + <div class="right_big"> + <div class="right_content"> + + <div class="upload_picture"> + <?= $form_helper->hidden_field('basic_profile', 'stored_file_id') ?> + <div class="upload_submit"> + <input class="submitinput" type="submit" value="_{Save Changes}"> + </div> + </div> + + </div> + </div> + + <div class="clearfix"></div> + </div> +</form> Modified: public/stylesheets/friend_selector.css =================================================================== --- public/stylesheets/friend_selector.css 2008-07-14 18:35:39 UTC (rev 287) +++ public/stylesheets/friend_selector.css 2008-07-15 18:39:12 UTC (rev 288) @@ -25,11 +25,11 @@ background: #ffffff; border-bottom: 1px solid #cccccc; padding: 3px 2px 3px 2px; + height: 30px; } .friend_selector .content .friend_row.first { border-top: 1px solid #cccccc; - } .friend_selector .content .friend_row .friend_check { Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-14 18:35:39 UTC (rev 287) +++ public/stylesheets/groupapp/Group.css 2008-07-15 18:39:12 UTC (rev 288) @@ -245,45 +245,6 @@ padding: 10px 0px 3px 0px; } -.imghead { - color: #333333; - font-weight: bold; - font-size: 12px; - text-align: center; - padding: 0px 10px 20px 10px; -} - -.upload_picture { - padding: 0px 10px 20px 10px; -} - -.upload_picture .upload_title { - color: #333333; - font-weight: bold; - font-size: 13px; - border-bottom: solid 1px #6d84b4; - padding: 0px 0px 5px 0px; -} - -.upload_picture .upload_text { - padding: 10px 0px 10px 0px; -} - -.note { - font-size: 11px; - color: #ff5f5f; - margin: 0px 5px 10px 10px; -} - -.filter_name.certify { - padding: 10px 0px 10px 0px; -} - -.spacer { - dislay: block; - height: 20px; -} - .member_ceil { width: 80px; padding: 5px; Added: public/stylesheets/upload_picture.css =================================================================== --- public/stylesheets/upload_picture.css (rev 0) +++ public/stylesheets/upload_picture.css 2008-07-15 18:39:12 UTC (rev 288) @@ -0,0 +1,42 @@ +.imghead { + color: #333333; + font-weight: bold; + font-size: 12px; + text-align: center; + padding: 0px 10px 20px 10px; +} + +.upload_picture { + padding: 0px 10px 20px 10px; +} + +.upload_picture .upload_title { + color: #333333; + font-weight: bold; + font-size: 13px; + border-bottom: solid 1px #6d84b4; + padding: 0px 0px 5px 0px; +} + +.upload_picture .upload_text { + padding: 10px 0px 10px 0px; +} + +.certify { + color: #777777; + font-weight: bold; + font-size: 12px; + padding: 10px 0px 10px 0px; +} + +.note { + font-size: 11px; + color: #ff5f5f; + margin: 0px 5px 10px 10px; +} + +.spacer { + dislay: block; + height: 20px; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-14 18:35:30
|
Revision: 287 http://isocial.svn.sourceforge.net/isocial/?rev=287&view=rev Author: dim0s77 Date: 2008-07-14 11:35:39 -0700 (Mon, 14 Jul 2008) Log Message: ----------- created basis of friends selector Modified Paths: -------------- app/application_controller.php app/views/groupapp/group/edit_members.tpl app/views/layouts/application.tpl public/stylesheets/groupapp/Group.css Added Paths: ----------- public/stylesheets/friend_selector.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-07-14 18:27:43 UTC (rev 286) +++ app/application_controller.php 2008-07-14 18:35:39 UTC (rev 287) @@ -21,7 +21,7 @@ var $_errors = array(); var $app_models = array('User', 'Message', 'BaseFile', 'StoredFile'); - var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField', 'ArrayPagination'); + var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField', 'ArrayPagination', 'FriendSelector'); var $uploaded_files = array(); var $current_user; Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-07-14 18:27:43 UTC (rev 286) +++ app/views/groupapp/group/edit_members.tpl 2008-07-14 18:35:39 UTC (rev 287) @@ -10,15 +10,17 @@ <?= $controller->renderErrors() ?> <div class="formwrapper"> -<form action="/groupapp/group/edit_members/{group.id?}" method="post"> - <div class="invite_column"> - <div class="header_text">_{Invite Friends on PROJECT_NAME}:</div> - <div class="friends_list"></div> - <div class="submit"> - <input class="submitinput" type="submit" value="_{Invite Friends}"> - </div> + <div class="invite_column"> + <div class="header_text">_{Invite Friends on PROJECT_NAME}:</div> + <div class="friends_list"> + <?= $friend_selector_helper->row_selector('current_user', 'email_access', array('show_groups' => true)); ?> </div> + <div class="submit"> + <input class="submitinput" type="submit" value="_{Invite Friends}"> + </div> + </div> + <form action="/groupapp/group/edit_members/{group.id?}" method="post"> <div class="members"> <div class="submenushort"> @@ -130,7 +132,7 @@ </div> <div class="clearfix"></div> -</form> + </form> </div> <script> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-07-14 18:27:43 UTC (rev 286) +++ app/views/layouts/application.tpl 2008-07-14 18:35:39 UTC (rev 287) @@ -6,6 +6,7 @@ <link href="/stylesheets/autocomplete.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/dialog.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/Application.css" rel="stylesheet" type="text/css"> +<link href="/stylesheets/friend_selector.css" rel="stylesheet" type="text/css"> <? if ($controller->getModuleName()) : ?> <link href="/stylesheets/<?= $controller->getModuleName() . '/' . ucfirst($controller->getModuleName()) ?>.css" rel="stylesheet" type="text/css"> <? endif ?> Added: public/stylesheets/friend_selector.css =================================================================== --- public/stylesheets/friend_selector.css (rev 0) +++ public/stylesheets/friend_selector.css 2008-07-14 18:35:39 UTC (rev 287) @@ -0,0 +1,48 @@ +.friend_selector { + margin: 0px; + background: #ffffff; + border: 1px solid #cccccc; +} + +.friend_selector .content { + background: #ffffff; + border: 1px solid #6d84b4; + margin: 15px 2px 10px 2px; + padding: 10px 1px 2px 1px; +} + +.friend_selector .content .content_title { + margin: -19px 0px 0px 5px; + padding: 3px; + background: #ffffff; + border-left: 1px solid #6d84b4; + border-right: 1px solid #6d84b4; + float: left; + font-weight: bold; +} + +.friend_selector .content .friend_row { + background: #ffffff; + border-bottom: 1px solid #cccccc; + padding: 3px 2px 3px 2px; +} + +.friend_selector .content .friend_row.first { + border-top: 1px solid #cccccc; + +} + +.friend_selector .content .friend_row .friend_check { + padding: 6px 2px 0px 0px; + float: left; +} + +.friend_selector .content .friend_row .friend_photo { + float: left; +} + +.friend_selector .content .friend_row .friend_name { + padding: 9px 0px 0px 4px; + float: left; +} + Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-14 18:27:43 UTC (rev 286) +++ public/stylesheets/groupapp/Group.css 2008-07-14 18:35:39 UTC (rev 287) @@ -73,10 +73,7 @@ } .invite_column .friends_list { - margin: 0px 10px 5px 10px; - background: #ffffff; - border: 1px solid #cccccc; - height: 230px; + padding: 0px 10px 5px 10px; } .invite_column .submit { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-07-14 18:27:35
|
Revision: 286 http://isocial.svn.sourceforge.net/isocial/?rev=286&view=rev Author: aguidrevitch Date: 2008-07-14 11:27:43 -0700 (Mon, 14 Jul 2008) Log Message: ----------- some stubs for education/work profiles Modified Paths: -------------- app/controllers/profile_controller.php app/installers/russian_installer.php app/installers/user_installer.php app/locales/profile/ru.php app/models/network.php app/models/user.php app/views/profile/_menu.tpl Added Paths: ----------- app/models/education_profile.php app/models/network_type.php app/models/work_profile.php app/views/profile/education.tpl app/views/profile/work.tpl Removed Paths: ------------- app/models/network_profile.php app/views/profile/networks.tpl Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-07-14 17:59:26 UTC (rev 285) +++ app/controllers/profile_controller.php 2008-07-14 18:27:43 UTC (rev 286) @@ -109,9 +109,16 @@ } } - function networks () { + function education () { + $this->education_profile = $this->current_user->education_profile->load(); + } + function work () { + $this->work_profile = $this->current_user->work_profile->load(); + + } + function picture () { } Modified: app/installers/russian_installer.php =================================================================== --- app/installers/russian_installer.php 2008-07-14 17:59:26 UTC (rev 285) +++ app/installers/russian_installer.php 2008-07-14 18:27:43 UTC (rev 286) @@ -26,6 +26,9 @@ $this->execute("UPDATE marital_statuses set {$locale}_name ='Сложно объяснить' WHERE id = 5"); $this->execute("UPDATE marital_statuses set {$locale}_name ='В открытых взаимоотношениях' WHERE id = 6"); + $this->execute("ALTER TABLE network_types ADD COLUMN {$locale}_name char(40) NOT NULL AFTER en_name"); + $this->execute("UPDATE network_types set {$locale}_name ='Образование' WHERE id = 1"); + $this->execute("UPDATE network_types set {$locale}_name ='Работа' WHERE id = 2"); } function down_1() Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-07-14 17:59:26 UTC (rev 285) +++ app/installers/user_installer.php 2008-07-14 18:27:43 UTC (rev 286) @@ -286,20 +286,55 @@ ) ENGINE=InnoDB"); $this->execute( + "CREATE TABLE `network_types` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `en_name` char(50) + ) ENGINE=InnoDB"); + + $this->execute("INSERT INTO network_types (id, en_name) VALUES (1, 'Education')"); + $this->execute("INSERT INTO network_types (id, en_name) VALUES (2, 'Work')"); + + $this->execute( "CREATE TABLE `networks` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `network_type_id` int(11), `city_id` int(11), - `name` char(255), - FOREIGN KEY (city_id) REFERENCES cities(id) + `name` char(200), + FOREIGN KEY (network_type_id) REFERENCES network_types(id), + FOREIGN KEY (city_id) REFERENCES cities(id) ) ENGINE=InnoDB"); $this->execute( - "CREATE TABLE `network_profiles` ( + "CREATE TABLE `network_votes` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `network_id` int(11), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (network_id) REFERENCES networks(id), + UNIQUE vote_idx (user_id, network_id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `education_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, `network_id` int(11), `from` datetime, `to` datetime, + `concentration` char(200), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (network_id) REFERENCES networks(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `work_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `network_id` int(11), + `from` datetime, + `to` datetime, + `position` char(100), `description` char(255), FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (network_id) REFERENCES networks(id), @@ -309,10 +344,11 @@ function down_1() { - $this->transactionComplete(); - $this->dropTable('network_profiles'); + $this->dropTable('work_profiles'); + $this->dropTable('education_profiles'); $this->dropTable('networks'); + $this->dropTable('network_types'); $this->dropTable('personal_profiles'); $this->dropTable('marital_statuses'); $this->dropTable('relationship_profiles'); Modified: app/locales/profile/ru.php =================================================================== --- app/locales/profile/ru.php 2008-07-14 17:59:26 UTC (rev 285) +++ app/locales/profile/ru.php 2008-07-14 18:27:43 UTC (rev 286) @@ -8,7 +8,8 @@ $dictionary['Contact'] = 'Контакты'; $dictionary['Relationships'] = 'Семейное положение'; $dictionary['Personal'] = 'Интересы'; -$dictionary['Groups'] = 'Группы'; +$dictionary['Education'] = 'Образование'; +$dictionary['Work'] = 'Работа'; $dictionary['Picture'] = 'Фото'; $dictionary['Sex'] = 'Пол'; Added: app/models/education_profile.php =================================================================== --- app/models/education_profile.php (rev 0) +++ app/models/education_profile.php 2008-07-14 18:27:43 UTC (rev 286) @@ -0,0 +1,8 @@ +<?php + +class EducationProfile extends ActiveRecord +{ + var $belongs_to = array('User','Network'); +} + +?> Modified: app/models/network.php =================================================================== --- app/models/network.php 2008-07-14 17:59:26 UTC (rev 285) +++ app/models/network.php 2008-07-14 18:27:43 UTC (rev 286) @@ -2,20 +2,23 @@ class Network extends VotableActiveRecord { - var $belongs_to = array('City'); + var $belongs_to = array('City', 'NetworkType'); var $votes_model = 'NetworkVote'; var $strtolower = false; var $_alternate = false; function findConditions () { - return array('conditions' => array("country_id = ? AND region_id = ? AND name LIKE ?", $this->country_id, $this->region_id, $this->name)); + return array('conditions' => array("network_id = ? AND name LIKE ?", $this->network_id, $this->name)); } function validateOnCreate () { $this->validatesPresenceOf('name', "Network Name|network name can't be blank"); $this->validatesPresenceOf('city_id', "City|city can't be blank"); + $this->validatesPresenceOf('network_type_id', "Network type|network type can't be blank"); if (!$this->getErrors()) { $this->validatesNumericalityOf('city_id', "City: hack attempt detected|city does not exist"); + $this->validatesNumericalityOf('network_type_id', "Network type: hack attempt detected|network type does not exist"); + if (!$this->getErrors()) { $City = new City(); $city = $City->find( $this->city_id ); @@ -23,6 +26,15 @@ $this->addError('city_id', "City: hack attempt detected|city does not exist"); } } + + if (!$this->getErrors()) { + $NetworkType = new NetworkType(); + $network_type = $NetworkType->find( $this->network_type_id ); + if (empty($network_type)) { + $this->addError('network_type_id', "Network type: hack attempt detected|network does not exist"); + } + } + } } Deleted: app/models/network_profile.php =================================================================== --- app/models/network_profile.php 2008-07-14 17:59:26 UTC (rev 285) +++ app/models/network_profile.php 2008-07-14 18:27:43 UTC (rev 286) @@ -1,8 +0,0 @@ -<?php - -class NetworkProfile extends ActiveRecord -{ - var $belongs_to = array('User', 'Network'); -} - -?> Added: app/models/network_type.php =================================================================== --- app/models/network_type.php (rev 0) +++ app/models/network_type.php 2008-07-14 18:27:43 UTC (rev 286) @@ -0,0 +1,7 @@ +<?php + +class NetworkType extends ActiveRecord +{ +} + +?> Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-07-14 17:59:26 UTC (rev 285) +++ app/models/user.php 2008-07-14 18:27:43 UTC (rev 286) @@ -2,22 +2,26 @@ class User extends ActiveRecord { - var $has_many = array('outbox_messages' => array('class_name' => 'Message', - 'order' => 'created_at desc', - 'foreign_key' => 'sender_id', - 'conditions' => 'is_sender_del = 0'), - 'inbox_messages' => array('class_name' => 'Message', - 'order' => 'created_at desc', - 'foreign_key' => 'recipient_id', - 'conditions' => 'is_recipient_del = 0'), - 'im_profiles' => array('class_name' => 'ImProfile', - 'foreign_key' => 'user_id'), - 'stored_files' => array('class_name' => 'StoredFile', - 'foreign_key' => 'user_id'), + var $has_many = array('outbox_messages' => array('class_name' => 'Message', + 'order' => 'created_at desc', + 'foreign_key' => 'sender_id', + 'conditions' => 'is_sender_del = 0'), + 'inbox_messages' => array('class_name' => 'Message', + 'order' => 'created_at desc', + 'foreign_key' => 'recipient_id', + 'conditions' => 'is_recipient_del = 0'), + 'im_profiles' => array('class_name' => 'ImProfile', + 'foreign_key' => 'user_id'), + 'stored_files' => array('class_name' => 'StoredFile', + 'foreign_key' => 'user_id'), + 'education_profiles' => array('class_name' => 'EducationProfile', + 'foreign_key' => 'user_id'), + 'work_profiles' => array('class_name' => 'WorkProfile', + 'foreign_key' => 'user_id'), ); var $has_and_belongs_to_many = array('groupapp_groups' => array('join_table' => 'groupapp_members')); - + var $has_one = array('BasicProfile', 'ContactProfile', 'RelationshipProfile', 'PersonalProfile'); function login($email, $password) { Added: app/models/work_profile.php =================================================================== --- app/models/work_profile.php (rev 0) +++ app/models/work_profile.php 2008-07-14 18:27:43 UTC (rev 286) @@ -0,0 +1,8 @@ +<?php + +class WorkProfile extends ActiveRecord +{ + var $belongs_to = array('User','Network'); +} + +?> Modified: app/views/profile/_menu.tpl =================================================================== --- app/views/profile/_menu.tpl 2008-07-14 17:59:26 UTC (rev 285) +++ app/views/profile/_menu.tpl 2008-07-14 18:27:43 UTC (rev 286) @@ -6,7 +6,8 @@ ?><li><a href="/profile/contact" class="<?= $controller->getActionName() == 'contact' ? 'selected' : '' ?>">_{Contact}</a></li><? ?><li><a href="/profile/relationships" class="<?= $controller->getActionName() == 'relationships' ? 'selected' : '' ?>">_{Relationships}</a></li><? ?><li><a href="/profile/personal" class="<?= $controller->getActionName() == 'personal' ? 'selected' : '' ?>">_{Personal}</a></li><? - ?><li><a href="/profile/networks" class="<?= $controller->getActionName() == 'groups' ? 'selected' : '' ?>">_{Groups}</a></li><? + ?><li><a href="/profile/education" class="<?= $controller->getActionName() == 'education' ? 'selected' : '' ?>">_{Education}</a></li><? + ?><li><a href="/profile/work" class="<?= $controller->getActionName() == 'work' ? 'selected' : '' ?>">_{Work}</a></li><? ?><li><a href="/profile/picture" class="last <?= $controller->getActionName() == 'picture' ? 'selected' : '' ?>">_{Picture}</a></li> </ul> </div> Added: app/views/profile/education.tpl =================================================================== --- app/views/profile/education.tpl (rev 0) +++ app/views/profile/education.tpl 2008-07-14 18:27:43 UTC (rev 286) @@ -0,0 +1,64 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="editform"> + <form method="post"> + + <div class="formrow"> + <?= $controller->renderErrors() ?> + </div> + + <div class="formrow"> + <label class="required">_{Educational institution}:</label> + <div class="formcol"> + <input name="" class="mediumtextinput autocomplete"> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Concentration}:</label> + <div class="formcol"> + <input name="" class="textinput"> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Degree}:</label> + <div class="formcol"> + <input name="" class="textinput"> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label>_{Time period}:</label> + <div class="formcol"> + <div> + <input type="checkbox">_{I currently work here} + </div> + <select type=""><option>October</option></select> + <select type=""><option>1995</option></select> to present + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <a href="#">_{Add Another Institution}</a> + </div> + <div class="clearfix"></div> + </div> + + <div class="formrow"> + <label> </label> + <div class="formcol"> + <input class="submitinput" type="submit" value="_{Save}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + <div class="clearfix"></div> + </div> + + </form> +</div> Deleted: app/views/profile/networks.tpl =================================================================== --- app/views/profile/networks.tpl 2008-07-14 17:59:26 UTC (rev 285) +++ app/views/profile/networks.tpl 2008-07-14 18:27:43 UTC (rev 286) @@ -1,5 +0,0 @@ -<?= $controller->renderPartial("menu") ?> - -<?= $controller->renderErrors() ?> - -<p class="indent">Coming soon</p> Added: app/views/profile/work.tpl =================================================================== --- app/views/profile/work.tpl (rev 0) +++ app/views/profile/work.tpl 2008-07-14 18:27:43 UTC (rev 286) @@ -0,0 +1,5 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<p class="indent">Coming soon</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-07-14 17:59:17
|
Revision: 285 http://isocial.svn.sourceforge.net/isocial/?rev=285&view=rev Author: aguidrevitch Date: 2008-07-14 10:59:26 -0700 (Mon, 14 Jul 2008) Log Message: ----------- blogapp now have meaningfull translations Modified Paths: -------------- app/locales/layout/en.php app/locales/layout/ru.php Modified: app/locales/layout/en.php =================================================================== --- app/locales/layout/en.php 2008-07-13 17:09:09 UTC (rev 284) +++ app/locales/layout/en.php 2008-07-14 17:59:26 UTC (rev 285) @@ -7,5 +7,6 @@ $dictionary['PhotoApp'] = 'Photos'; $dictionary['GroupApp'] = 'Groups'; $dictionary['EventApp'] = 'Events'; +$dictionary['BlogApp'] = 'Blogs'; ?> Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-07-13 17:09:09 UTC (rev 284) +++ app/locales/layout/ru.php 2008-07-14 17:59:26 UTC (rev 285) @@ -29,6 +29,7 @@ $dictionary['PhotoApp'] = 'Фото'; $dictionary['GroupApp'] = 'Группы'; $dictionary['EventApp'] = 'События'; +$dictionary['BlogApp'] = 'Блоги'; $dictionary['Add another screen name'] = 'Добавить ещё один'; $dictionary['Add New City'] = 'Добавить новый город'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-07-13 17:09:05
|
Revision: 284 http://isocial.svn.sourceforge.net/isocial/?rev=284&view=rev Author: aguidrevitch Date: 2008-07-13 10:09:09 -0700 (Sun, 13 Jul 2008) Log Message: ----------- akelos patch synced Modified Paths: -------------- akelos.diff Modified: akelos.diff =================================================================== --- akelos.diff 2008-07-09 15:55:12 UTC (rev 283) +++ akelos.diff 2008-07-13 17:09:09 UTC (rev 284) @@ -1,6 +1,6 @@ Index: lib/Ak.php =================================================================== ---- lib/Ak.php (revision 581) +--- lib/Ak.php (revision 834) +++ lib/Ak.php (working copy) @@ -183,6 +183,11 @@ return @$string[$try_whith_lang]; @@ -23,11 +23,19 @@ }else { $string = isset($framework_dictionary[$string]) ? $framework_dictionary[$string] : $string; } +@@ -351,7 +358,6 @@ + if(!is_dir(dirname($options['base_path'].DS.$file_name))){ + Ak::make_dir(dirname($options['base_path'].DS.$file_name), $options); + } +- + if(!$result = file_put_contents($options['base_path'].DS.$file_name, $content)){ + if(!empty($content)){ + Ak::trace("Please change file/dir permissions or enable FTP file handling by". Index: lib/AkActionController.php =================================================================== ---- lib/AkActionController.php (revision 581) +--- lib/AkActionController.php (revision 834) +++ lib/AkActionController.php (working copy) -@@ -750,7 +750,14 @@ +@@ -749,7 +749,14 @@ */ function t($string, $array = null) { @@ -43,7 +51,7 @@ } -@@ -1950,6 +1957,9 @@ +@@ -1949,6 +1956,9 @@ { if(method_exists(&$this, $action)){ call_user_func_array(array(&$this, $action), @(array)$this->passed_args); @@ -55,9 +63,9 @@ Index: lib/AkInstaller.php =================================================================== ---- lib/AkInstaller.php (revision 581) +--- lib/AkInstaller.php (revision 834) +++ lib/AkInstaller.php (working copy) -@@ -356,11 +356,13 @@ +@@ -358,11 +358,13 @@ function dropTable($table_name, $options = array()) { @@ -78,7 +86,7 @@ } Index: lib/AkActionView/helpers/text_helper.php =================================================================== ---- lib/AkActionView/helpers/text_helper.php (revision 581) +--- lib/AkActionView/helpers/text_helper.php (revision 834) +++ lib/AkActionView/helpers/text_helper.php (working copy) @@ -518,8 +518,18 @@ */ @@ -103,9 +111,9 @@ /** Index: lib/AkActiveRecord.php =================================================================== ---- lib/AkActiveRecord.php (revision 581) +--- lib/AkActiveRecord.php (revision 834) +++ lib/AkActiveRecord.php (working copy) -@@ -5012,6 +5012,7 @@ +@@ -5013,6 +5013,7 @@ $sql .= empty($options['joins']) ? '' : " {$options['joins']} "; @@ -113,7 +121,7 @@ empty($options['conditions']) ? null : $this->addConditions($sql, $options['conditions']); if (!empty($options['group'])){ -@@ -5022,6 +5023,11 @@ +@@ -5023,6 +5024,11 @@ $sql .= empty($options['order']) ? '' : " ORDER BY {$options['order']} "; $this->_db->addLimitAndOffset($sql, $options); $sql .= $use_workaround ? ')' : ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-09 15:55:02
|
Revision: 283 http://isocial.svn.sourceforge.net/isocial/?rev=283&view=rev Author: dim0s77 Date: 2008-07-09 08:55:12 -0700 (Wed, 09 Jul 2008) Log Message: ----------- added leaving group Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/_members_list.tpl app/views/groupapp/group/browse.tpl app/views/groupapp/group/index.tpl 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-09 15:01:01 UTC (rev 282) +++ app/controllers/groupapp/group_controller.php 2008-07-09 15:55:12 UTC (rev 283) @@ -35,6 +35,7 @@ if ($current_user_id == $member->user_id) { $this->is_member = true; $this->is_guest = false; + $this->group_member_id = $member->id; } } $this->group_members = $members; @@ -324,7 +325,7 @@ function _members () { $this->_calcGroupMembersCount(); - if (!count($this->group_members)) { + if (empty($this->group_members)) { $this->renderAction('members.tpl'); return; } @@ -357,7 +358,11 @@ function join () { if ($this->group && !$this->is_member) { - $member = $this->GroupappMemberRole->find(4); + if ($this->group->members_count > 0) { + $member = $this->GroupappMemberRole->find(4); + } else { + $member = $this->GroupappMemberRole->find(1); + } $group_member = $this->GroupappGroup->group_member->build(); $group_member->group->assign($this->group); $group_member->user->assign($this->current_user); @@ -372,6 +377,23 @@ $this->renderText(''); } + function leave () { + if ($this->group && $this->is_member) { + $this->group->members_count -= 1; + if (!$this->group->save()) { + $this->renderText(''); + return; + } + if (!$this->GroupappMember->destroy($this->group_member_id)) { + $this->group->members_count += 1; + $this->group->save(); + $this->renderText('OK'); + return; + }; + } + $this->renderText(''); + } + function help () { } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-09 15:01:01 UTC (rev 282) +++ app/locales/groupapp/group/ru.php 2008-07-09 15:55:12 UTC (rev 283) @@ -157,6 +157,9 @@ $dictionary['Add group membership'] = 'Присоединиться к группе'; $dictionary['Do you want to join'] = 'Вы хотите присоединиться к'; $dictionary['Join'] = 'Присоединиться'; +$dictionary['Remove group membership'] = 'Прекратить свое участие в группе'; +$dictionary['Are you sure you want to remove your membership from'] = 'Вы уверены, что хотите покинуть группу'; +$dictionary['Remove'] = 'Покинуть'; $dictionary['Search groups'] = 'Поиск групп'; $dictionary['Search by name'] = 'Поиск по имени'; Modified: app/views/groupapp/group/_members_list.tpl =================================================================== --- app/views/groupapp/group/_members_list.tpl 2008-07-09 15:01:01 UTC (rev 282) +++ app/views/groupapp/group/_members_list.tpl 2008-07-09 15:55:12 UTC (rev 283) @@ -1,20 +1,20 @@ <div class="list_header"><?= $text_helper->translate($members_group_name, array()); ?>: {members_count}</div> -<? if (!$members_count) { ?> +<? if (!$members_count): ?> <div class="empty_list"><?= $text_helper->translate($empty_message, array()); ?></div> -<? } else { ?> -<? if ($list_id == 'members_list') { ?><div class="members_list_container"><? } ?> +<? else: ?> + <? if ($list_id == 'members_list'): ?><div class="members_list_container"><? endif ?> <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->groupapp_member_role_id == $role) { ?> + <? if ($member->groupapp_member_role_id == $role): ?> <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); return false;" name="{member.id}">_{change status}</a></span> <a href="#" onclick="remove_member(this, {group.id}, '{list_id}', {role}); return false;" name="{member.id}">_{remove}</a> </li> - <? } ?> + <? endif ?> {end}{end} </ul> </div> -<? if ($list_id == 'members_list') { ?></div><? } ?> -<? } ?> + <? if ($list_id == 'members_list'): ?></div><? endif ?> +<? endif ?> Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-09 15:01:01 UTC (rev 282) +++ app/views/groupapp/group/browse.tpl 2008-07-09 15:55:12 UTC (rev 283) @@ -152,4 +152,5 @@ }); return false; } + </script> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-09 15:01:01 UTC (rev 282) +++ app/views/groupapp/group/index.tpl 2008-07-09 15:55:12 UTC (rev 283) @@ -51,7 +51,7 @@ <? endif ?> {end} <? endif ?> - <li><a href="#">_{Leave Group}</a></li> + <li><a href="#" onclick="leave_this_group(this); return false;" id="{user_group.id?}" name="{user_group.name?}">_{Leave Group}</a></li> </ul> </div> @@ -129,3 +129,23 @@ </div> <div class="clearfix"></div> </div> + +<script type="text/javascript"> +function leave_this_group (element) { + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Remove group membership}?', + body: '_{Are you sure you want to remove your membership from} "' + element.name + '"?', + yes: '_{Remove}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Request('/groupapp/group/leave/' + element.id, { + onComplete: function () { + window.location = "/groupapp/group"; + } + }); + } + }); + return false; +} +</script> Modified: app/views/groupapp/group/members.tpl =================================================================== --- app/views/groupapp/group/members.tpl 2008-07-09 15:01:01 UTC (rev 282) +++ app/views/groupapp/group/members.tpl 2008-07-09 15:55:12 UTC (rev 283) @@ -51,7 +51,27 @@ </div> {else} <div class="nogroups"> - _{Group have no members}. <a href="">_{Become the owner of the group}</a>. + _{Group have no members}. <a href="#" onclick="join_this_group(this); return false;">_{Become the owner of the group}</a>. <div class="clearfix"></div> </div> + +<script type="text/javascript"> +function join_this_group (element) { + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Add group membership}?', + body: '_{Do you want to join} "{group.name?}"?', + yes: '_{Join}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Request('/groupapp/group/join/{group.id?}', { + onComplete: function () { + window.location = "/groupapp/group/show_members/{group.id?}"; + } + }); + } + }); + return false; +} +</script> {end} Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-09 15:01:01 UTC (rev 282) +++ app/views/groupapp/group/show_group.tpl 2008-07-09 15:55:12 UTC (rev 283) @@ -23,11 +23,11 @@ {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> + <li><a href="#" onclick="leave_this_group(this); return false;">_{Leave Group}</a></li> {end} {?is_guest} <li><a href="#">_{View Discussion Board}</a></li> - <li><a href="#" onclick="join_this_group(this); return false;" name="{group.id?}">_{Join this Group}</a></li> + <li><a href="#" onclick="join_this_group(this); return false;">_{Join this Group}</a></li> {end} </ul> @@ -149,6 +149,7 @@ <div class="info">_{Members count}: {members_count?}</div> </div> <div class="clearfix"></div> + {?members_count} <div class="body"> {?group_members} {loop group_members} @@ -161,6 +162,11 @@ {end} {end} </div> + {else} + <div class="emptyblock"> + _{Group have no members}.<br><a href="#" onclick="join_this_group(this); return false;">_{Become the owner of the group}</a> + </div> + {end} </div> <!-- <div class="box"> --> @@ -196,4 +202,23 @@ }); return false; } + +function leave_this_group (element) { + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Remove group membership}?', + body: '_{Are you sure you want to remove your membership from} "{group.name?}"?', + yes: '_{Remove}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Request('/groupapp/group/leave/{group.id?}', { + onComplete: function () { + window.location = "/groupapp/group"; + } + }); + } + }); + return false; +} + </script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-09 15:00:54
|
Revision: 282 http://isocial.svn.sourceforge.net/isocial/?rev=282&view=rev Author: dim0s77 Date: 2008-07-09 08:01:01 -0700 (Wed, 09 Jul 2008) Log Message: ----------- added joining to group Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/show_group.tpl app/views/message/outbox.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-09 13:57:52 UTC (rev 281) +++ app/controllers/groupapp/group_controller.php 2008-07-09 15:01:01 UTC (rev 282) @@ -355,6 +355,23 @@ function show_topic () { } + function join () { + if ($this->group && !$this->is_member) { + $member = $this->GroupappMemberRole->find(4); + $group_member = $this->GroupappGroup->group_member->build(); + $group_member->group->assign($this->group); + $group_member->user->assign($this->current_user); + $group_member->role->assign($member); + if ($group_member->save()) { + $this->group->members_count += 1; + $this->group->save(); + $this->renderText('OK'); + return; + } + } + $this->renderText(''); + } + function help () { } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-07-09 13:57:52 UTC (rev 281) +++ app/locales/groupapp/group/ru.php 2008-07-09 15:01:01 UTC (rev 282) @@ -84,7 +84,7 @@ $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.'] = @@ -133,7 +133,7 @@ $dictionary['Videos'] = 'Видео'; $dictionary['No one has uploaded any videos'] = 'Никто не загружал видео'; $dictionary['Add Videos'] = 'Добавить видео'; -$dictionary['Discussion board'] = 'Доска обсуждений'; +$dictionary['Discussion board'] = 'Форум'; $dictionary['There are no discussions'] = 'Обсуждения отсутствуют'; $dictionary['Start the first topic'] = 'Начать первую тему'; $dictionary['Members count'] = 'Количество участников'; @@ -152,6 +152,11 @@ $dictionary['Create first group'] = 'Создать первую группу'; $dictionary['All'] = 'Все'; $dictionary['Join Group'] = 'Присоединиться'; +$dictionary['Join this Group'] = 'Присоединиться к группе'; +$dictionary['View Discussion Board'] = 'Просмотреть форум'; +$dictionary['Add group membership'] = 'Присоединиться к группе'; +$dictionary['Do you want to join'] = 'Вы хотите присоединиться к'; +$dictionary['Join'] = 'Присоединиться'; $dictionary['Search groups'] = 'Поиск групп'; $dictionary['Search by name'] = 'Поиск по имени'; Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-09 13:57:52 UTC (rev 281) +++ app/views/groupapp/group/browse.tpl 2008-07-09 15:01:01 UTC (rev 282) @@ -87,7 +87,7 @@ <ul class="actions_list"> {?user_groups} <? if (!isset($user_groups[$group->id])): ?> - <li><a href="#">_{Join Group}</a></li> + <li><a href="#" onclick="join_this_group(this); return false;" id="{group.id?}" name="{group.name?}">_{Join Group}</a></li> <? endif ?> {end} </ul> @@ -133,3 +133,23 @@ </div> {end} <div class="clearfix"></div> + +<script type="text/javascript"> +function join_this_group (element) { + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Add group membership}?', + body: '_{Do you want to join} "' + element.name + '"?', + yes: '_{Join}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Request('/groupapp/group/join/' + element.id, { + onComplete: function () { + window.location = "/groupapp/group/show_group/" + element.id; + } + }); + } + }); + return false; +} +</script> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-09 13:57:52 UTC (rev 281) +++ app/views/groupapp/group/show_group.tpl 2008-07-09 15:01:01 UTC (rev 282) @@ -12,7 +12,7 @@ <div class="right_content"> <div class="group_avatar"> - <img src="/preview/100x100/{group_picture}"> + <img src="/preview/200x200/{group_picture}"> </div> <ul class="actions_list"> @@ -27,7 +27,7 @@ {end} {?is_guest} <li><a href="#">_{View Discussion Board}</a></li> - <li><a href="#">_{Join this Group}</a></li> + <li><a href="#" onclick="join_this_group(this); return false;" name="{group.id?}">_{Join this Group}</a></li> {end} </ul> @@ -178,3 +178,22 @@ </div> <div class="clearfix"></div> +<script type="text/javascript"> +function join_this_group (element) { + new Dialog.Box(element, { + classname: 'delete_dialog', + title: '_{Add group membership}?', + body: '_{Do you want to join} "{group.name?}"?', + yes: '_{Join}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Request('/groupapp/group/join/{group.id?}', { + onComplete: function () { + window.location = "/groupapp/group/show_group/{group.id?}"; + } + }); + } + }); + return false; +} +</script> Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-07-09 13:57:52 UTC (rev 281) +++ app/views/message/outbox.tpl 2008-07-09 15:01:01 UTC (rev 282) @@ -26,7 +26,7 @@ </div> </form> -<script> +<script type="text/javascript"> var checkids = new Array(); function oncheck (element, is_read) { checked = $$('input[type=checkbox]:checked'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-09 13:57:43
|
Revision: 281 http://isocial.svn.sourceforge.net/isocial/?rev=281&view=rev Author: dim0s77 Date: 2008-07-09 06:57:52 -0700 (Wed, 09 Jul 2008) Log Message: ----------- show/hide page elements if user is/not admin Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/models/groupapp_group.php app/views/groupapp/group/_info.tpl app/views/groupapp/group/index.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-09 10:36:31 UTC (rev 280) +++ app/controllers/groupapp/group_controller.php 2008-07-09 13:57:52 UTC (rev 281) @@ -129,17 +129,23 @@ } function edit_info () { + if (!$this->is_admin) { $this->redirectTo(array('action' => 'index')); } + $this->step = 'edit_info'; $this->_extract_group_types(); $this->edit_group(); } function edit_customize () { + if (!$this->is_admin) { $this->redirectTo(array('action' => 'index')); } + $this->step = 'edit_customize'; $this->edit_group(); } function edit_members () { + if (!$this->is_admin) { $this->redirectTo(array('action' => 'index')); } + $this->step = 'edit_members'; if (!empty($this->params['member'])){ $this->GroupappGroup->setAttributes($this->params['member']); Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-07-09 10:36:31 UTC (rev 280) +++ app/models/groupapp_group.php 2008-07-09 13:57:52 UTC (rev 281) @@ -5,7 +5,9 @@ var $has_one = array('group_member' => array('class_name' => 'GroupappMember', 'foreign_key' => 'groupapp_group_id')); var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', - 'foreign_key' => 'groupapp_group_id')); + 'foreign_key' => 'groupapp_group_id'), + 'groupapp_members' => array('class_name' => 'GroupappMember', + 'foreign_key' => 'groupapp_group_id')); var $belongs_to = array('group_type' => array('class_name' => 'GroupappGroupType', 'primary_key_name' => 'type_id'), Modified: app/views/groupapp/group/_info.tpl =================================================================== --- app/views/groupapp/group/_info.tpl 2008-07-09 10:36:31 UTC (rev 280) +++ app/views/groupapp/group/_info.tpl 2008-07-09 13:57:52 UTC (rev 281) @@ -22,15 +22,15 @@ <label class="required">_{Group Type}:<br><small>(_{required})</small></label> <div class="formcol"> <select id="group_category_id" name="group[category_id]" onchange="on_category_change('group_category_id', category_subtypes, category_sublabels);" typefor="group_type_id"> - <option <? if (!$group->category_id): ?>selected="selected" <? endif ?>value="">_{Select Category:}</option> + <option <? if (!empty($group) && !$group->category_id): ?>selected="selected" <? endif ?>value="">_{Select Category:}</option> {loop group_types} - <option <? if ($group->category_id == $group_type->id): ?>selected="selected" <? endif ?>value="{group_type.id?}"><?= $gt[$group_type->id] ?></option> + <option <? if (!empty($group) && $group->category_id == $group_type->id): ?>selected="selected" <? endif ?>value="{group_type.id?}"><?= $gt[$group_type->id] ?></option> {end} </select> - <select id="group_type_id" name="group[type_id]" subtypefor="group_category_id" <? if (!$group->category_id): ?>disabled="disabled" <? endif ?>> - <option <? if (!$group->category_id || !$group->type_id): ?>selected="selected" <? endif ?>value="">_{Select Type:}</option> + <select id="group_type_id" name="group[type_id]" subtypefor="group_category_id" <? if (empty($group) || !$group->category_id): ?>disabled="disabled" <? endif ?>> + <option <? if (!empty($group) && (!$group->category_id || !$group->type_id)): ?>selected="selected" <? endif ?>value="">_{Select Type:}</option> {loop subgroup_types} - <? if ($group->category_id != $subgroup_type) continue; ?> + <? if (empty($group) || $group->category_id != $subgroup_type) continue; ?> <option <? if ($group->type_id == $subgroup_type_loop_key): ?>selected="selected" <? endif ?>value="{subgroup_type_loop_key}"><?= $gt[$subgroup_type_loop_key] ?></option> {end} </select> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-09 10:36:31 UTC (rev 280) +++ app/views/groupapp/group/index.tpl 2008-07-09 13:57:52 UTC (rev 281) @@ -44,7 +44,13 @@ <div class="actions"> <ul class="actions_list"> - <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> + <? if ($members = $user_group->groupapp_member->load()): ?> + {loop members} + <? if ($member->user_id == $current_user->getId() && $member->groupapp_member_role_id < 3): ?> + <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> + <? endif ?> + {end} + <? endif ?> <li><a href="#">_{Leave Group}</a></li> </ul> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-09 10:36:22
|
Revision: 280 http://isocial.svn.sourceforge.net/isocial/?rev=280&view=rev Author: dim0s77 Date: 2008-07-09 03:36:31 -0700 (Wed, 09 Jul 2008) Log Message: ----------- hide 'join group' link if user in current group Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/index.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-09 09:14:07 UTC (rev 279) +++ app/controllers/groupapp/group_controller.php 2008-07-09 10:36:31 UTC (rev 280) @@ -284,9 +284,17 @@ $links = $group_pages->paginator->getLinks(); $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; - $_filter = array('conditions' => "type_id" . $type_id, 'include' => 'picture'); + $_filter = array('conditions' => 'type_id' . $type_id, 'include' => 'picture'); $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); $this->groups = $this->GroupappGroup->find('all', $options); + + $user_groups = $this->current_user->groupapp_group->load(); + if (!empty($user_groups)) { + $this->user_groups = array(); + foreach ($user_groups as $user_group) { + $this->user_groups[$user_group->id] = true; + } + } } function show_members () { Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-09 09:14:07 UTC (rev 279) +++ app/views/groupapp/group/browse.tpl 2008-07-09 10:36:31 UTC (rev 280) @@ -85,13 +85,19 @@ <div class="actions"> <ul class="actions_list"> - <li><a href="#">_{Join Group}</a></li> + {?user_groups} + <? if (!isset($user_groups[$group->id])): ?> + <li><a href="#">_{Join Group}</a></li> + <? endif ?> + {end} </ul> </div> <div class="info"> <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">_{Members count}:</span> + <a href="/groupapp/group/show_members/{group.id?}">{group.members_count}</a> + </div> <div class="other"><span class="param">_{Type}:</span> <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> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-09 09:14:07 UTC (rev 279) +++ app/views/groupapp/group/index.tpl 2008-07-09 10:36:31 UTC (rev 280) @@ -60,7 +60,9 @@ <div class="info"> <div class="name"><a href="/groupapp/group/show_group/{user_group.id?}">{user_group.name}</a></div> - <div class="other"><span class="param">_{Members count}:</span> {user_group.members_count}</div> + <div class="other"><span class="param">_{Members count}:</span> + <a href="/groupapp/group/show_members/{user_group.id?}">{user_group.members_count}</a> + </div> <div class="other"><span class="param">_{Type}:</span> <? $subtype_id = $user_group->type_id; $type_id = $subgroup_types[$subtype_id]; ?> <a href="/groupapp/group/browse/?g={type_id?}"><?= $gt[$type_id] ?></a> - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |