Changeset 100

User picture

Author: gropher

(2009/04/08 11:31) About 3 years ago

- Bugs fixed.

Affected files

Updated apps/frontend/modules/post/templates/_addPost.php Download diff

99100
1
<? echo form_tag('post/create', array('method' => 'post', 'enctype' => 'multipart/form-data', 'onsubmit' => "return AIM.submit(this, {'onStart'
: startCallback, 'onComplete' : completeCallback})") ) ?>
1
<? echo form_tag('post/create', array('method' => 'post', 'enctype' => 'multipart/form-data', 'onsubmit' => "return AIM.submit(this, {'onStart'
: startCallback, 'onComplete' : completeCallback})") ) ?>
2
	<b><label for="text"><? echo __('Как дела? Что делаешь?') ?></label></b><br/>
2
	<b><label for="text"><? echo __('Как дела? Что делаешь?') ?></label></b><br/>
3
	<? echo textarea_tag('text', null, array('rows' => 2	, 'cols' => 50)) ?><br/>
3
	<? echo textarea_tag('text', null, array('rows' => 2	, 'cols' => 50)) ?><br/>
4
	<label for="mood"><? echo __('Настроение') ?>:</label>
4
	<div class='mood'>
5
	<? echo radiobutton_tag('mood', 'good', false, array('class' => 'styled_good')) ?>
5
        <label for="mood"><? echo __('Настроение') ?>:</label>
6
	<? echo radiobutton_tag('mood', 'normal', true, array('class' => 'styled_normal')) ?>
6
        <? echo radiobutton_tag('mood', 'good', false, array('class' => 'styled_good')) ?>
7
	<? echo radiobutton_tag('mood', 'bad', false, array('class' => 'styled_bad') ) ?>
7
        <? echo radiobutton_tag('mood', 'normal', true, array('class' => 'styled_normal')) ?>
8
	<? if(isset($blog_id)): ?>
8
        <? echo radiobutton_tag('mood', 'bad', false, array('class' => 'styled_bad') ) ?>
9
        <? echo input_file_tag('picture',array("style" => 'display:none')) ?>
10
        <? echo link_to_function(__('картинка из файла'), 'showPictureUpload()', array('id' => 'more_file')) ?>
11
        <? echo input_tag('picture_url', null, array("style" => 'display:none')) ?>
12
        <? echo link_to_function(__('картинка из URL'), 'showPictureURL()', array('id' => 'more_url')) ?>
13
        <? echo submit_tag(__('Написать')) ?>
14
    </div>
15
16
    <? if(isset($blog_id)): ?>
9
		<? echo input_hidden_tag('blog_id', $blog_id) ?>
17
		<? echo input_hidden_tag('blog_id', $blog_id) ?>
10
	<? endif ?>
18
	<? endif ?>
11
    <? if(isset($mypage)): ?>
19
    <? if(isset($mypage)): ?>
12
		<? echo input_hidden_tag('mypage', true) ?>
20
		<? echo input_hidden_tag('mypage', true) ?>
13
	<? endif ?>
21
	<? endif ?>
14
	<? echo input_file_tag('picture',array("style" => 'display:none')) ?>
15
	<? echo link_to_function(__('картинка из файла'), 'showPictureUpload()', array('id' => 'more_file')) ?>
16
    <? echo input_tag('picture_url', null, array("style" => 'display:none')) ?>
17
	<? echo link_to_function(__('картинка из URL'), 'showPictureURL()', array('id' => 'more_url')) ?>
18
    <? echo submit_tag(__('Написать')) ?>
19
</form>
22
</form>
20
<script>
23
<script>
21
    function showPictureUpload()
24
    function showPictureUpload()

Added plugins/.registry/.channel.pear.symfony-project.com/nahomailplugin.reg

Show contents

Added test/functional/frontend/sfGuardUserActionsTest.php

Show contents

Added test/functional/frontend/userActionsTest.php

Show contents

Updated web/js/custom-form-elements.js Download diff

99100
23
23
24
var radioHeight = "46";
24
var radioHeight = "46";
25
25
26
document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px;
opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');
27
26
var Custom = {
28
var Custom = {
27
	init: function() 
29
	init: function() 
28
	{
30
	{
29
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
31
		var inputs = document.getElementsByTagName("input"), span = Array();
30
		for(a = 0; a < inputs.length; a++) 
32
		for(a = 0; a < inputs.length; a++) 
31
		{
33
		{
32
			if(inputs[a].type == "radio" && inputs[a].className.substr(0,6) == "styled") 
34
			if(inputs[a].type == "radio" && inputs[a].className.substr(0,6) == "styled") 
...
...
34
				span[a] = document.createElement("span");
36
				span[a] = document.createElement("span");
35
				span[a].className = inputs[a].type + inputs[a].className.substr(6);
37
				span[a].className = inputs[a].type + inputs[a].className.substr(6);
36
				inputs[a].style.display = "none";
38
				inputs[a].style.display = "none";
37
38
				if(inputs[a].checked == true) 
39
				if(inputs[a].checked == true) 
39
				{
40
				{
40
					position = "0 -" + (radioHeight*2) + "px";
41
					span[a].style.backgroundPosition = "0 -" + (radioHeight*2) + "px";;
41
					span[a].style.backgroundPosition = position;
42
				}
42
				}
43
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
43
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
44
				inputs[a].onchange = Custom.clear;
44
				inputs[a].onchange = Custom.clear;