Changeset 237

User picture

Author: franiglesias

(2009/11/21 02:01) About 2 years ago

Retouching the forms design. Easier to scan (labels at the left).

Affected files

Updated plugins/access/controllers/actions_controller.php Download diff

236237
28
			$this->data = $this->Action->read(null, $id);
28
			$this->data = $this->Action->read(null, $id);
29
		}
29
		}
30
		
30
		
31
		$this->set('scopes', array('create', 'edit', 'delete', 'view', 'select'));
31
		$this->set('scopes', array(
32
			'create' => __('Create', true), 
33
			'edit' => __('Edit', true), 
34
			'delete' => __('Delete', true), 
35
			'view' => __('View', true), 
36
			'select' => __('Select', true)
37
			)
38
		);
32
	}
39
	}
33
40
34
41

Updated plugins/access/models/action.php Download diff

236237
35
		if ($rebuild) {
35
		if ($rebuild) {
36
			$this->deleteAll('1 = 1');
36
			$this->deleteAll('1 = 1');
37
		}
37
		}
38
		
39
		// Clears cache for action_list if present
40
		Cache::delete('action_list_cached');
41
		
38
		// Get all controllers, even in plugins
42
		// Get all controllers, even in plugins
39
		$Controllers = Configure::listObjects('controller');
43
		$Controllers = Configure::listObjects('controller');
40
		$Plugins = Configure::listObjects('plugin');
44
		$Plugins = Configure::listObjects('plugin');
...
...
110
		// Get all actions
114
		// Get all actions
111
		// Exclude basic, private and protected
115
		// Exclude basic, private and protected
112
	}
116
	}
113
	
117
118
/**
119
 * Tries to determine the scope of an action based on its name
120
 *
121
 * @param string $action 
122
 * @return void
123
 * @author Frankie
124
 */
114
	protected function guessScope($action) {
125
	protected function guessScope($action) {
115
		$mapping = array(
126
		$mapping = array(
116
			'/.*(add|create)/' => 'create',
127
			'/.*(add|create)/' => 'create',
...
...
128
		return 'edit';
139
		return 'edit';
129
	}
140
	}
130
	
141
	
142
/**
143
 * Saves the data of an action
144
 *
145
 * @param string $action 
146
 * @return void
147
 * @author Frankie
148
 */
131
	protected function updateAction($action) {
149
	protected function updateAction($action) {
132
		$conditions = array(
150
		$conditions = array(
133
			'action' => $action['action'],
151
			'action' => $action['action'],
...
...
182
			}
200
			}
183
			
201
			
184
			// This allows to detect prefixed actions to create wildcard rules
202
			// This allows to detect prefixed actions to create wildcard rules
185
			
186
			$a = substr($action, strrpos($action, '/')+1, strlen($action));
203
			$a = substr($action, strrpos($action, '/')+1, strlen($action));
187
204
188
			if (strpos($a, '_') !== false) {
205
			if (strpos($a, '_') !== false) {
...
...
193
			} 
210
			} 
194
			
211
			
195
			$list[$group][$action] = $action;
212
			$list[$group][$action] = $action;
196
			
197
			$lastController = $controller;
213
			$lastController = $controller;
198
			// $lastPrefix = $prefix;
199
		}
214
		}
200
		Cache::write('action_list_cached', $list);
215
		Cache::write('action_list_cached', $list);
201
		return $list;
216
		return $list;

Updated plugins/access/views/actions/admin_edit.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
 		<legend><?php __('Edit Action');?></legend>
31
 		<legend><?php __('Edit Action');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('id', array('between' => '<br />'));
33
		echo $form->input('id');
34
		echo $form->input('action', array('between' => '<br />', 'readonly' => true));
34
		echo $form->input('action', array('readonly' => true, 'class' => "span-7"));
35
		echo $form->input('model', array('between' => '<br />', 'readonly' => true));
35
		echo $form->input('model', array('readonly' => true));
36
		echo $form->input('plugin', array('between' => '<br />', 'readonly' => true));
36
		echo $form->input('plugin', array('readonly' => true));
37
		echo $form->input('scope', array('between' => '<br />', 'empty' => ''));
37
		echo $form->input('scope', array('empty' => ''));
38
		echo $form->input('id_key', array('between' => '<br />'));
38
		echo $form->input('id_key');
39
	if (!empty($returnTo)) {
39
	if (!empty($returnTo)) {
40
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
40
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
41
	}
41
	}

Updated plugins/access/views/groups/admin_edit.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
 		<legend><?php __('Edit Group');?></legend>
31
 		<legend><?php __('Edit Group');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('id', array('between' => '<br />'));
33
		echo $form->input('id');
34
		echo $form->input('name', array('between' => '<br />'));
34
		echo $form->input('name');
35
		echo $form->input('parent_id', array('between' => '<br />'));
35
		echo $form->input('parent_id');
36
		echo $form->input('lft', array('between' => '<br />'));
36
		echo $form->input('lft');
37
		echo $form->input('rght', array('between' => '<br />'));
37
		echo $form->input('rght');
38
		echo $form->input('description', array('between' => '<br />'));
38
		echo $form->input('description');
39
	if (!empty($returnTo)) {
39
	if (!empty($returnTo)) {
40
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
40
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
41
	}
41
	}

Updated plugins/access/views/rules/admin_edit.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
 		<legend><?php __('Edit Rule');?></legend>
31
 		<legend><?php __('Edit Rule');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('id', array('between' => '<br />'));
33
		echo $form->input('id');
34
		echo $form->input('type', array('between' => '<br />'));
34
		echo $form->input('type');
35
		echo $form->input('name', array('between' => '<br />'));
35
		echo $form->input('name');
36
		echo $form->input('user_id', array('between' => '<br />'));
36
		echo $form->input('user_id');
37
		echo $form->input('group_id', array('between' => '<br />', 'type' => 'checkbox', 'multiple' => true));
37
		echo $form->input('group_id', array('type' => 'checkbox', 'multiple' => true));
38
		echo $form->input('action', array('between' => '<br />'));
38
		echo $form->input('action');
39
		echo $form->input('model', array('label' => __('Model name', true), 'between' => '<br />'));
39
		echo $form->input('model', array('label' => __('Model name', true), ));
40
		echo $form->input('model_id', array('label' => __('Model id', true), 'between' => '<br />'));
40
		echo $form->input('model_id', array('label' => __('Model id', true), ));
41
		echo $form->input('permission', array('type' => 'select', 'options' => array('allow' => __('Allow', true), 'deny' => __('Deny', true))));
41
		echo $form->input('permission', array('type' => 'select', 'options' => array('allow' => __('Allow', true), 'deny' => __('Deny', true))));
42
		echo $form->input('conditions', array('between' => '<br />'));
42
		echo $form->input('conditions');
43
	if (!empty($returnTo)) {
43
	if (!empty($returnTo)) {
44
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
44
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
45
	}
45
	}

Updated plugins/access/views/users/admin_edit.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
 		<legend><?php __('Edit User');?></legend>
31
 		<legend><?php __('Edit User');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('id', array('between' => '<br />'));
33
		echo $form->input('id');
34
		echo $form->input('username', array('between' => '<br />'));
34
		echo $form->input('username');
35
		echo $form->input('password', array('between' => '<br />'));
35
		echo $form->input('password');
36
		echo $form->input('realname', array('between' => '<br />'));
36
		echo $form->input('realname');
37
		echo $form->input('email', array('between' => '<br />'));
37
		echo $form->input('email');
38
		echo $form->input('status', array('between' => '<br />'));
38
		echo $form->input('status');
39
		echo $form->input('groups', array('between' => '<br />', 'multiple' => 'checkbox'));
39
		echo $form->input('groups', array('multiple' => 'checkbox'));
40
	if (!empty($returnTo)) {
40
	if (!empty($returnTo)) {
41
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
41
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
42
	}
42
	}

Updated plugins/contents/views/channels/admin_edit.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
 		<legend><?php __('Edit Channel');?></legend>
31
 		<legend><?php __('Edit Channel');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('id', array('between' => '<br />'));
33
		echo $form->input('id');
34
		echo $form->input('title', array('between' => '<br />', 'class' => 'title'));
34
		echo $form->input('title', array('class' => 'title'));
35
		echo $form->input('description', array('between' => '<br />', 'class' => 'text'));
35
		echo $form->input('description', array('class' => 'text'));
36
		echo $form->input('type', array('between' => '<br />'));
36
		echo $form->input('type');
37
		echo $form->input('active');
37
		echo $form->input('active');
38
		echo $form->input('private');
38
		echo $form->input('private');
39
		echo $form->input('featured');
39
		echo $form->input('featured');
40
		echo $form->input('theme', array('between' => '<br />'));
40
		echo $form->input('theme');
41
		echo $form->input('slug', array('between' => '<br />', 'class' => 'text', 'readonly' => true));
41
		echo $form->input('slug', array('class' => 'text', 'readonly' => true));
42
		echo $form->input('post_counter', array('between' => '<br />'));
42
		echo $form->input('post_counter');
43
		echo $upload->image('icon', array('between' => '<br />', 'type' => 'file'));
43
		echo $upload->image('icon', array('type' => 'file'));
44
		echo $upload->image('image', array('between' => '<br />', 'type' => 'file'));
44
		echo $upload->image('image', array('type' => 'file'));
45
		echo $form->input('pubDate', array('between' => '<br />', 'format' => 'DMY'));
45
		echo $form->input('pubDate', array('format' => 'DMY'));
46
	if (!empty($returnTo)) {
46
	if (!empty($returnTo)) {
47
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
47
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
48
	}
48
	}

Updated plugins/contents/views/items/admin_edit.ctp Download diff

236237
33
 		<legend><?php __('Edit Item');?></legend>
33
 		<legend><?php __('Edit Item');?></legend>
34
	<?php
34
	<?php
35
		echo $form->input('id');
35
		echo $form->input('id');
36
		echo $form->input('Item.title', array('between' => '<br />'));
36
		echo $form->input('Item.title');
37
		echo $form->input('Item.description', array('between' => '<br />'));
37
		echo $form->input('Item.description');
38
		echo $form->input('content', array('class' => 'ckeditor', 'between' => '<br />', 'cols' => 60, 'rows' => 20));
38
		echo $form->input('content', array('class' => 'ckeditor', 'cols' => 60, 'rows' => 20));
39
		// echo $fck->load('Item.content'); 
39
		// echo $fck->load('Item.content'); 
40
		echo $form->input('type', array('between' => '<br />'));
40
		echo $form->input('type');
41
		echo $upload->image('image', array('between' => '<br />'));
41
		echo $upload->image('image');
42
		echo $form->input('enclosure_id', array('between' => '<br />'));
42
		echo $form->input('enclosure_id');
43
	if (!empty($returnTo)) {
43
	if (!empty($returnTo)) {
44
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
44
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
45
	}
45
	}
...
...
48
	<fieldset>
48
	<fieldset>
49
		<legend><?php __('Authoring and licensing') ?></legend>
49
		<legend><?php __('Authoring and licensing') ?></legend>
50
	<?php
50
	<?php
51
		echo $form->input('user_id', array('between' => '<br />'));
51
		echo $form->input('user_id');
52
		echo $form->input('license_id', array('between' => '<br />'));
52
		echo $form->input('license_id');
53
	?>
53
	?>
54
	</fieldset>
54
	</fieldset>
55
55
56
	<fieldset>
56
	<fieldset>
57
		<legend><?php __('Publication') ?></legend>
57
		<legend><?php __('Publication') ?></legend>
58
	<?php
58
	<?php
59
		echo $form->input('channel_id', array('between' => '<br />'));
59
		echo $form->input('channel_id');
60
		echo $form->input('publish');
60
		echo $form->input('publish');
61
		echo $form->input('pubDate', array('between' => '<br />'));
61
		echo $form->input('pubDate');
62
		echo $form->input('featured');
62
		echo $form->input('featured');
63
		echo $form->input('allow_comments', array('between' => '<br />'));
63
		echo $form->input('allow_comments');
64
		echo $form->input('expiration', array('between' => '<br />', 'empty' => true));
64
		echo $form->input('expiration', array('empty' => true));
65
		echo $form->input('search_if_expired');
65
		echo $form->input('search_if_expired');
66
		echo $form->input('slug', array('between' => '<br />'));
66
		echo $form->input('slug');
67
	?>
67
	?>
68
	</fieldset>
68
	</fieldset>
69
69
70
	<fieldset>
70
	<fieldset>
71
		<legend><?php __('Statistics') ?></legend>
71
		<legend><?php __('Statistics') ?></legend>
72
	<?php
72
	<?php
73
		echo $form->input('comment_counter', array('between' => '<br />'));
73
		echo $form->input('comment_counter');
74
		echo $form->input('readings', array('between' => '<br />'));
74
		echo $form->input('readings');
75
	?>
75
	?>
76
	</fieldset>
76
	</fieldset>
77
77

Updated plugins/licenses/views/licenses/admin_edit.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
 		<legend><?php __('Edit License');?></legend>
31
 		<legend><?php __('Edit License');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('id', array('between' => '<br />'));
33
		echo $form->input('id');
34
		echo $form->input('license', array('between' => '<br />'));
34
		echo $form->input('license');
35
		echo $form->input('type', array('between' => '<br />'));
35
		echo $form->input('type');
36
		echo $form->input('code', array('between' => '<br />'));
36
		echo $form->input('code');
37
	if (!empty($returnTo)) {
37
	if (!empty($returnTo)) {
38
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
38
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
39
	}
39
	}

Updated plugins/quotes/views/quotes/admin_edit.ctp Download diff

236237
19
	<fieldset>
19
	<fieldset>
20
 		<legend><?php __('Edit Quote');?></legend>
20
 		<legend><?php __('Edit Quote');?></legend>
21
	<?php
21
	<?php
22
		echo $form->input('id', array('between' => '<br />'));
22
		echo $form->input('id');
23
		echo $form->input('quote', array('between' => '<br />'));
23
		echo $form->input('quote');
24
		echo $form->input('author', array('between' => '<br />'));
24
		echo $form->input('author');
25
		echo $form->input('used', array('between' => '<br />'));
25
		echo $form->input('used');
26
		echo $form->input('approved', array('between' => '<br />'));
26
		echo $form->input('approved');
27
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
27
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
28
	?>
28
	?>
29
	</fieldset>
29
	</fieldset>

Updated plugins/uploads/views/uploads/admin_add.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
		<legend><?php __('Upload');?></legend>
31
		<legend><?php __('Upload');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('file', array('type' => 'file', 'between' => '<br />'));
33
		echo $form->input('file', array('type' => 'file', ));
34
		echo $form->input('description', array('between' => '<br />'));
34
		echo $form->input('description');
35
	?>
35
	?>
36
	</fieldset>
36
	</fieldset>
37
<?php echo $form->end('Submit');?>
37
<?php echo $form->end('Submit');?>

Updated plugins/uploads/views/uploads/admin_edit.ctp Download diff

236237
30
	<fieldset>
30
	<fieldset>
31
 		<legend><?php __('Edit Upload');?></legend>
31
 		<legend><?php __('Edit Upload');?></legend>
32
	<?php
32
	<?php
33
		echo $form->input('id', array('between' => '<br />'));
33
		echo $form->input('id');
34
		echo $form->input('name', array('between' => '<br />', 'readonly' => true, 'class' => 'title'));
34
		echo $form->input('name', array('readonly' => true, 'class' => 'title'));
35
		echo $form->input('size', array('between' => '<br />', 'readonly' => true, 'class' => 'text'));
35
		echo $form->input('size', array('readonly' => true, 'class' => 'text'));
36
		echo $form->input('type', array('between' => '<br />', 'readonly' => true, 'class' => 'text'));
36
		echo $form->input('type', array('readonly' => true, 'class' => 'text'));
37
		echo $form->input('path', array('between' => '<br />', 'readonly' => true, 'class' => 'text'));
37
		echo $form->input('path', array('readonly' => true, 'class' => 'text'));
38
		echo $form->input('description', array('between' => '<br />'));
38
		echo $form->input('description');
39
		echo $form->input('model', array('between' => '<br />', 'class' => 'text'));
39
		echo $form->input('model', array('class' => 'text'));
40
		echo $form->input('foreign_key', array('between' => '<br />', 'class' => 'text'));
40
		echo $form->input('foreign_key', array('class' => 'text'));
41
	if (!empty($returnTo)) {
41
	if (!empty($returnTo)) {
42
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
42
		echo $form->input('App.returnTo', array('type' => 'hidden', 'value' => $returnTo));
43
	}
43
	}

Updated vendors/shells/templates/views/form.ctp Download diff

236237
36
			if ($action == 'add' && $field == $primaryKey) {
36
			if ($action == 'add' && $field == $primaryKey) {
37
				continue;
37
				continue;
38
			} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
38
			} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
39
				echo "\t\techo \$form->input('{$field}', array('between' => '<br />'));\n";
39
				echo "\t\techo \$form->input('{$field}');\n";
40
			}
40
			}
41
		}
41
		}
42
		
42
		
...
...
45
		
45
		
46
		if (!empty($associations['hasAndBelongsToMany'])) {
46
		if (!empty($associations['hasAndBelongsToMany'])) {
47
			foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
47
			foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
48
				echo "\t\techo \$form->input('{$assocName}', array('between' => '<br />'));\n";
48
				echo "\t\techo \$form->input('{$assocName}');\n";
49
			}
49
			}
50
		}
50
		}
51
		echo "\t?>\n";
51
		echo "\t?>\n";

Updated webroot/css/milhojas.basic.css Download diff

236237
150
150
151
form fieldset div.input {
151
form fieldset div.input {
152
	margin-bottom: 0.5em;
152
	margin-bottom: 0.5em;
153
	padding: 4px 10px;
153
	padding: 4px 10px 4px 120px;
154
	border-bottom: 1px solid #E0E0E0;
154
	border-bottom: 1px solid #E0E0E0;
155
	margin-right: 0;
155
}
156
}
156
157
157
form fieldset div.input:last-child {
158
form fieldset div.input:last-child {
158
	border-bottom: none;
159
	border-bottom: none;
159
}
160
}
161
162
form label {
163
	display: block;
164
	width: 110px;
165
	margin-left: -110px;
166
	float: left;
167
	margin-top: 4px;
168
}