Changeset 1415
- Timestamp:
- 12/07/07 17:21:01 (8 months ago)
- Files:
-
- releases/0.9/mod/admin/lib.php (modified) (1 diff)
- releases/0.9/mod/elggadmin (added)
- releases/0.9/mod/elggadmin/configdef.php (added)
- releases/0.9/mod/elggadmin/elggadmin.css (added)
- releases/0.9/mod/elggadmin/engine.php (added)
- releases/0.9/mod/elggadmin/index.php (added)
- releases/0.9/mod/elggadmin/lib.php (added)
- releases/0.9/mod/pages/lib.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
releases/0.9/mod/admin/lib.php
r1397 r1415 146 146 $url = get_url($object_id, $object_type); 147 147 148 if (strpos($url, '?') === 'false') {148 if (strpos($url, '?') === false) { 149 149 $sep = '?'; 150 150 } else { releases/0.9/mod/pages/lib.php
r1414 r1415 472 472 473 473 function pages_html_input($type, $attrs=null) { 474 474 if (!isset($attrs)) $attrs = array(); 475 475 476 $attrs = array_merge(array('type' => $type), $attrs); 476 477 … … 478 479 } 479 480 480 function pages_html_form($name, $body, $method='post', $action='', $attrs=null) { 481 $body .= pages_html_input('hidden', array('name'=>'form_key', 'value'=>elggform_get_key())); 482 $attrs = array_merge(array('id'=>$name, 'name'=>$name, 'method'=>$method, 'action'=>$action,), $attrs); 481 function pages_html_form($name, $body, $attrs=null) { 482 if (!isset($attrs)) {$attrs = array();} 483 484 if (!isset($attrs['id'])) { $attrs['id'] = $name; } 485 if (!isset($attrs['name'])) { $attrs['name'] = $name; } 486 if (!isset($attrs['method'])) { $attrs['method'] = 'post'; } 487 if (!isset($attrs['action'])) { $attrs['action'] = ''; } 488 489 if (isset($attrs['buttons'])) { 490 $buttons = $attrs['buttons']; 491 } else { 492 $buttons = pages_html_input('submit', array('value' => __gettext('Submit'))); 493 } 494 495 // add form key 496 $buttons .= pages_html_input('hidden', array('name'=>'form_key', 'value'=>elggform_key_get($name))); 497 498 $body .= pages_html_wrap('div', $buttons, array('class' => 'form-buttons')); 499 483 500 return pages_html_wrap('form', $body, $attrs); 484 501 } 485 502 486 503 function pages_html_select($name, $options, $attrs=null) { 504 if (!isset($attrs)) $attrs = array(); 505 487 506 $opts = ''; 488 507 foreach ($options as $opt) { … … 508 527 foreach ($props as $prop => $val) { 509 528 $result .= " {$prop}=" . $db->qstr($val, true); 529 } 530 531 return $result; 532 } 533 534 function pages_is_submitted() { 535 $result = false; 536 537 if (isset($_POST['submit']) || strtolower($_SERVER['REQUEST_METHOD']) == 'post') { 538 $result = true; 510 539 } 511 540
