Exemple #1
0
 public function xhtml($editor_id, $do)
 {
     $controls = '<div>';
     if (!$this->read_only) {
         $form = new Doku_Form(array('class' => 'editor_edit_form', 'editor' => $editor_id));
         $form->addElement(form_makeButton('submit', '', 'edit'));
         $controls .= $form->getForm();
         $controls .= '<div class="editor_save_controls">';
         $form = new Doku_Form(array('class' => 'editor_save_form', 'editor' => $editor_id));
         $form->addElement(form_makeButton('submit', 'savecontent', 'save'));
         $controls .= $form->getForm() . cancel_button() . '</div>';
     }
     return $controls . $this->editor_xhtml($editor_id, $do) . '</div>';
 }
Exemple #2
0
 public function __construct($parent, $file, $read_only)
 {
     parent::__construct($parent, 'Recipe');
     $editor = Projects_Editor_Manager::manager()->editor('', $file->code(), $file->highlight());
     $editor->read_only = $read_only;
     $maker = $this->newElement('div', array(), 'Maker: ');
     $this->root->appendChild($maker);
     if (auth_quickaclcheck($file->id()) >= DOKU_EDIT) {
         $makers = Projects_Maker_Manager::manager()->maker($file);
         if (count($makers) > 1) {
             $select = $this->newElement('select', array('id' => 'PROJECTS_maker', 'name' => 'maker'));
             $maker->appendChild($select);
             foreach ($makers as $m) {
                 $prop = array('value' => $m->name());
                 if ($m->name() == $file->maker()) {
                     $prop['selected'] = 1;
                 }
                 $opt = $this->newElement('option', $prop, $m->name());
                 $select->appendChild($opt);
             }
             $controls = $this->newElement('span', array('id' => 'maker_controls', 'maker' => $file->maker()));
             $maker->appendChild($controls);
             $form = new Doku_Form(array('id' => 'maker_select_form'));
             $form->addElement(form_makeButton('submit', 'set_maker', 'update', array('id' => 'set_maker')));
             $controls->appendChild($this->loadElement($form->getForm()));
             $controls->appendChild($this->loadElement(cancel_button()));
         } else {
             $m = $makers ? $makers[0]->name() : 'none';
             $maker->appendChild($this->newText($m));
         }
     } else {
         $maker->appendChild($this->newText('Maker: ' . $file->maker()));
     }
     $content = $editor->xhtml('recipe', 'savecontent');
     $this->root->appendChild($this->loadElement("<div>{$content}</div>"));
 }
Exemple #3
0
/**
* Interface to add or edit announcement information
* @param Group $group array of schedule data
* @param boolean $edit whether this is an edit or not
* @param object $pager Pager object
*/
function print_group_edit($group, $edit, &$pager, $group_users = array())
{
    global $conf;
    ?>
<form name="addGroup" method="post" action="admin_update.php">
<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td class="tableBorder">
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="formNames"><?php 
    echo translate('Group Name');
    ?>
</td>
          <td class="cellColor"><input type="text" name="group_name" class="textbox" size="50" maxlength="50" value="<?php 
    echo !empty($group->name) ? $group->name : '';
    ?>
" />
          </td>
        </tr>
        <tr>
          <td width="200" class="formNames"><?php 
    echo translate('Administrator');
    ?>
</td>
          <td class="cellColor"><select name="group_admin" class="textbox">
			<?php 
    echo '<option value="">' . translate('None') . '</option>';
    for ($i = 0; $i < count($group_users); $i++) {
        echo "<option value=\"{$group_users[$i]['memberid']}\"";
        if ($group_users[$i]['memberid'] == $group->adminid) {
            echo ' selected="selected"';
        }
        echo ">{$group_users[$i]['lname']}, {$group_users[$i]['fname']}</option>\n";
    }
    ?>
		  </select>
          </td>
        </tr>
	  </table>
    </td>
  </tr>
</table>
<br />
<?php 
    // Print out correct buttons
    if (!$edit) {
        echo submit_button(translate('Save'), 'groupid') . hidden_fn('addGroup') . ' <input type="reset" name="reset" value="' . translate('Clear') . '" class="button" />' . "\n";
    } else {
        echo submit_button(translate('Edit'), 'groupid') . cancel_button($pager) . hidden_fn('editGroup') . '<input type="hidden" name="groupid" value="' . $group->id . '" />' . "\n";
    }
    echo "</form>\n";
}
<?php

//let the party begin!
require 'dbconnection.php';
require 'constants.php';
require 'functions.php';
//отмена добавления или редактирования
cancel_button();
//если нажали "Добавить" на модальной форме
if (isset($_POST['add_new_course_in_plan_button'])) {
    while (1) {
        //формируем запрос sql
        if (isset($_POST['add_new_course_in_plan_button'])) {
            $my_query = 'INSERT INTO `plan` (`id`, `group-id`, `startdate`, `enddate`,`room`)
                VALUES (NULL, \'' . $_POST['group_list'] . '\',\'' . $_POST['start_date'] . '\',\'' . $_POST['end_date'] . '\',\'' . $_POST['note'] . '\')';
        }
        //        if (isset($_POST['update_button']))
        //            $my_query = 'UPDATE  `courses`
        //                SET  `name` = \''.$_POST['name'].'\',`hours` =  \''.$_POST['hours'].'\',
        //                     `moneyperhour` =  \''.$_POST['tax'].'\',`price`=\''.$_POST['price'].'\'
        //                     WHERE `id` = \''.$_POST['id'].'\'';
        //echo $add_new_course_query;
        $my_query_result = mysql_query($my_query);
        if (mysql_errno($link) == 0) {
            // header('Location: /groups.php');
            break;
        }
        if (mysql_errno($link) == 1062) {
            $warning = 'Такая запись уже имеется';
            break;
        }
 public function xhtml()
 {
     global $MERGED_DIFF;
     $this->doc = new DOMDocument();
     $this->root = $this->doc->createElement('div');
     $this->doc->appendChild($this->root);
     $text = '';
     $i = 1;
     foreach ($MERGED_DIFF as $op) {
         if (!is_array($op) && $op->from == SAME_OP) {
             $text .= orig($op);
             continue;
         }
         if ($text) {
             $this->copy($text);
             $text = '';
         }
         $this->diffOpOutput($op, $i++);
     }
     if ($text) {
         $this->copy($text);
     }
     echo $this->doc->saveXML($this->root);
     $form = new Doku_Form(array('id' => 'diff_form'));
     $form->addHidden($this->new_input_name(), '');
     $form->addHidden($this->old_input_name(), '');
     $form->addElement(form_makeButton('submit', $this->action(), 'save', array('id' => 'diffsubmit')));
     echo $form->getForm();
     echo cancel_button();
 }