function ScheduleView ($start_hour = 8, $end_hour = 20, $show_columns = false, $start_date = false) { $this->start_hour=$start_hour; $this->end_hour=$end_hour; if (!$show_columns) { for($i = 1; $i < 8; ++$i) $this->show_columns[$i] = true; } else $this->show_columns = $show_columns; if ($start_date) $this->start_date = $start_date; else $this->start_date = time(); //the base_date have to be 0:00 $this->base_date = mktime(0, 0, 0, date("n", $this->start_date), date("j",$this->start_date), date("Y",$this->start_date)); //the categories configuration (color's and bg-image) $this->categories = array( "0" => array("bg-picture" => Assets::image_path('calendar/category3_small.jpg'), "border-color" => "#b02e7c"), // is now obsolete "1" => array("bg-picture" => Assets::image_path('calendar/category5_small.jpg'), "border-color" => "#f26e00"), "2" => array("bg-picture" => Assets::image_path('calendar/category9_small.jpg'), "border-color" => "#ffbd33"), "3" => array("bg-picture" => Assets::image_path('calendar/category11_small.jpg'), "border-color" => "#a480b9"), "4" => array("bg-picture" => Assets::image_path('calendar/category13_small.jpg'), "border-color" => "#70c3bf")); }
public function __construct() { parent::__construct(); if ($GLOBALS['perm']->have_perm("root")) { $processes = FleximportProcess::findBySQL("1=1 ORDER BY name ASC"); $navigation = new Navigation($this->getDisplayName()); $navigation->setURL(PluginEngine::getURL($this, array(), 'import/overview' . (count($processes) ? "/" . $processes[0]['process_id'] : ""))); Navigation::addItem('/start/fleximport', $navigation); Navigation::addItem('/fleximport', $navigation); if (count($processes)) { foreach ($processes as $process) { $navigation = new Navigation($process['name'], PluginEngine::getURL($this, array(), 'import/overview/' . $process->getId())); Navigation::addItem('/fleximport/process_' . $process->getId(), $navigation); } } else { $navigation = new Navigation(_("Import"), PluginEngine::getURL($this, array(), 'import/overview')); Navigation::addItem('/fleximport/overview', $navigation); } $navigation = new Navigation(_("Konfiguration"), PluginEngine::getURL($this, array(), 'config/overview')); Navigation::addItem('/fleximport/config', $navigation); if (FleximportConfig::get("DISPLAY_AT_HEADER")) { if (is_numeric(FleximportConfig::get("DISPLAY_AT_HEADER"))) { Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create("install", "navigation") : Assets::image_path("icons/lightblue/install.svg")); } else { Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create(FleximportConfig::get("DISPLAY_AT_HEADER"), "navigation") : FleximportConfig::get("DISPLAY_AT_HEADER")); } } } }
/** * create xml_header * * This function creates a xml-header for output. * Its contents are Name of University, Stud.IP-Version, Range of Export (e.g. "root"), and temporal range. * * @access public * @return string xml-header */ function xml_header() { global $UNI_NAME_CLEAN, $SOFTWARE_VERSION, $ex_type, $ex_sem, $range_name, $range_id; $semester = $ex_sem ? Semester::find($ex_sem) : Semester::findCurrent(); $xml_tag_string = "<" . "?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; $xml_tag_string .= "<studip version=\"" . xml_escape ($SOFTWARE_VERSION) . "\" logo=\"". xml_escape (Assets::image_path('logos/logo2b.png')) . "\""; if ($range_id == "root") $xml_tag_string .= " range=\"" . _("Alle Einrichtungen") . "\""; elseif ($range_name != "") $xml_tag_string .= " range=\"" . xml_escape ($range_name) . "\""; if ($UNI_NAME_CLEAN != "") $xml_tag_string .= " uni=\"" . xml_escape ($UNI_NAME_CLEAN) . "\""; if ($semester) $xml_tag_string .= " zeitraum=\"" . xml_escape ($semester->name) . "\" semester_id=\"" . xml_escape ($semester->getId()) . "\""; $xml_tag_string .= ">\n"; return $xml_tag_string; }
/** * Initialize default page layout. This should only be called once * from phplib_local.inc.php. Don't use this otherwise. */ public static function initialize() { // set favicon self::addHeadElement('link', array('rel' => 'apple-touch-icon', 'href' => Assets::image_path('touch-icon-ipad3.png'), 'size' => '144x144')); self::addHeadElement('link', array('rel' => 'apple-touch-icon', 'href' => Assets::image_path('touch-icon-iphone4.png'), 'size' => '114x114')); self::addHeadElement('link', array('rel' => 'apple-touch-icon', 'href' => Assets::image_path('touch-icon-ipad.png'), 'size' => '72x72')); self::addHeadElement('link', array('rel' => 'apple-touch-icon', 'href' => Assets::image_path('touch-icon-iphone.png'))); self::addHeadElement('link', array('rel' => 'shortcut icon', 'href' => Assets::image_path('favicon.png'))); // set initial width for mobile devices self::addHeadElement('meta', array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0')); // include ie-specific CSS self::addComment('[if IE]>' . Assets::stylesheet('ie.css', array('media' => 'screen,print')) . '<![endif]'); self::addHeadElement('link', array('rel' => 'help', 'href' => format_help_url('Basis.VerschiedenesFormat'), 'class' => 'text-format', 'title' => _('Hilfe zur Textformatierung'))); self::setSqueezePackages("base"); if (Config::get()->WYSIWYG) { self::addSqueezePackage("wysiwyg"); } self::addScript("mathjax/MathJax.js?config=TeX-AMS_HTML,default"); }
function __construct() { parent::__construct(); require_once 'polyfills/Button.php'; require_once 'polyfills/LinkButton.php'; PageLayout::addStylesheet($this->getPluginURL() . '/polyfills/buttons.css'); $navigation = new AutoNavigation(_('Plugin-Generator')); $navigation->setURL(PluginEngine::GetLink($this, array(), '')); $navigation->setImage(Assets::image_path('icons/16/black/plugin.png')); Navigation::addItem('/tools/plugingenerator', $navigation); /*/ $navigation = new AutoNavigation(_('Plugin-Generator')); $navigation->setURL(PluginEngine::GetLink($this, array(), '')); Navigation::addItem('/plugingenerator/index', $navigation); $navigation = new AutoNavigation(_('Tools')); $navigation->setURL(PluginEngine::GetLink($this, array(), 'tools')); Navigation::addItem('/plugingenerator/tools', $navigation); //*/ }
private function setupNavigation() { global $perm; $cid = $this->getContext(); if (Request::isXhr() || Navigation::hasItem('/course/cliqr') || !$this->isActivated($cid) || !$perm->have_studip_perm("tutor", $cid)) { return; } # /course/cliqr -> plugins.php/cliqrplugin/questions $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'questions', true); $navigation = new Navigation(_('Cliqr'), $url); $navigation->setImage(Assets::image_path('icons/16/white/test.png')); $navigation->setActiveImage(Assets::image_path('icons/16/black/test.png')); # /course/cliqr/index -> plugins.php/cliqrplugin/questions#index $navigation->addSubNavigation("index", new Navigation(_("Fragen"), $url . '#index')); # /course/cliqr/new -> plugins.php/cliqrplugin/questions#new $navigation->addSubNavigation("new", new Navigation(_("Frage erstellen"), $url . '#new')); # /course/cliqr/help -> plugins.php/cliqrplugin/help $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'help', true); $navigation->addSubNavigation("help", new Navigation(_("Methodische Informationen"), $url)); Navigation::addItem('/course/cliqr', $navigation); }
public function answer_action($questionnaire_id) { $this->questionnaire = new Questionnaire($questionnaire_id); if (!$this->questionnaire->isViewable()) { throw new AccessDeniedException("Der Fragebogen ist nicht einsehbar."); } if (Request::isPost()) { $answered_before = $this->questionnaire->isAnswered(); foreach ($this->questionnaire->questions as $question) { $answer = $question->createAnswer(); if (!$answer['question_id']) { $answer['question_id'] = $question->getId(); } $answer['user_id'] = $GLOBALS['user']->id; if (!$answer['answerdata']) { $answer['answerdata'] = array(); } if ($this->questionnaire['anonymous']) { $answer['user_id'] = null; $answer['chdate'] = 1; $answer['mkdate'] = 1; } $answer->store(); } if ($this->questionnaire['anonymous']) { $anonymous_answer = new QuestionnaireAnonymousAnswer(); $anonymous_answer['questionnaire_id'] = $this->questionnaire->getId(); $anonymous_answer['user_id'] = $GLOBALS['user']->id; $anonymous_answer->store(); } if (!$answered_before && !$this->questionnaire['anonymous'] && $this->questionnaire['user_id'] !== $GLOBALS['user']->id) { $url = URLHelper::getURL("dispatch.php/questionnaire/evaluate/" . $this->questionnaire->getId(), array(), true); foreach ($this->questionnaire->assignments as $assignment) { if ($assignment['range_type'] === "course") { $url = URLHelper::getURL("dispatch.php/course/overview#" . $this->questionnaire->getId(), array('cid' => $assignment['range_id'], 'contentbox_type' => "vote", 'contentbox_open' => $this->questionnaire->getId())); } elseif ($assignment['range_type'] === "profile") { $url = URLHelper::getURL("dispatch.php/profile#" . $this->questionnaire->getId(), array('contentbox_type' => "vote", 'contentbox_open' => $this->questionnaire->getId()), true); } elseif ($assignment['range_type'] === "start") { $url = URLHelper::getURL("dispatch.php/start#" . $this->questionnaire->getId(), array('contentbox_type' => "vote", 'contentbox_open' => $this->questionnaire->getId()), true); } break; } PersonalNotifications::add($this->questionnaire['user_id'], $url, sprintf(_("%s hat an der Befragung '%s' teilgenommen."), get_fullname(), $this->questionnaire['title']), "questionnaire_" . $this->questionnaire->getId(), Assets::image_path("icons/blue/vote.svg")); } if (Request::isAjax()) { $this->response->add_header("X-Dialog-Close", "1"); $this->response->add_header("X-Dialog-Execute", "STUDIP.Questionnaire.updateWidgetQuestionnaire"); $this->render_template("questionnaire/evaluate"); } elseif (Request::get("range_type") === "user") { PageLayout::postMessage(MessageBox::success(_("Danke für die Teilnahme!"))); $this->redirect("profile?username="******"range_id"))); } elseif (Request::get("range_type") === "course") { PageLayout::postMessage(MessageBox::success(_("Danke für die Teilnahme!"))); $this->redirect("course/overview?cid=" . Request::option("range_id")); } elseif (Request::get("range_id") === "start") { PageLayout::postMessage(MessageBox::success(_("Danke für die Teilnahme!"))); $this->redirect("start"); } else { PageLayout::postMessage(MessageBox::success(_("Danke für die Teilnahme!"))); if ($GLOBALS['perm']->have_perm("autor")) { $this->redirect("questionnaire/overview"); } else { $this->redirect("questionnaire/thank_you"); } } } $this->range_type = Request::get("range_type"); $this->range_id = Request::get("range_id"); PageLayout::setTitle(sprintf(_("Fragebogen beantworten: %s"), $this->questionnaire->title)); }
/** * returns html for a question and its answers * * @access private * @param object EvaluationQuestion the question object. * @param object EvaluationGroup the question's parent-group object. * @return string */ function getQuestionContent($question, $group) { $type = $question->isMultipleChoice() ? "checkbox" : "radio"; # $answerBorder = "1px dotted #c0c0c0"; $answerBorder = "1px dotted #909090"; # $residualBorder = "1px dotted #c0c0c0"; $residualBorder = "1px dotted #909090"; $answerArray = $question->getChildren(); $hasResidual = NO; $leftOutStyle = $group->isMandatory() && Request::submitted('voteButton') && is_array($GLOBALS["mandatories"]) && in_array($question->getObjectID(), $GLOBALS["mandatories"]) ? "background-image:url(" . Assets::image_path("steelgroup1.gif") . "); border-left:3px solid red; border-right:3px solid red;" : ""; /* Skala (one row question) ---------------------------------------- */ if ($question->getType() == EVALQUESTION_TYPE_LIKERT || $question->getType() == EVALQUESTION_TYPE_POL) { if (($numAnswers = $question->getNumberChildren()) > 0) { $cellWidth = (int) (40 / $numAnswers); } if ($numAnswers > 0 && $answerArray[$numAnswers - 1]->isResidual()) { $hasResidual = YES; } $lastTextAnswer = $hasResidual ? $numAnswers - 3 : $numAnswers - 2; /* Headline, only shown for first question */ if ($question->getPosition() == 0) { $html .= " <tr>\n"; $html .= " <td width=\"60%\" style=\"border-bottom: {$answerBorder}; border-top: {$answerBorder};\">"; # $html .= strlen( $group->getText() ) < 100 ? formatReady( $group->getText() ) : " "; $html .= " "; $html .= "</td>\n"; foreach ($answerArray as $answer) { $noWrap = NO; if ($answer->x_instanceof() == INSTANCEOF_EVALANSWER) { if (!$answer->getText()) { /* answer has NO text ------------ */ if ($answer->getPosition() <= $lastTextAnswer / 2) { //&& $numAnswers > 4 ) $headCell = "<--"; } elseif ($answer->getPosition() >= round($lastTextAnswer / 2) + $lastTextAnswer % 2) { //&& $numAnswers > 4 ) $headCell = "-->"; } else { $headCell = "<- ->"; } $noWrap = YES; } else { /* answer has its own text ------ */ $headCell = formatReady($answer->getText()); } $extraStyle = ""; if ($answer->isResidual()) { $extraStyle = "border-left: {$residualBorder};"; $html .= "<td align=\"center\" style=\"{$extraStyle}\" " . "width=\"1\"> </td>"; } $html .= " <td align=\"center\" class=\"steelgroup6\" " . "style=\"border-bottom: {$answerBorder}; " . "border-left: {$answerBorder}; border-top: {$answerBorder}; {$extraStyle};\" " . "width=\"" . $cellWidth . "%\" " . ($noWrap ? "nowrap" : "") . ">"; $html .= $headCell; $html .= "</td>\n"; } } $html .= " </tr>\n"; } /* ------------------------------- Headline end */ /* Question and Answer Widgets ---------------- */ $class = $question->getPosition() % 2 ? "table_row_even" : "table_row_odd"; $extraStyle = $question->getPosition() == $group->getNumberChildren() - 1 ? "border-bottom: {$answerBorder}" : ""; $html .= " <tr class=\"" . $class . "\">\n"; $html .= " <td align=\"left\" width=\"60%\" style=\"{$extraStyle}; {$leftOutStyle};\">"; $html .= formatReady($question->getText()); $html .= $group->isMandatory() ? "<span class=\"eval_error\"><b>**</b></span>" : ""; $html .= "</td>\n"; foreach ($answerArray as $answer) { $number = $question->isMultipleChoice() ? "[" . $answer->getPosition() . "]" : ""; if ($answer->x_instanceof() == INSTANCEOF_EVALANSWER) { $extraStyle = ""; if ($answer->isResidual()) { $extraStyle = "border-left: {$residualBorder};"; $html .= "<td align=\"center\" class=\"steelgroup7\" style=\"{$extraStyle}\" " . "width=\"1%\"> </td>"; } $extraStyle .= $question->getPosition() == $group->getNumberChildren() - 1 ? " border-bottom: {$answerBorder};" : ""; $answers = Request::getArray('answers'); $checked = $answers[$question->getObjectID()] == $answer->getObjectID() ? "checked" : ""; $html .= " <td align=\"center\" style=\"border-left: {$answerBorder}; {$extraStyle};\" " . "width=\"" . $cellWidth . "%\">"; $html .= "<input type=\"" . $type . "\" name=\"answers[" . $question->getObjectID() . "]" . $number . "\" " . "value=\"" . $answer->getObjectID() . "\" " . $checked . ">"; $html .= "</td>\n"; } } $html .= " </tr>\n"; /* -------------------------------------------- */ } else { $class = $question->getPosition() % 2 ? "table_row_even" : "table_row_odd"; /* Question ----------------------------------- */ $html .= "<tr class=\"" . $class . "\">" . "<td align=\"left\" style=\"{$leftOutStyle};\">" . formatReady($question->getText()) . ($group->isMandatory() ? "<span class=\"eval_error\"><b>**</b></span>" : "") . "</td>" . "</tr>\n"; $html .= "<tr class=\"" . $class . "\">"; $html .= "<td>"; $html .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"; /* -------------------------------------------- */ $numberOfVisibleAnswers = 0; foreach ($answerArray as $answer) { if (!($answer->isFreetext() && $answer->getText() != '')) { $numberOfVisibleAnswers++; } } if ($numberOfVisibleAnswers == 0) { $html .= "<tr valign=\"middle\">\n"; $html .= "<td class=\"eval_error\">" . _("Dieser Frage wurden keine Antworten zugeordnet!") . "</td>\n"; $html .= "</tr>\n"; } /* Answers ------------------------------------ */ foreach ($answerArray as $answer) { if ($answer->x_instanceof() == INSTANCEOF_EVALANSWER) { $number = $question->isMultipleChoice() ? "[" . $answer->getPosition() . "]" : ""; /* if not a user's answer */ if (!($answer->isFreetext() && $answer->getText() != '')) { $html .= "<tr valign=\"middle\">\n"; /* show text input field ---------- */ if ($answer->isFreetext()) { // not really needed anymore if ($numberOfVisibleAnswers > 1) { /* show a check/radio-box */ $html .= "<td width=\"2%\">" . "<input type=\"" . $type . "\"" . " name=\"answers[" . $question->getObjectID() . "]" . $number . "\"" . " value=\"" . $answer->getObjectID() . "\">" . "</td>\n"; } /* one row input field */ $freetexts = Request::getArray('freetexts'); if ($answer->getRows() == 1) { $html .= "<td colspan=\"2\">" . "<input type=\"text\"" . " name=\"freetexts[" . $question->getObjectID() . "]\"" . " value=\"" . htmlReady($freetexts[$question->getObjectID()]) . "\" size=\"60\">" . "</td>\n"; } else { $html .= "<td colspan=\"2\">" . "<textarea" . " name=\"freetexts[" . $question->getObjectID() . "]\"" . " cols=\"60\" rows=\"" . $answer->getRows() . "\">" . htmlReady($freetexts[$question->getObjectID()]) . "</textarea>" . "</td>\n"; } } else { $answers = Request::getArray('answers'); /* see if it must be checked */ if ($type == "radio") { $checked = $answers[$question->getObjectID()] == $answer->getObjectID() ? "checked" : ""; } else { $checked = is_array($answers[$question->getObjectID()]) && in_array($answer->getObjectID(), $answers[$question->getObjectID()]) ? "checked" : ""; } /* show a check/radio-box */ $html .= "<td width=\"2%\">" . "<input type=\"" . $type . "\"" . " name=\"answers[" . $question->getObjectID() . "]" . $number . "\"" . " value=\"" . $answer->getObjectID() . "\" " . $checked . ">" . "</td>\n"; $html .= "<td align=\"left\" width=\"98%\">" . formatReady($answer->getText()) . "</td>\n"; } $html .= "</tr>\n"; } } /* ------------------------------- End: Answers */ } $html .= "</table>\n"; $html .= "</td></tr>"; } return $html; }
function index_action($step = 'manifest') { $step = Request::option('step', $step); $this->previous = $this->next = $last = false; foreach ($this->actions as $action) { if ($last == $step) { $this->next = $action; } if ($action == $step) { $this->previous = $last; } $last = $action; } // if (Request::isPost()) { # since Stud.IP 2.1 if ($_SERVER['REQUEST_METHOD'] === 'POST') { $this->plugin = array_merge($this->plugin, $this->extract($step, $errors)); $_SESSION['plugin-generator']['passed'][$step] = empty($errors); } if (!empty($errors)) { PageLayout::postMessage(Messagebox::error(_('Es sind Fehler aufgetreten:'), $errors)); } elseif (Request::submitted('action')) { $action = Request::option('action'); if (!in_array($action, array('display download install'))) { $generator = new Generator($this->dispatcher->plugin->getPluginPath(), '/templates', '/environments'); } $generator->populate($this->plugin); $generator->{$action}(); if ($action === 'install') { $this->redirect(URLHelper::getURL('dispatch.php/admin/plugin')); return; } # PageLayout::postMessage(Messagebox::success('Jipp.')); } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { if (Request::submitted('back')) { $step = Request::option('back', $this->previous); } else { if (Request::submitted('forward')) { $step = Request::option('forward', $this->next); } } $this->redirect('generator/' . $step); return; } $this->step = $step; switch ($step) { case 'manifest': $this->interfaces = array('HomepagePlugin' => _('Homepage eines Nutzers'), 'PortalPlugin' => _('Startseite (Portalseite)'), 'StandardPlugin' => _('Veranstaltungen und Einrichtungen'), 'StudienmodulManagementPlugin' => _('Studienmodulsuche'), 'SystemPlugin' => _('Systemweite Erweiterungen')); $this->versions = words('2.0 2.1 2.2 2.3 2.4'); break; case 'assets': $this->environments = array('default' => _('Standard'), 'trails' => _('Trails')); break; case 'polyfill': $this->polyfills = Polyfill::getVersions(); break; } $variables = array('step' => $step, 'controller' => $this); $factory = new Flexi_TemplateFactory($this->dispatcher->plugin->getPluginPath() . '/app/views/'); $progress = $factory->render('infobox-route', $variables); $this->setInfoboxImage($this->dispatcher->plugin->getPluginURL() . '/assets/images/puzzle.jpg')->addToInfobox(_('Fortschritt'), $progress)->addToInfobox(_('Aktionen'), sprintf('<a href="%s">Reset</a>', $this->url_for('generator/' . $step . '?reset=1')), Assets::image_path('icons/16/black/refresh.png')); }
?> " data-dialog> <?php echo Assets::img("icons/20/blue/assessment"); ?> </a> </td> </tr> <?php } } else { ?> <tr> <td colspan="2" style="text-align: center;"> <?php echo _("Keine Plugins warten auf eine Qualitätssicherung"); ?> </td> </tr> <?php } ?> </tbody> </table> <?php $sidebar = Sidebar::Get(); $sidebar->setImage(Assets::image_path("sidebar/plugin-sidebar.png")); $actions = new ActionsWidget(); //$actions->addLink(_("Neues Plugin eintragen"), PluginEngine::getURL($plugin, array(), "myplugins/add"), null, array('data-dialog' => 1)); //$sidebar->addWidget($actions);
/** * prints out the details for an item, if item is open * * @access private * @param string $item_id */ function printItemDetails($item_id) { if (!$this->tree->hasKids($item_id) || !$this->open_ranges[$item_id] || $item_id == $this->start_item_id) { $level_output = "<td class=\"blank\" background=\"" . Assets::image_path('forumleer.gif') . "\">" . Assets::img('forumleer.gif', array('size' => '10@20')) . "</td>" . $level_output; } else { $level_output = "<td class=\"blank\" background=\"" . Assets::image_path('forumstrich.gif') . "\">" . Assets::img('forumleer.gif', array('size' => '10@20')) . "</td>" . $level_output; } if ($this->tree->isLastKid($item_id) && !($item_id == $this->start_item_id) || !$this->open_ranges[$item_id] && $item_id == $this->start_item_id || $item_id == $this->start_item_id && !$this->tree->hasKids($item_id)) { $level_output = "<td class=\"blank\" background=\"" . Assets::image_path('forumleer.gif') . "\">" . Assets::img('forumleer.gif', array('size' => '10@20')) . "</td>" . $level_output; } else { $level_output = "<td class=\"blank\" background=\"" . Assets::image_path('forumstrich.gif') . "\">" . Assets::img('forumleer.gif', array('size' => '10@20')) . "</td>" . $level_output; } if ($item_id != $this->start_item_id) { $parent_id = $item_id; while ($this->tree->tree_data[$parent_id]['parent_id'] != $this->start_item_id) { $parent_id = $this->tree->tree_data[$parent_id]['parent_id']; if ($this->tree->isLastKid($parent_id)) { $level_output = "<td class=\"blank\" background=\"" . Assets::image_path('forumleer.gif') . "\">" . Assets::img('forumleer.gif', array('size' => '10@20')) . "</td>" . $level_output; } else { $level_output = "<td class=\"blank\" background=\"" . Assets::image_path('forumstrich.gif') . "\">" . Assets::img('forumleer.gif', array('size' => '10@20')) . "</td>" . $level_output; } //vertical line } } //$level_output = "<td class=\"blank\" background=\"".$GLOBALS['ASSETS_URL']."images/forumleer.gif\" ><img src=\"".$GLOBALS['ASSETS_URL']."images/forumleer.gif\" width=\"20\" height=\"20\" border=\"0\" ></td>" . $level_output; echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>{$level_output}"; echo "<td class=\"printcontent\" width=\"100%\"><br>"; echo $this->getItemContent($item_id); echo "<br></td></tr></table>"; return; }
?> </textarea> </td> </tr> </tbody> <tfoot class="table_footer"> <tr> <td colspan="2" data-dialog-button> <?php echo Button::createAccept(_('Speichern'), 'submit'); ?> <? if ($first_entry): ?> <?php echo LinkButton::createCancel(_('Abbrechen'), URLHelper::getLink('seminar_main.php')); ?> <? else: ?> <?php echo LinkButton::createCancel(_('Abbrechen'), $controller->url_for('show/edit' . $scm->id)); ?> <? endif; ?> </td> </tr> </tfoot> </table> </form> <?php $sidebar = Sidebar::get(); $sidebar->setImage(Assets::image_path("sidebar/info-sidebar.png"));
echo '<?xml'; ?> version="1.0"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title><?php echo htmlReady(studip_utf8encode($title)); ?> </title> <link><?php echo htmlReady(studip_utf8encode($studip_url)); ?> </link> <image> <url><?php echo Assets::image_path('logos/logoklein.png'); ?> </url> <title><?php echo htmlReady(studip_utf8encode($title)); ?> </title> <link><?php echo htmlReady(studip_utf8encode($studip_url)); ?> </link> </image> <description><?php echo htmlReady(studip_utf8encode($description)); ?> </description>
function ScheduleWeekRequests($start_hour = '', $end_hour = '', $show_days = '', $start_date = '', $show_dates = true) { parent::ScheduleWeek($start_hour, $end_hour, $show_days, $start_date); $this->categories[5] = array("bg-picture" => Assets::image_path('calendar/category12_small.jpg'), "border-color" => "#d082b0"); $this->categories[6] = array("bg-picture" => Assets::image_path('calendar/category10_small.jpg'), "border-color" => "#ffbd33"); }
/** * Converts URLs in images so that the webserver can access them without proxy. * @param string $url of an image * @return string " src=\"".$converted_url."\"" */ protected function convertURL($url) { $convurl = $url; $url_elements = @parse_url($url); $url = $url_elements['path'] . '?' . $url_elements['query']; if (strpos(implode('#', $this->domains), $url_elements['host']) !== false) { if (strpos($url, 'dispatch.php/media_proxy?url=') !== false) { $targeturl = urldecode(substr($url, 4)); try { // is file in cache? if (!($metadata = $this->media_proxy->getMetaData($targeturl))) { $convurl = $targeturl; } else { $convurl = $this->config->getValue('MEDIA_CACHE_PATH') . '/' . md5($targeturl); } } catch (Exception $e) { $convurl = ''; } } else { if (stripos($url, 'dispatch.php/document/download') !== false) { if (preg_match('#([a-f0-9]{32})#', $url, $matches)) { $convurl = DirectoryEntry::find($matches[1])->file->getStorageObject()->getPath(); } } else { if (stripos($url, 'download') !== false || stripos($url, 'sendfile.php') !== false) { //// get file id if (preg_match('#([a-f0-9]{32})#', $url, $matches)) { $document = new StudipDocument($matches[1]); if ($document->checkAccess($GLOBALS['user']->id)) { $convurl = get_upload_file_path($matches[1]); } else { $convurl = Assets::image_path('messagebox/exception.png'); } } } } } } return 'src="' . $convurl . '"'; }
define("EVAL_PIC_REMOVE", Icon::create('trash', 'clickable')->asImagePath()); define("EVAL_PIC_EDIT", Icon::create('edit', 'clickable')->asImagePath()); define("EVAL_PIC_BACK", Icon::create('link-intern', 'clickable')->asImagePath()); define("EVAL_PIC_ARROW_TEMPLATE", Icon::create('arr_1right', 'clickable')->asImagePath()); define("EVAL_PIC_ARROW_TEMPLATE_OPEN", Icon::create('arr_1down', 'clickable')->asImagePath()); define("EVAL_PIC_ARROW_NEW", Icon::create('arr_1right', 'sort')->asImagePath()); define("EVAL_PIC_ARROW_NEW_OPEN", Icon::create('arr_1down', 'sort')->asImagePath()); define("EVAL_PIC_ARROW_RUNNING", Icon::create('arr_1right', 'accept')->asImagePath()); define("EVAL_PIC_ARROW_RUNNING_OPEN", Icon::create('arr_1down', 'accept')->asImagePath()); define("EVAL_PIC_ARROW_STOPPED", Icon::create('arr_1right', 'attention')->asImagePath()); define("EVAL_PIC_ARROW_STOPPED_OPEN", Icon::create('arr_1down', 'attention')->asImagePath()); define("EVAL_PIC_TREE_ARROW", Icon::create('arr_1right', 'clickable')->asImagePath()); define("EVAL_PIC_TREE_ARROW_ACTIVE", Icon::create('arr_1down', 'clickable')->asImagePath()); define("EVAL_PIC_TREE_BLANC", Assets::image_path('forumleer.gif')); define("EVAL_PIC_TREE_ROOT", Icon::create('vote', 'inactive')->asImagePath()); define("EVAL_PIC_TREE_GROUP", Assets::image_path('eval_group.gif')); define("EVAL_PIC_TREE_GROUP_FILLED", Assets::image_path('eval_group_filled.gif')); define("EVAL_PIC_TREE_QUESTIONGROUP", Assets::image_path('eval_qgroup.gif')); define("EVAL_PIC_TREE_QUESTIONGROUP_FILLED", Assets::image_path('eval_qgroup_filled.gif')); define("EVAL_PIC_EXPORT_FILE", Icon::create('file-xls', 'clickable')->asImagePath()); define("EVAL_PIC_YES", Icon::create('accept', 'accept')->asImagePath()); define("EVAL_PIC_NO", Icon::create('decline', 'attention')->asImagePath()); define("EVAL_PIC_SHARED", Icon::create('checkbox-checked', 'clickable')->asImagePath()); define("EVAL_PIC_NOTSHARED", Icon::create('checkbox-unchecked', 'clickable')->asImagePath()); /* -------------------------------------------------- end: picture constants */ /* CSS constants ----------------------------------------------------------- */ define("EVAL_CSS_SUCCESS", "eval_success"); define("EVAL_CSS_ERROR", "eval_error"); define("EVAL_CSS_INFO", "eval_info"); /* ------------------------------------------------------ end: css constants */ # ===================================================== end: define constants #
<div class="content_column"> <div class="timer"> <span class="time" data-timestamp="<?php echo (int) $posting['mkdate']; ?> "> <?php echo date("j.n.Y", $posting['mkdate']) == date("j.n.Y") ? sprintf(_("%s Uhr"), date("G:i", $posting['mkdate'])) : date("j.n.Y", $posting['mkdate']); ?> </span> <? if ($GLOBALS['perm']->have_studip_perm("tutor", $posting['Seminar_id']) or ($posting['user_id'] === $GLOBALS['user']->id)) : ?> <a href="#" class="edit" onClick="return false;" title="<?php echo _("Bearbeiten"); ?> " style="vertical-align: middle; opacity: 0.6; width: 14px; height:14px; display: inline-block; background: url('<?php echo Assets::image_path("icons/16/grey/tools.png"); ?> ') center center; background-position: center center;"></a> <? endif ?> </div> <div class="name"> <? if (!$author->isNew()) : ?> <a href="<?php echo URLHelper::getLink($author->getURL(), array(), true); ?> "> <? endif ?> <?php echo htmlReady($author_name); ?> <? if (!$author->isNew()) : ?>
<? # Lifter010: TODO use Studip\Button, Studip\LinkButton; ?> <? $cssSw = new CSSClassSwitcher(); $pos = 0; $style = "style=\"background-image: url('". Assets::image_path('forumstrich') ."');" ." background-position: right;" ." background-repeat: repeat-y;" ."\" "; if ($seminar_persons) : $width = '33%'; $indirect = true; else : $width = '50%'; $indirect = false; endif; ?> <tr> <? for($i = 0; $i < $indent; $i++) : ?> <td class="blank" width="10" align="right" <?php echo $followers[$i + 1] ? $style : ''; ?> ></td> <? endfor; ?> <? if ($has_child) : ?> <td class="blank" width="10" align="right" <?php echo $style;
/** * Returns an input tag using options as html attributes on the * tag, but with these special cases: * * * 'size' - Supplied as "X@Y", so "30@45" becomes width="30" and height="45" * * The source can be supplied as a... * * full path, like "/my_images/image.gif" * * file name, like "rss.png", that gets expanded to "/images/rss.png" * * file name without extension, like "logo", that gets expanded to "/images/logo.png" * * Do not use this to render icons. Use the more appropiate class * Icon for this. */ static function input($source, $opt = array()) { if (!$source) { return ''; } $parts = explode('/', $source); if (($pos = array_search('icons', $parts)) !== false) { $source = substr($source, 6); $source = preg_replace('/\\.png$/', '', $source); return Icon::create2($source, $opt)->render(Icon::SVG | Icon::INPUT); } $size = $opt['size']; $opt = Assets::parse_attributes($opt); $opt['src'] = Assets::image_path($source); $opt['type'] = 'image'; if (isset($size) && !isset($opt['width'])) { list($opt['width'], $opt['height']) = explode('@', $size, 2); unset($opt['size']); } return Assets::tag('input', $opt); }
/** * creates an td with an image * * @access private * @param string $pic the image * @return string the image */ function createLevelOutputTD($pic = "forumleer.gif") { $td = new HTML("td"); $td->addAttr("class", "blank"); $td->addAttr("background", Assets::image_path($pic)); $img = new HTMLempty("img"); $img->addAttr("width", "10"); $img->addAttr("height", "20"); $img->addAttr("src", Assets::image_path($pic)); $td->addContent($img); return $td->createContent(); }
" target="_blank"><img alt="Print" src="<?php echo Assets::image_path("icons/16/blue/print.png"); ?> " /> Druckansicht</a> <span> </span> <a href="pdf?gebaude=<?php echo $auswahl["gebaeude"]; ?> &von=<?php echo $auswahl["von"]; ?> &bis=<?php echo $auswahl["bis"]; ?> " target="_blank"><img alt="Print" src="<?php echo Assets::image_path("icons/16/blue/print.png"); ?> " /> Als PDF</a> </div> <table border="0" class="default" id="termine"> <thead> <tr> <th>Von</th> <th>Bis</th> <th>Raum</th> <th>Vorlesungstitel</th> <th>Dozent</th> </tr> </thead> <tbody>
<? endif ?> }); </script> <? endif ?> <table class="default nohover"> <tbody> <? $countAnswers = $vote->questionnaire->countAnswers() ?> <? foreach ($vote['questiondata']['options'] as $key => $option) : ?> <tr> <? $percentage = $countAnswers ? round((int) $results[$key] / $countAnswers * 100) : 0 ?> <td style="text-align: right; background-size: <?php echo $percentage; ?> % 100%; background-position: right center; background-image: url('<?php echo Assets::image_path("vote_lightgrey.png"); ?> '); background-repeat: no-repeat;" width="50%"> <strong><?php echo formatReady($option); ?> </strong> </td> <td style="white-space: nowrap;"> (<?php echo $percentage; ?> % | <?php echo (int) $results[$key]; ?>
function test_image_path_should_not_touch_absolute_paths() { $url = Assets::image_path('/some/logo.png'); $this->assertEquals(STATIC_ASSETS_URL . 'some/logo.png', $url); }
function localeUrl($filename, $category) { $path = sprintf('locale/%s/%s/%s', $GLOBALS['_language_path'], $category, $filename); return Assets::image_path($path); }
public function getLogoURL($absolute_url = false) { $firstimage = $this->images->first(); return $firstimage ? $firstimage->getURL($absolute_url) : Assets::image_path("icons/blue/plugin.svg"); }
function ShowRow($icon, $link, $titel, $zusatz, $level='', $lines='', $weitere, $new=FALSE, $open="close", $content=FALSE, $edit='', $breite="99%") { ?><table border=0 cellpadding=0 cellspacing=0 width="99%" align="center"> <tr> <td class="blank tree-indent" valign="top" nowrap><? if (!$content) $content=_("Keine Beschreibung"); //Struktur darstellen $striche = ""; for ($i=0;$i<$level;$i++) { if ($i==($level-1)) { if ($this->lines[$i+1]>1) $striche.= Assets::img('forumstrich3.gif'); //Kreuzung else $striche.= Assets::img('forumstrich2.gif'); //abknickend $this->lines[$i+1] -= 1; } else { if ($this->lines[$i+1]==0) $striche .= Assets::img('forumleer.gif'); //Leerzelle else $striche .= Assets::img('forumstrich.gif'); //Strich } } echo $striche; ?></td> <? //Kofzeile ausgeben printhead ($breite, 0, $link, $open, $new, $icon, $titel, $zusatz); ?> </tr> </table> <? //weiter zur Contentzeile if ($open=="open") { ?><table width="99%" cellpadding=0 cellspacing=0 border=0 align="center"> <tr> <? //wiederum Striche fuer Struktur ?><td class="blank" nowrap background="<?php echo Assets::image_path('forumleer.gif'); ?> "></td> <? $striche=''; if ($level) for ($i=1;$i<=$level;$i++) { if ($this->lines[$i]==0) { $striche.= "<td class=\"blank tree-indent\" nowrap background=\"" . Assets::image_path('forumleer.gif') . "\">"; $striche.= Assets::img('forumleer.gif'); $striche.= "</td>"; } else { $striche.= "<td class=\"blank tree-indent\" nowrap background=\"" . Assets::image_path('forumstrich.gif') . "\">"; $striche.= Assets::img('forumleer2.gif'); $striche.= "</td>"; } } if ($weitere) { $striche.= "<td class=\"blank tree-indent\" nowrap background=\"" . Assets::image_path('forumstrichgrau.gif') . "\">"; $striche.= Assets::img('forumleer.gif'); $striche.= "</td>"; } else { $striche.= "<td class=\"blank tree-indent\" nowrap background-color: #f3f5f8\">"; $striche.= Assets::img('forumleer.gif'); $striche.= "</td>"; } echo $striche; //Contenzeile ausgeben printcontent ($breite, FALSE, $content, $edit); ?> </tr> </table> <? } }
/** * Set the image for the active state of this navigation item. * If no active image is set, the normal image is used for the * active state. Additional HTML attributes can be passed using * the $options parameter (like 'style' or 'onclick'). * * @param Icon $image an instance of class Icon depicting this item * @param array $link_attributes additional link attributes */ public function setActiveImage($image, $link_attributes = []) { $this->active_image = $image; $this->setLinkAttributes($link_attributes); // DEPRECATED // TODO remove this case in v3.6 if (is_string($image)) { $this->active_image = Icon::create2(Assets::image_path($image)); } }
/** * Sets up the sidebar * * @param bool $user_section Adjust sidebar to user section? */ protected function setupSidebar($user_section = false) { // Basic info and layout $sidebar = Sidebar::Get(); $sidebar->setTitle(_('Konfiguration')); $sidebar->setImage(Assets::image_path('sidebar/admin-sidebar.png')); // Views $views = new ViewsWidget(); $views->addLink(_('Globale Konfiguration'), $this->url_for('admin/configuration/configuration'))->setActive(!$user_section); $views->addLink(_('Personenkonfiguration'), $this->url_for('admin/configuration/user_configuration'))->setActive($user_section); $sidebar->addWidget($views); // Add section selector when not in user mode if (!$user_section) { $options = array(); foreach (ConfigurationModel::getConfig() as $key => $value) { $options[$key] = $key ?: '- ' . _('Ohne Kategorie') . ' -'; } $widget = new SelectWidget(_('Anzeigefilter'), $this->url_for('admin/configuration/configuration'), 'section', 'get'); $widget->addElement(new SelectElement(-1, _('alle anzeigen'))); $widget->setOptions($options); $sidebar->addWidget($widget); } // Add specific searches (specific user when in user mode, keyword // otherwise) if ($user_section) { $search = new SearchWidget($this->url_for('admin/configuration/user_configuration')); $search->addNeedle(_('Person suchen'), 'user_id', true, new StandardSearch('user_id'), 'function () { $(this).closest("form").submit(); }'); } else { $search = new SearchWidget($this->url_for('admin/configuration/configuration')); $search->addNeedle(_('Suchbegriff'), 'needle', true); } $sidebar->addWidget($search); }
public function save_review_action($plugin_id) { if (!Request::isPost()) { throw new Exception("Wrong method, use POST."); } $this->marketplugin = MarketPlugin::find($plugin_id); if (!$this->marketplugin) { throw new Exception("Unknown plugin."); } $reviews = MarketReview::findBySQL("plugin_id = ? AND user_id = ?", array($plugin_id, $GLOBALS['user']->id)); if (count($reviews)) { $this->review = $reviews[0]; } else { $this->review = new MarketReview(); $this->review['plugin_id'] = $plugin_id; $this->review['user_id'] = $GLOBALS['user']->id; } $data = Request::getArray("data"); $this->review['review'] = trim($data['review']) ?: null; if ($data['rating'] <= 5 && $data['rating'] >= 0) { $this->review['rating'] = $data['rating']; } else { throw new Exception("Rating is not in accepted range."); } $this->review->store(); PersonalNotifications::add($this->marketplugin['user_id'], PluginEngine::getURL($this->plugin, array(), "presenting/details/" . $plugin_id), sprintf(_("Ihr Plugin %s wurde von %s bewertet."), $this->marketplugin['name'], get_fullname($GLOBALS['user']->id)), null, Assets::image_path("icons/blue/star.svg")); PageLayout::postMessage(MessageBox::success(_("Review/Bewertung wurde gespeichert."))); $this->redirect('presenting/details/' . $plugin_id); }
/** * Displays the body of a folder including the description, changeform, subfolder and files * */ function display_folder_body($folder_id, $open, $change, $move, $upload, $refresh=FALSE, $filelink="", $anchor_id, $level = 0) { global $_fullname_sql, $SessionSeminar, $SemUserStatus, $SessSemName, $user, $perm, $rechte, $countfolder; $db = DBManager::get(); //Einbinden einer Klasse, die Informationen über den ganzen Baum enthält $folder_tree = TreeAbstract::GetInstance('StudipDocumentTree', array('range_id' => $SessionSeminar)); //Hole alle Informationen, die es über $folder_id gibt $query = "SELECT ". $_fullname_sql['full'] ." AS fullname , username, folder_id, a.range_id, a.user_id, name, a.description, a.mkdate, a.chdate FROM folder a LEFT JOIN auth_user_md5 USING (user_id) LEFT JOIN user_info USING (user_id) WHERE a.folder_id = '$folder_id' ORDER BY a.name, a.chdate"; $result = $db->query($query)->fetch(); $document_count = doc_count($folder_id); $super_folder = $folder_tree->getNextSuperFolder($folder_id); $is_issue_folder = ((count($folder_tree->getParents($folder_id)) > 1) && IssueDB::isIssue($result["range_id"])); if ($is_issue_folder) { $dates_for_issue = IssueDB::getDatesforIssue($result['range_id']); } print "<table cellpadding=0 border=0 cellspacing=0 width=\"100%\">"; //Ausgabe der Optionen zu dem Ordner mit Beschreibung, Knöpfen und PiPaPo print "<tr>"; if ((($document_count > 0) || ($folder_tree->hasKids($folder_id))) && ($folder_tree->isReadable($folder_id))) { print "<td style=\"background-image: url(".Assets::image_path('datatree_grau.gif') . "); background-repeat: repeat-y;\">"; print Assets::img('datatree_grau.gif'); print "</td>"; } else { print "<td class=\"printcontent\"> </td>"; } print "<td width=100% class=\"printcontent\" style=\"font-align: center\">"; $content=''; if ($super_folder){ $content .= Icon::create('lock-locked', 'inactive')->asImg(['class' => 'texttop']) . ' ' . sprintf(_("Dieser Ordner ist nicht zugänglich, da der übergeordnete Ordner \"%s\" nicht lesbar oder nicht sichtbar ist!"), htmlReady($folder_tree->getValue($super_folder,'name'))) . '<hr>'; } if ($folder_tree->isExerciseFolder($folder_id)){ $content .= Icon::create('edit', 'inactive')->asImg(['class' => 'texttop']) . ' ' . _("Dieser Ordner ist ein Hausaufgabenordner. Es können nur Dateien eingestellt werden.") . (!$rechte ? _("Sie selbst haben folgende Dateien in diesen Ordner eingestellt:") . '<br><b>' . htmlReady(join('; ', get_user_documents_in_folder($folder_id, $GLOBALS['user']->id))).'</b>' : '') . '<hr>'; } if ($is_issue_folder) { $dates = array(); foreach ($dates_for_issue as $date) { $dates[] = strftime("%x", $date['date']); } $content .= _("Dieser Ordner ist ein themenbezogener Dateiordner."); if(count($dates)){ $content .= ' ' ._("Folgende Termine sind diesem Thema zugeordnet:") . '<br><b>' . htmlReady(join('; ', $dates)).'</b>'; } $content .= '<hr>'; } $is_group_folder = $folder_tree->isGroupFolder($folder_id); if ($is_group_folder){ $content .= sprintf( _('Dieser Ordner gehört der Gruppe <b>%s</b>. Nur Mitglieder dieser Gruppe können diesen Ordner sehen.' . ' Dieser Ordner kann nicht verschoben oder kopiert werden.'), htmlReady(GetStatusgruppeName($result["range_id"])) ) . '<hr>'; } //Contentbereich erstellen if ($change == $folder_id) { //Aenderungsmodus, zweiter Teil $content .= '<textarea name="change_description"' . ' style="width:98%" class="add_toolbar wysiwyg"' . ' aria-label="Beschreibung des Ordners eingeben"' . ' rows="3">' . formatReady($result["description"]) . '</textarea>'; if($rechte){ $content .= '<div>'; if ($folder_tree->permissions_activated){ $content.= "\n<label><input style=\"vertical-align:middle\" type=\"checkbox\" value=\"1\" ".($folder_tree->isReadable($folder_id) ? "CHECKED" : "" ) . " name=\"perm_read\"> "; $content.= '<b>r</b> - ' . _("Lesen (Dateien können heruntergeladen werden)"); $content.= "</label>\n<br><label><input style=\"vertical-align:middle\" type=\"checkbox\" value=\"1\" ".($folder_tree->isWritable($folder_id) ? "CHECKED" : "" ) . " name=\"perm_write\"> "; $content.= '<b>w</b> - ' . _("Schreiben (Dateien können heraufgeladen werden)"); $content.= "</label>\n<br><label><input style=\"vertical-align:middle\" type=\"checkbox\" value=\"1\" ".($folder_tree->isExecutable($folder_id) ? "CHECKED" : "" ) . " name=\"perm_exec\"> "; $content.= '<b>x</b> - ' . _("Sichtbarkeit (Ordner wird angezeigt)") . '</label>'; } if($level == 0 && $folder_tree->entity_type == 'sem'){ $content .= "\n<br><label><input style=\"vertical-align:middle\" type=\"checkbox\" value=\"1\" ".($folder_tree->checkCreateFolder($folder_id) ? "CHECKED" : "" ) . " name=\"perm_folder\"> "; $content .= '<b>f</b> - ' . _("Ordner erstellen (Alle Nutzer können Ordner erstellen)") . '</label>'; } $content .= '</div>'; } $content .= '<div class="button-group">'; $content .= Button::createAccept(_("Übernehmen")); $content .= Button::createCancel(_("Abbrechen"), "cancel"); $content .= '</div>'; $content.= "\n<input type=\"hidden\" name=\"open\" value=\"".$folder_id."_sc_\">"; $content.="\n<input type=\"hidden\" name=\"type\" value=\"1\">"; } elseif ($result["description"]) $content .= formatReady($result["description"]); else $content .= _("Keine Beschreibung vorhanden"); if ($move == $result["folder_id"]){ $content .= "<br>" . sprintf(_("Dieser Ordner wurde zum Verschieben / Kopieren markiert. Bitte wählen Sie das Einfügen-Symbol %s, um ihn in den gewünschten Ordner zu verschieben."), Icon::create('arr_2right', 'sort', ['title' => _("Klicken Sie auf dieses Symbol, um diesen Ordner in einen anderen Ordner einzufügen.")]))->asImg(); if ($rechte) { $content .= _("Wenn Sie den Ordner in eine andere Veranstaltung verschieben / kopieren möchten, wählen Sie die gewünschte Veranstaltung oben auf der Seite aus."); } } if ($upload == $folder_id) { $content .= form($refresh); } // Abfrage ob Dateilink eingeleitet if ($filelink == $folder_id) { $content .= link_item($folder_id); } $content.= "\n"; $edit=''; //Editbereich erstellen if (($change != $folder_id) && ($upload != $folder_id) && ($filelink != $folder_id)) { if ($perm->have_studip_perm('autor', $SessionSeminar) && $folder_tree->isWritable($folder_id, $user->id)) # Knopf: hochladen $edit .= LinkButton::create(_("Hochladen"), URLHelper::getURL("?open=".$folder_id."_u_&rand=".rand()."#anker")); # Knopf: Datei verlinken if ($rechte) { $edit .= LinkButton::create(_("Datei verlinken"), URLHelper::getURL("?open=".$folder_id."_l_&rand=".rand()."#anker")); } # Knopf: Ordner als ZIP if ($document_count && $folder_tree->isReadable($folder_id, $user->id)) { $edit .= LinkButton::create(_("Ordner als ZIP"), URLHelper::getURL("?folderzip=".$folder_id)); } if ($perm->have_studip_perm('autor', $SessionSeminar) && $folder_tree->checkCreateFolder($folder_id, $user->id)) { if ($folder_tree->isWritable($folder_id, $user->id) && !$folder_tree->isExerciseFolder($folder_id, $user->id)) { # Knopf: neuer Ordner $edit .= LinkButton::create(_("Neuer Ordner"), URLHelper::getURL("?open=".$folder_id."_n_#anker")); # Knopf: ZIP hochladen if ($rechte && get_config('ZIP_UPLOAD_ENABLE')) { $edit .= LinkButton::create(_("ZIP hochladen"), URLHelper::getURL("?open=".$folder_id."_z_&rand=".rand()."#anker")); } } # Knopf: löschen if ($rechte || ( !$document_count && $level !=0 && ( $folder_tree->isWritable($folder_id, $user->id) && $folder_tree->isWritable($folder_tree->getValue($folder_id, 'parent_id'), $user->id) && !$folder_tree->isExerciseFolder($folder_id, $user->id) ) ) ) { $edit .= LinkButton::create(_("Löschen"), URLHelper::getURL("?open=".$folder_id."_d_")); } # Knopf: bearbeiten if ($folder_tree->isWritable($folder_id, $user->id) && !$folder_tree->isExerciseFolder($folder_id, $user->id)) { $edit .= LinkButton::create(_("Bearbeiten"), URLHelper::getURL("?open=".$folder_id."_c_#anker")); } # verschieben if ( ($rechte && $result['range_id'] != $SessSemName[1]) || ( $level !=0 && ( $folder_tree->isWritable($folder_id, $user->id) && $folder_tree->isWritable($folder_tree->getValue($folder_id, 'parent_id'), $user->id) && !$folder_tree->isExerciseFolder($folder_id, $user->id) ) ) ) { if (!$is_issue_folder && !$is_group_folder) { $edit.= LinkButton::create(_("Verschieben"), URLHelper::getURL("?open=".$folder_id."_m_#anker")); } } # Knopf: kopieren if ($rechte || ( $level !=0 && !$folder_tree->isExerciseFolder($folder_id, $user->id) ) ) { if (!$is_issue_folder && !$is_group_folder) { $edit.= LinkButton::create(_("Kopieren"), URLHelper::getURL("?open=".$folder_id."_co_#anker")); } } } # Knopf: sortieren if ($rechte) { $edit .= LinkButton::create(_("Sortieren"), URLHelper::getURL("?open=".$folder_id."_az_#anker")); } } if (!$edit) $edit = ' '; print "<table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr>"; //Ordner-Content ausgeben printcontent ("99%", TRUE, $content, $edit); print "</tr></table>"; print "</td></tr>"; //Ein paar Überprüfungen, was eigentlich angezeigt werden soll: Dateien und Unterordner $folders_kids = $folder_tree->getKids($folder_id); $folders_kids = $db->query("SELECT folder_id " . "FROM folder " . "WHERE range_id = ".$db->quote($folder_id)." " . "ORDER BY priority ASC, name ASC")->fetchAll(); $hasrealkids = $folder_tree->hasKids($folder_id); if ( ((count($folders_kids)) || ($document_count > 0)) && (($rechte) || ($folder_tree->isExecutable($folder_id, $user->id))) ) { print "<tr>"; //Der Navigationsast nach unten print "<td class=\"tree-elbow-line\">" . Assets::img("datatree_3.gif") . "</td>"; //Mehrere Zeilen, die wiederum Dateien mit eventuellen Optionen sind. print "<td colspan=3>"; print "<div class=\"folder_container".($rechte ? " sortable" : "")."\" id=\"folder_subfolders_".$folder_id."\">"; //Unterordner darstellen: is_array($folders_kids) || $folders_kids = array(); $subfolders = array(); foreach ($folders_kids as $key => $unterordner) { if (($folder_tree->isExecutable($unterordner['folder_id'], $user->id)) || ($rechte)) { //bin ich Dozent oder Tutor? $subfolders[] = $unterordner['folder_id']; } } if ($subfolders) { foreach ($subfolders as $key => $subfolder) { $folder_pos = ((count($subfolders) > 1) ? (($key == 0) ? "top" : (($key == count($subfolders)-1) ? "bottom" : "middle")) : "alone"); display_folder($subfolder, $open, $change, $move, $upload, $refresh, $filelink, $anchor_id, $folder_pos, false); } } print "</div>"; //Dateien darstellen: $countfolder++; print "<div class=\"folder_container".($rechte ? " sortable" : "")."\" id=\"folder_".$folder_id."\">"; if (($rechte) || ($folder_tree->isReadable($folder_id, $user->id))) { $query = "SELECT a.*,". $_fullname_sql['full'] ." AS fullname, " . "username, " . "IF(IFNULL(a.name,'')='', a.filename,a.name) AS t_name " . "FROM dokumente a " . "LEFT JOIN auth_user_md5 USING (user_id) " . "LEFT JOIN user_info USING (user_id) " . "WHERE range_id = '".$result["folder_id"]."' " . "ORDER BY a.priority ASC, t_name ASC, a.chdate DESC "; $result2 = $db->query($query)->fetchAll(); foreach ($result2 as $key => $datei) { $file_pos = ((count($result2) > 1) ? (($key == 0) ? "top" : (($key == count($result2)-1) ? "bottom" : "middle")) : "alone"); display_file_line($datei, $folder_id, $open, $change, $move, $upload, FALSE, $refresh, $filelink, $anchor_id, $file_pos); } } print "</div>"; print "</td></tr>"; } print "</table>"; //Ende der zweiten Tabelle }