Changeset 1125


Ignore:
Timestamp:
04/18/10 16:38:13 (2 years ago)
Author:
wefgef
Message:

Added tabs for round edit pages.

Location:
trunk/www
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/controllers/round.php

    r1109 r1125  
    185185 
    186186        flash("Runda a fost modificata cu succes."); 
    187         redirect(url_round_edit($round_id)); 
     187        redirect(url_round_edit_params($round_id)); 
    188188    } 
    189189 
  • trunk/www/url.php

    r1111 r1125  
    294294} 
    295295 
     296function url_round($round_id) { 
     297    log_assert(is_round_id($round_id)); 
     298    $round = round_get($round_id); 
     299    return url_complex($round['page_name']); 
     300} 
     301 
    296302function url_round_edit($round_id) { 
    297303    log_assert(is_round_id($round_id)); 
    298     return url_complex("admin/runda/$round_id"); 
     304    $round = round_get($round_id); 
     305    return url_complex($round['page_name'], array('action' => 'edit')); 
     306} 
     307 
     308function url_round_edit_params($round_id) { 
     309    log_assert(is_round_id($round_id)); 
     310    return url_complex("admin/runda/" . $round_id); 
    299311} 
    300312 
  • trunk/www/views/round_edit.php

    r1086 r1125  
    1111require_once(IA_ROOT_DIR."common/round.php"); 
    1212require_once(IA_ROOT_DIR."www/format/form.php"); 
     13require_once(IA_ROOT_DIR."www/views/round_edit_header.php"); 
    1314include('views/header.php'); 
     15 
     16echo round_edit_tabs($view['round_id'], 'round-edit-params'); 
    1417 
    1518$can_tag = identity_can('round-tag', $round); 
  • trunk/www/views/textblock_edit.php

    r1118 r1125  
    1515<h1>Editare enunț <a href="<?= html_escape(url_task($task_id)) ?>"> 
    1616<?= html_escape($task_id) ?></a></h1> 
     17<?php } 
     18 
     19// insert round edit tabs 
     20if (($round_id = textblock_security_is_round($page['security'])) && 
     21    (identity_can('round-edit', $round = round_get($round_id)))) { 
     22    require_once(IA_ROOT_DIR."www/views/round_edit_header.php"); 
     23    echo round_edit_tabs($round_id, request("action")); 
     24?> 
     25<h1>Editare pagină <a href="<?= html_escape(url_round($round_id)) ?>"> 
     26<?= html_escape($round['title']) ?></a></h1> 
    1727<?php } ?> 
    1828 
  • trunk/www/views/textblock_header.php

    r1111 r1125  
    99<div id="wikiOps"> 
    1010    <ul> 
     11 
    1112<?php if (($task_id = textblock_security_is_task($textblock['security'])) && 
    1213          identity_can('task-edit', $task = task_get($task_id))) { ?> 
    1314<li><?= format_link_access(url_task_edit($task['id']), 'Editează', 'e') ?></li> 
     15<?php } elseif (($round_id = textblock_security_is_round($textblock['security'])) 
     16                && identity_can('round-edit', $round = round_get($round_id))) { ?> 
     17<li><?= format_link_access(url_round_edit($round['id']), 'Editează', 'e') ?></li> 
    1418<?php } elseif(identity_can('textblock-edit', $textblock)) { ?> 
    1519<li><?= format_link_access(url_textblock_edit($textblock['name']), 'Editează', 'e') ?></li> 
    1620<?php } ?> 
    17 <?php if (($round_id = textblock_security_is_round($textblock['security'])) && identity_can('round-edit', $round = round_get($round_id))) { ?> 
    18 <li><?= format_link_access(url_round_edit($round['id']), 'Editează parametri', 'p') ?></li> 
    19 <?php } ?> 
     21 
    2022<?php if (identity_can('textblock-history', $textblock)) { ?> 
    2123<li><?= format_link_access(url_textblock_history($textblock['name']), 'Istoria', 'i') ?></li> 
Note: See TracChangeset for help on using the changeset viewer.