~ubuntu-branches/ubuntu/trusty/pluxml/trusty-proposed

« back to all changes in this revision

Viewing changes to core/admin/comments.php

  • Committer: Package Import Robot
  • Author(s): Tanguy Ortolo
  • Date: 2014-01-14 21:55:05 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140114215505-q8b6y30b69q29cx0
Tags: 5.3-1
* New upstream release.
* debian/po/es.po: Spanish translation, thanks to Matías Bellone.
 (Closes: #733066)
* debian/control: update Standards-Version to 3.9.5 (no change needed).
* debian/postinst: update PluXml version in configuration file, to avoid
  triggering the update script (nothing else to do).

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
}
33
33
 
34
34
# Suppression des commentaires selectionnes
35
 
if(isset($_POST['selection']) AND ($_POST['selection'][0] == 'delete' OR $_POST['selection'][1] == 'delete') AND isset($_POST['idCom'])) {
 
35
if(isset($_POST['selection']) AND ((!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='delete') OR (!empty($_POST['btn_ok2']) AND $_POST['selection'][1]=='delete')) AND isset($_POST['idCom'])) {
36
36
        foreach ($_POST['idCom'] as $k => $v) $plxAdmin->delCommentaire($v);
37
37
        header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
38
38
        exit;
39
39
}
40
40
# Validation des commentaires selectionnes
41
 
elseif(isset($_POST['selection']) AND ($_POST['selection'][0] == 'online' OR $_POST['selection'][1] == 'online') AND isset($_POST['idCom'])) {
 
41
elseif(isset($_POST['selection']) AND (!empty($_POST['btn_ok1']) AND ($_POST['selection'][0]=='online') OR (!empty($_POST['btn_ok2']) AND $_POST['selection'][1]=='online')) AND isset($_POST['idCom'])) {
42
42
        foreach ($_POST['idCom'] as $k => $v) $plxAdmin->modCommentaire($v, 'online');
43
43
        header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
44
44
        exit;
45
45
}
46
46
# Mise hors-ligne des commentaires selectionnes
47
 
elseif (isset($_POST['selection']) AND ($_POST['selection'][0] == 'offline' OR $_POST['selection'][1] == 'offline') AND isset($_POST['idCom'])) {
 
47
elseif (isset($_POST['selection']) AND ((!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='offline') OR (!empty($_POST['btn_ok2']) AND $_POST['selection'][1]=='offline')) AND isset($_POST['idCom'])) {
48
48
        foreach ($_POST['idCom'] as $k => $v) $plxAdmin->modCommentaire($v, 'offline');
49
49
        header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
50
50
        exit;
112
112
        $breadcrumbs[] = '<a href="comment_new.php?a='.$_GET['a'].'" title="'.L_COMMENT_NEW_COMMENT_TITLE.'">'.L_COMMENT_NEW_COMMENT.'</a>';
113
113
}
114
114
 
115
 
ob_start();
116
 
if($comSel=='online')
117
 
        plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'offline' => L_COMMENT_SET_OFFLINE, '-'=>'-----', 'delete' => L_COMMENT_DELETE), '', false,'',false);
118
 
elseif($comSel=='offline')
119
 
        plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'online' => L_COMMENT_SET_ONLINE, '-'=>'-----', 'delete' => L_COMMENT_DELETE), '', false,'',false);
120
 
elseif($comSel=='all')
121
 
        plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'online' => L_COMMENT_SET_ONLINE, 'offline' => L_COMMENT_SET_OFFLINE,  '-'=>'-----','delete' => L_COMMENT_DELETE), '', false,'',false);
122
 
$selector=ob_get_clean();
 
115
function selector($comSel, $id) {
 
116
        ob_start();
 
117
        if($comSel=='online')
 
118
                plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'offline' => L_COMMENT_SET_OFFLINE, '-'=>'-----', 'delete' => L_COMMENT_DELETE), '', false,'',$id);
 
119
        elseif($comSel=='offline')
 
120
                plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'online' => L_COMMENT_SET_ONLINE, '-'=>'-----', 'delete' => L_COMMENT_DELETE), '', false,'',$id);
 
121
        elseif($comSel=='all')
 
122
                plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'online' => L_COMMENT_SET_ONLINE, 'offline' => L_COMMENT_SET_OFFLINE,  '-'=>'-----','delete' => L_COMMENT_DELETE), '', false,'',$id);
 
123
        return ob_get_clean();
 
124
}
123
125
 
 
126
$selector1=selector($comSel, 'id_selection1');
 
127
$selector2=selector($comSel, 'id_selection2');
124
128
?>
125
129
 
126
130
<?php eval($plxAdmin->plxPlugins->callHook('AdminCommentsTop')) # Hook Plugins ?>
131
135
        <?php echo implode('&nbsp;|&nbsp;', $breadcrumbs); ?>
132
136
</p>
133
137
<p>
134
 
        <?php echo $selector ?><input class="button submit" type="submit" name="submit" value="Ok" />
 
138
        <?php echo $selector1 ?><input class="button submit" type="submit" name="btn_ok1" value="<?php echo L_OK ?>" onclick="return confirmAction(this.form, 'id_selection1', 'delete', 'idCom[]', '<?php echo L_CONFIRM_DELETE ?>')" />
135
139
</p>
136
140
<table class="table">
137
141
<thead>
180
184
</table>
181
185
<p>
182
186
        <?php echo plxToken::getTokenPostMethod() ?>
183
 
        <?php echo $selector ?><input class="button submit" type="submit" name="submit" value="Ok" />
 
187
        <?php echo $selector2 ?><input class="button submit" type="submit" name="btn_ok2" value="<?php echo L_OK ?>" onclick="return confirmAction(this.form, 'id_selection2', 'delete', 'idCom[]', '<?php echo L_CONFIRM_DELETE ?>')"/>
184
188
</p>
185
189
</form>
186
190