예제 #1
0
    $config = ExternConfig::GetInstance($range_id, '', $config_id);
    if ($config->deleteConfiguration()) {
        my_msg(sprintf(_("Konfiguration <strong>\"%s\"</strong> für Modul <strong>\"%s\"</strong> gelöscht!"), htmlReady($config->getConfigName()), htmlReady($GLOBALS['EXTERN_MODULE_TYPES'][$config->getTypeName()]['name'])), 'blank', 1, false);
    } else {
        my_error(_("Konfiguration konnte nicht gelöscht werden"));
    }
}

echo "<tr><td class=\"blank\" width=\"100%\" valign=\"top\">\n";

if (Request::option('com') == 'delete_sec') {
    $config = ExternConfig::GetConfigurationMetaData($range_id, $config_id);

    $message = sprintf(_("Wollen Sie die Konfiguration <b>&quot;%s&quot;</b> des Moduls <b>%s</b> wirklich löschen?"), $config["name"], $GLOBALS["EXTERN_MODULE_TYPES"][$config["type"]]["name"]);
    $message .= '<br><br>';
    $message .= LinkButton::createAccept("JA", URLHelper::getURL('?com=delete&config_id='.$config_id));
    $message .= LinkButton::createCancel("NEIN", URLHelper::getURL('?list=TRUE&view=extern_inst'));

    my_info($message, "blank", 1);
    print_footer();

    $template = $GLOBALS['template_factory']->open('layouts/base.php');
    $template->content_for_layout = ob_get_clean();
    echo $template->render();
    page_close();
    die;
}

$css_switcher = new cssClassSwitcher();

if (Request::option('com') == 'info') {
예제 #2
0
 /**
 * Creates a delete-request
 *
 * @access   public
 * @return    boolean  false
 */
 function execCommandAssertDeleteItem()
 {
     $group =& $this->tree->getGroupObject($this->itemID);
     if ($group->getChildType() == "EvaluationQuestion") {
         $numberofchildren = $group->getNumberChildren();
     } else {
         $numberofchildren = $this->tree->getNumKidsKids($this->itemID);
     }
     $title = htmlready($group->getTitle());
     // constructing the message
     $this->msg[$this->itemID] = "info§";
     if ($group->getChildType() == "EvaluationQuestion") {
         if ($numberofchildren) {
             $this->msg[$this->itemID] .= "" . sprintf(_("Sie beabsichtigen den Fragenblock <b>%s</b> inklusive aller Fragen zu löschen. "), $title) . sprintf(_("Es werden insgesamt %s Fragen gelöscht!"), $numberofchildren);
         } else {
             $this->msg[$this->itemID] .= "" . sprintf(_("Sie beabsichtigen den Fragenblock <b>%s</b> inklusive aller Fragen zu löschen. "), $title);
         }
         $this->msg[$this->itemID] .= "<br>" . _("Wollen Sie diesen Fragenblock wirklich löschen?");
     } else {
         if ($numberofchildren) {
             $this->msg[$this->itemID] .= "" . sprintf(_("Sie beabsichtigen den Gruppierungsblock <b>%s</b> inklusive aller Unterblöcke zu löschen. "), $title) . sprintf(_("Es werden insgesamt %s Unterblöcke gelöscht!"), $numberofchildren);
         } else {
             $this->msg[$this->itemID] .= "" . sprintf(_("Sie beabsichtigen den Gruppierungsblock <b>%s</b> inklusive aller Unterblöcke zu löschen. "), $title);
         }
         $this->msg[$this->itemID] .= "<br>" . _("Wollen Sie diesen Gruppierungsblock wirklich löschen?");
     }
     $this->msg[$this->itemID] .= "<br><br>" . LinkButton::createAccept(_('JA!'), $this->getSelf('cmd[DeleteItem]=1'), array('title' => _('Löschen'))) . "&nbsp;" . LinkButton::createCancel(_('NEIN!'), $this->getSelf('cmd[Cancel]=1'), array('title' => _('Abbrechen'))) . "\n";
     return false;
 }
예제 #3
0
파일: index.php 프로젝트: ratbird/hope
 /**
  * Delete the submitted entry.
  * 
  * @param string $topic_id the entry to delete
  */
 function delete_entry_action($topic_id)
 {
     // get the page of the posting to be able to jump there again
     $page = ForumEntry::getPostingPage($topic_id);
     URLHelper::addLinkParam('page', $page);
     if (ForumPerm::hasEditPerms($topic_id) || ForumPerm::check('remove_entry', $this->getId(), $topic_id)) {
         $path = ForumEntry::getPathToPosting($topic_id);
         $topic = array_pop($path);
         $parent = array_pop($path);
         if ($topic_id != $this->getId()) {
             // only delete directly if passed by ajax, otherwise ask for confirmation
             if (Request::isXhr() || Request::get('approve_delete')) {
                 ForumEntry::delete($topic_id);
                 $this->flash['messages'] = array('success' => sprintf(_('Der Eintrag %s wurde gelöscht!'), $topic['name']));
             } else {
                 $this->flash['messages'] = array('info_html' => sprintf(_('Sind sie sicher dass Sie den Eintrag %s löschen möchten?'), $topic['name']) . '<br>' . \Studip\LinkButton::createAccept(_('Ja'), PluginEngine::getUrl('coreforum/index/delete_entry/' . $topic_id . '?approve_delete=1')) . \Studip\LinkButton::createCancel(_('Nein'), PluginEngine::getUrl('coreforum/index/index/' . ForumEntry::getParentTopicId($topic_id) . '/' . $page)));
             }
         } else {
             $this->flash['messages'] = array('success' => _('Sie können nicht die gesamte Veranstaltung löschen!'));
         }
     }
     if (Request::isXhr()) {
         $this->render_template('messages');
         $this->flash['messages'] = null;
     } else {
         $this->redirect(PluginEngine::getLink('coreforum/index/index/' . $parent['id'] . '/' . $page));
     }
 }
예제 #4
0
 function testCreateAccept()
 {
     $this->assertEquals('<a class="accept button" href="?" name="accept" tabindex="0">Übernehmen</a>', '' . LinkButton::createAccept());
 }
예제 #5
0
파일: question.php 프로젝트: ratbird/hope
?>
</span>
            <a href="<?php 
echo $disapprovalLink;
?>
" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close">
                <span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span>
                <span class="ui-button-text"><?php 
echo _('Schliessen');
?>
</span>
            </a>
        </div>
        <div class="content ui-widget-content ui-dialog-content studip-confirmation">
            <?php 
echo formatReady($question);
?>
        </div>
        <div class="buttons ui-widget-content ui-dialog-buttonpane">
            <div class="ui-dialog-buttonset">
                <?php 
echo LinkButton::createAccept(_('Ja'), $approvalLink);
?>
                <?php 
echo LinkButton::createCancel(_('Nein'), $disapprovalLink);
?>
            </div>
        </div>
    </div>    
</div>
 /**
  * creates the 'Safeguard'
  *
  * @access  private
  * @param sign   string Sign to draw (must be "ok" or "ausruf")
  * @param text   string        The Text to draw
  * @param evalID string needed if you want to delete an evaluation (not needed)
  */
 function createSafeguard($sign, $text, $mode = NULL, $evalID = NULL, $showrangeID = NULL, $referer = NULL)
 {
     //TODO: auf messagebox bzw. createQuestion umstellen!!!
     $label = array("referer" => _("Zum vorherigen Bereich zurückkehren."), "yes" => _("Ja!"), "no" => _("Nein!"), "delete" => _("Löschen."), "template" => _("Zu den eigenen Evaluationsvorlagen verschieben."), "cancel" => _("Abbrechen."));
     $html = "   <table align=\"center\" width=\"100%\" border=0 cellpadding=3 cellspacing=0>\n" . "   <tr>\n" . "    <td width=\"34\" valign=\"middle\" style=\"vertical-align:middle;\">\n";
     if ($sign != "") {
         if ($sign == 'ok') {
             $sign = 'messagebox/info.png';
         } elseif ($sign == 'ausruf') {
             $sign = 'messagebox/question.png';
         }
         $html .= Assets::img($sign, array('class' => 'middle'));
     }
     $html .= "    </td>\n";
     $html .= "    <td align=\"left\" valign=\"middle\" style=\"vertical-align:middle;\">\n";
     $html .= "     <span class=\"" . ($sign == "ausruf" ? "eval_error" : "eval_success") . "\"><br>" . $text . "</span><br><br>\n";
     if ($referer) {
         $linkreferer = "&referer=" . $referer;
     }
     if ($mode == "delete_request") {
         $value1 = "delete_confirmed";
         $value2 = "delete_aborted";
         $request = YES;
     }
     if ($mode == "restart_request") {
         $value1 = "restart_confirmed";
         $value2 = "restart_aborted";
         $request = YES;
     }
     if ($referer) {
         URLHelper::bindLinkParam('referer', $referer);
     }
     if ($request) {
         $html .= LinkButton::createAccept(_("Ja"), URLHelper::getURL('admin_evaluation.php?evalAction=' . $value1 . '&evalID=' . $evalID . '&rangeID=' . $showrangeID), array('title' => $label["yes"])) . "\n";
         $html .= LinkButton::createCancel(_("Nein"), URLHelper::getURL('admin_evaluation.php?evalAction=' . $value2 . '&evalID=' . $evalID . '&rangeID=' . $showrangeID), array('title' => $label["no"])) . "\n";
     }
     if ($mode == "unlink_delete_request") {
         $add_cancel = !$referer ?: "&referer=" . $referer;
         $links = array(URLHelper::getURL('admin_evaluation.php?evalAction=delete_confirmed&evalID=' . $evalID . '&rangeID=' . $showrangeID), URLHelper::getURL('admin_evaluation.php?evalAction=unlink_delete_aborted&evalID=' . $evalID . '&rangeID=' . $showrangeID), URLHelper::getURL('admin_evaluation.php?evalAction=unlink_and_move&evalID=' . $evalID . '&rangeID=' . $showrangeID . $add_cancel));
         $html .= LinkButton::create(_('Löschen'), $links[0], array('title' => $label["delete"])) . "\n";
         $html .= LinkButton::create(_('Verschieben'), $links[1], array('title' => $label["template"])) . "\n";
         $html .= LinkButton::createCancel(_('Abbrechen'), $links[2], array('title' => $label["cancel"])) . "\n";
         $html .= "<br><br>";
     }
     $html .= "    </td>\n" . "   </tr>\n";
     if ($referer) {
         $html .= "    <tr><td>&nbsp;</td><td><a href=\"" . URLHelper::getLink($referer) . "\">" . $label["referer"] . "</a></td></tr>";
     }
     $html .= "   </table>\n";
     return $html;
 }
예제 #7
0
 function execCommandAssertDeleteItem(){
     $item_id = Request::option('item_id');
     if ($this->isParentAdmin($item_id)){
         $this->mode = "AssertDeleteItem";
         $this->open_items[$item_id] = true;
         $this->msg[$item_id] = "info§" ._("Sie beabsichtigen diesen Bereich inklusive aller Unterbereiche zu löschen. ")
         . sprintf(_("Es werden insgesamt %s Bereiche gelöscht!"),count($this->tree->getKidsKids($item_id))+1)
         . "<br>" . _("Wollen Sie diese Bereiche wirklich löschen?") . "<br>"
         . LinkButton::createAccept(_('JA!'),
                 URLHelper::getURL($this->getSelf('cmd=DeleteItem&item_id='.$item_id)),
                 array('title' => _('löschen')))
         . "&nbsp;"
         . LinkButton::createCancel(_('NEIN!'),
                 URLHelper::getURL($this->getSelf('cmd=Cancel&item_id='. $item_id)),
                 array('title' => _('abbrechen')));
     }
     return false;
 }
 function execCommandAssertDeleteItem()
 {
     $item_id = Request::option('item_id');
     if ($this->isParentAdmin($item_id)) {
         $this->mode = "AssertDeleteItem";
         $this->msg[$item_id] = "info§" . _("Sie beabsichtigen dieses Element, inklusive aller Unterelemente, zu löschen. ") . sprintf(_("Es werden insgesamt %s Elemente gelöscht!"), count($this->tree->getKidsKids($item_id)) + 1) . "<br>" . _("Wollen Sie diese Elemente wirklich löschen?") . "<br>" . '<div class="button-group">' . LinkButton::createAccept(_("JA"), URLHelper::getURL($this->getSelf("cmd=DeleteItem&item_id={$item_id}"))) . LinkButton::createCancel(_("NEIN"), URLHelper::getURL($this->getSelf("cmd=Cancel&item_id={$item_id}"))) . "</div>";
     }
     return false;
 }
예제 #9
0
    $statusgruppe->getMessages(array());
}

// ask, if the user really intends to delete the role
if (Request::option('cmd') == 'deleteRole') {
    $statusgruppe = new Statusgruppe(Request::option('role_id'));
    if (Request::get('really')) {
        $statusgruppe->delete();
        $message = sprintf(_('Die Gruppe %s wurde gelöscht!'),
                           htmlReady($statusgruppe->getName()));
        PageLayout::postMessage(MessageBox::success($message));
    } else {
        $message  = sprintf(_('Sind Sie sicher, dass Sie die Gruppe %s löschen möchten?'),
                            '<b>'. htmlReady($statusgruppe->getName()) .'</b>');
        $message .= '<br>';
        $message .= LinkButton::createAccept(_('JA!'), URLHelper::getURL('', array('cmd' => 'deleteRole', 'really' => 'true', 'role_id' => Request::option('role_id'))));
        $message .= '&nbsp;&nbsp;&nbsp;&nbsp;';
        $message .= LinkButton::createCancel(_('NEIN!'), URLHelper::getURL(''));

        PageLayout::postMessage(MessageBox::info($message));
    }
}

// adding a new role
if (Request::option('cmd') == 'addRole' && !Request::submitted('choosePreset')) {
    // to prevent url-hacking for changing the data of an existing role
    $role_id = md5(uniqid(rand()));
    if (!Statusgruppe::roleExists($role_id)) {
        $new_role = new Statusgruppe();

        // this is necessary, because it could be the second try to add after the user has corrected errors