Exemple #1
0
 /**
  * Create boolean widget
  *
  * When creating Yes/No radio buttons, the "yes_text"
  * and "no_text" option attributes are used to override
  * the typical "Yes" and "No" text.
  *
  * @param boolean $checkbox When TRUE, the widget will be
  *                          constructed as a checkbox,
  *                          otherwise it will be a set of
  *                          Yes/No radio buttons (OPTIONAL;
  *                          default is TRUE (checkbox)).
  *
  * @return string html formated boolean widget
  *
  */
 function createWidget_Boolean($checkbox = TRUE)
 {
     global $oTemplate, $nbsp;
     // checkbox...
     //
     if ($checkbox) {
         $result = addCheckbox('new_' . $this->name, $this->value != SMPREF_NO, SMPREF_YES, array_merge(array('id' => 'new_' . $this->name), $this->aExtraAttribs)) . $nbsp . create_label($this->trailing_text, 'new_' . $this->name);
     } else {
         /* Build the yes choice. */
         $yes_option = addRadioBox('new_' . $this->name, $this->value != SMPREF_NO, SMPREF_YES, array_merge(array('id' => 'new_' . $this->name . '_yes'), $this->aExtraAttribs)) . $nbsp . create_label(!empty($this->yes_text) ? $this->yes_text : _("Yes"), 'new_' . $this->name . '_yes');
         /* Build the no choice. */
         $no_option = addRadioBox('new_' . $this->name, $this->value == SMPREF_NO, SMPREF_NO, array_merge(array('id' => 'new_' . $this->name . '_no'), $this->aExtraAttribs)) . $nbsp . create_label(!empty($this->no_text) ? $this->no_text : _("No"), 'new_' . $this->name . '_no');
         /* Build the combined "boolean widget". */
         $result = "{$yes_option}{$nbsp}{$nbsp}{$nbsp}{$nbsp}{$no_option}";
     }
     return $result;
 }
Exemple #2
0
    $tmap[''] = 'none';
    echo addSelect('data[0][teamid]', $tmap, isset($row['teamid']) ? $row['teamid'] : @$_GET['forteam'], true);
    ?>
</td></tr>

<!-- role selection -->
<tr><td>Roles:</td>
<td><?php 
    $roles = $DB->q('TABLE SELECT r.roleid, r.role, r.description, max(ur.userid=%s) AS hasrole
                 FROM role r
                 LEFT JOIN userrole ur USING (roleid)
                 GROUP BY r.roleid', @$row['userid']);
    $i = 0;
    foreach ($roles as $role) {
        echo "<label>";
        echo addCheckbox("data[0][mapping][0][items][{$i}]", $role['hasrole'] == 1, $role['roleid']);
        echo $role['description'] . "</label><br/>";
        $i++;
    }
    ?>
</td></tr>

</table>
<?php 
    echo addHidden('data[0][mapping][0][fk][0]', 'userid') . addHidden('data[0][mapping][0][fk][1]', 'roleid') . addHidden('data[0][mapping][0][table]', 'userrole');
    echo addHidden('cmd', $cmd) . addHidden('table', 'user') . addHidden('referrer', @$_GET['referrer']) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
    require LIBWWWDIR . '/footer.php';
    exit;
}
$row = $DB->q('MAYBETUPLE SELECT u.*, t.name AS teamname FROM user u
               LEFT JOIN team t USING(teamid)
Exemple #3
0
											findWithId($(elem).val(), "category", function(obj) {
												$(elem).siblings("textarea").html(obj["summary"]);
											});
						                });
                                    </script>
                                    <div id="log"></div>
                                </div>
    	                    </div>
	                        <div class="notidel notioption">
    	                    	<div class="button">Delete</div>
                                <div class="body">
	        	                	<form method="post" onsubmit="return confirm('Are you sure? Deleting category will also delete all the entries related to it.');">
    	        	                	<input type="hidden" name="ntype" value="delcategory"  />
                                        <?php 
    foreach ($client->category as $r) {
        addCheckbox($r['id'], $r['name'], "todel");
    }
    ?>
                                        <input type="checkbox" class="selectall">Select all</input>
                        	        	<input type="submit" value="Delete" />
	                	    	    </form>
                                </div>
    	                    </div>
                            <?php 
}
?>
                        </div>
                    </div></div>
                </div>
            </div>
    	<?php