- Timestamp:
- 03/22/10 03:43:03 (2 years ago)
- Location:
- trunk/www
- Files:
-
- 3 edited
-
controllers/textblock_edit.php (modified) (2 diffs)
-
static/css/screen.css (modified) (1 diff)
-
views/textblock_edit.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/controllers/textblock_edit.php
r1069 r1118 34 34 $values['text'] = request('text', $page['text']); 35 35 $values['title'] = request('title', $page['title']); 36 $values['security'] = request('security', $page['security']); 36 37 $security_values = array_map('trim', explode(':', $page['security'])); 38 $values['security'] = request('security', $security_values[0]); 39 if (count($security_values) > 1) { 40 $values['security_special'] = request('security_special', $security_values[1]); 41 } else { 42 $values['security_special'] = request('security_special', ''); 43 } 44 37 45 $values['forum_topic'] = request('forum_topic', $page['forum_topic']); 38 46 $values['tags'] = request('tags', tag_build_list("textblock", $page_name, "tag")); … … 45 53 $new_page['text'] = $values['text']; 46 54 $new_page['title'] = $values['title']; 47 $new_page['security'] = $values['security']; 55 56 if ($values['security_special'] != '') { 57 $new_page['security'] = sprintf('%s: %s', $values['security'], 58 $values['security_special']); 59 } else { 60 $new_page['security'] = $values['security']; 61 } 62 48 63 $new_page['forum_topic'] = $values['forum_topic']; 49 64 $new_page['creation_timestamp'] = $values['creation_timestamp']; -
trunk/www/static/css/screen.css
r1099 r1118 1546 1546 margin: 0 .5em .5em 2em; 1547 1547 } 1548 1549 /* Proper Security UI */ 1550 .security_show { 1551 display: inline; 1552 margin-left: 0.5em; 1553 } 1554 1555 .security_hide { 1556 display: none; 1557 } -
trunk/www/views/textblock_edit.php
r1111 r1118 16 16 <?= html_escape($task_id) ?></a></h1> 17 17 <?php } ?> 18 19 <script type="text/javascript"> 20 function toggleSpecial() { 21 var select = document.getElementById("security_select"); 22 var option = select.options[select.selectedIndex].value; 23 var special = document.getElementById("special"); 24 25 if (option == "round" || option == "task") { 26 special.className = "security_show"; 27 } else { 28 special.className = "security_hide"; 29 } 30 } 31 </script> 18 32 19 33 <form accept-charset="utf-8" action="<?= html_escape(url_textblock_edit($page_name)) ?>" method="post" id="form_wikiedit" <?= tag_form_event() ?>> … … 60 74 <li id="field_security"> 61 75 <label for="form_security">Nivel de securitate al paginii 62 <a href="<?= html_escape(url_textblock('documentatie/securitate')) ?>">(?)</a></label> 63 <input type="text" name="security" value="<?= fval('security') ?>" id="form_security" /> 76 <a href="<?= html_escape(url_textblock('documentatie/securitate')) ?>">(?)</a></label> 77 78 <select id="security_select" name="security" onchange="toggleSpecial()"> 79 <?php 80 $options = array( 81 array('value' => 'public', 'html' => 'Public'), 82 array('value' => 'protected', 'html' => 'Protected'), 83 array('value' => 'private', 'html' => 'Private'), 84 array('value' => 'round', 'html' => 'Round'), 85 array('value' => 'task', 'html' => 'Task') 86 ); 87 88 foreach ($options as $option) { 89 if ($option['value'] == fval('security')) { 90 echo sprintf('<option value="%s" selected="selected">%s 91 </option>', $option['value'], $option['html']); 92 } else { 93 echo sprintf('<option value="%s">%s</option>', 94 $option['value'], $option['html']); 95 } 96 } 97 ?> 98 </select> 99 100 <?php 101 if (in_array(fval('security'), array('round', 'task'))) { 102 $css_class = "security_show"; 103 } else { 104 $css_class = "security_hide"; 105 } 106 107 echo sprintf('<input name="security_special" id="special" 108 type="text" value="%s" class="%s">', 109 fval('security_special'), $css_class); 110 ?> 111 64 112 <?= ferr_span('security') ?> 65 113 </li>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)