Ejemplo n.º 1
0
 public function GetById($id)
 {
     $cat = new Kategorie();
     $catsdata = file('storage/category.txt');
     foreach ($catsdata as $catdata) {
         $catarray = explode(':', $catdata);
         if ($id == $catdata['0']) {
             $cat->setId($catdata['0']);
             $cat->setName($catdata['1']);
             return $cat;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 function produktAction()
 {
     $oRequest = $this->getRequest();
     $iProdukty = $oRequest->getParam('pro_id');
     $kategorie = new Kategorie();
     $this->view->kategorie = $kategorie->fetchAll();
     $iProdukty = $oRequest->getParam('pro_id');
     $oProdukty = new Produkty();
     $this->view->oProdukty = $oProdukty->find($iProdukty)->current();
     $strony = new Strony();
     $this->view->strony = $strony->fetchAll();
     $wtyczka = new Wtyczka();
     $this->view->wtyczka = $wtyczka->pobierzGalerie();
     $a = $this->view->wtyczka[0]['online'];
     $this->view->online = $a;
     $b = $this->view->wtyczka[0]['odnosnik'];
     $this->view->odnosnik = $b;
 }
Ejemplo n.º 3
0
 /**
  * Swaps the position of two categories
  *
  * @param String $id0 Id of the category to be swapped
  * @param String $id1 Id of the other category to be swapped
  */
 public function swap_action($id0, $id1)
 {
     $category0 = Kategorie::find($id0);
     $category1 = Kategorie::find($id1);
     $priorities = $category0->priority + $category1->priority;
     $category0->priority = $priorities - $category0->priority;
     $category1->priority = $priorities - $category1->priority;
     if ($category0->store() && $category1->store()) {
         $this->reportSuccess(_('Kategorien wurden neu geordnet'));
     } else {
         $this->reportError(_('Kategorien konnten nicht neu geordnet werden.'));
     }
     $this->redirect('settings/categories');
 }
Ejemplo n.º 4
0
<? use Studip\Button, Studip\LinkButton; ?>
<? if ($verify && $verify['action'] === 'delete'): ?>
<?php 
echo $controller->verifyDialog(sprintf(_('Möchten Sie wirklich die Kategorie "%s" löschen?'), Kategorie::find($verify['id'])->name), array('settings/categories/delete', $verify['id'], true), array('settings/categories'));
?>
<? endif; ?>

<? if (count($categories) === 0): ?>
<p class="info"><?php 
echo _('Es existieren zur Zeit keine eigenen Kategorien.');
?>
</p>
<? else: ?>
<form action="<?php 
echo $controller->url_for('settings/categories/store');
?>
" method="post" name="main_content">
    <?php 
echo CSRFProtection::tokenTag();
?>
    <input type="hidden" name="studipticket" value="<?php 
echo get_ticket();
?>
">

    <table class="default nohover">
        <colgroup>
            <col width="100px">
            <col>
            <col width="200px">
            <col width="100px">
Ejemplo n.º 5
0
 public function produktykategoriesubmitAction()
 {
     $oRequest = $this->getRequest();
     $oKategorie = new Kategorie();
     $oKategorie->dopiszDoKategorii($oRequest->getParam('kategorie'), $oRequest->getParam('id'));
     $this->_redirect('administrator/produkty');
 }
Ejemplo n.º 6
0
 /**
  * Entry point of the controller that displays all the information of the selected or current user
  * @return void
  */
 public function index_action()
 {
     // Template Index_Box for render-partials
     $layout = $GLOBALS['template_factory']->open('shared/content_box');
     $this->shared_box = $layout;
     // if he has not yet stored into user_info, he comes in with no values
     if ($this->current_user->mkdate === null) {
         $this->current_user->store();
     }
     if (get_config('NEWS_RSS_EXPORT_ENABLE')) {
         $news_author_id = StudipNews::GetRssIdFromUserId($this->current_user->user_id);
         if ($news_author_id) {
             PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => 'RSS', 'href' => 'rss.php?id=' . $news_author_id));
         }
     }
     // Get Avatar
     $this->avatar = Avatar::getAvatar($this->current_user->user_id)->getImageTag(Avatar::NORMAL);
     // GetScroreList
     if (get_config('SCORE_ENABLE')) {
         if ($this->current_user->user_id === $GLOBALS['user']->id || $this->current_user->score) {
             $this->score = Score::GetMyScore($this->current_user);
             $this->score_title = Score::getTitel($this->score, $this->current_user->geschlecht);
         }
     }
     // Additional user information
     $this->public_email = get_visible_email($this->current_user->user_id);
     $this->motto = $this->profile->getVisibilityValue('motto');
     $this->private_nr = $this->profile->getVisibilityValue('privatnr', 'private_phone');
     $this->private_cell = $this->profile->getVisibilityValue('privatcell', 'private_cell');
     $this->privadr = $this->profile->getVisibilityValue('privadr', 'privadr');
     $this->homepage = $this->profile->getVisibilityValue('Home', 'homepage');
     // skype informations
     if (get_config('ENABLE_SKYPE_INFO') && $this->profile->checkVisibility('skype_name')) {
         $this->skype_name = UserConfig::get($this->current_user->user_id)->SKYPE_NAME;
         $this->skype_status = UserConfig::get($this->current_user->user_id)->SKYPE_ONLINE_STATUS && $this->profile->checkVisibility('skype_online_status');
     }
     // get generic datafield entries
     $this->shortDatafields = $this->profile->getShortDatafields();
     $this->longDatafields = $this->profile->getLongDatafields();
     // get working station of an user (institutes)
     $this->institutes = $this->profile->getInstitutInformations();
     // get studying informations of an user
     if ($this->current_user->perms != 'dozent') {
         $study_institutes = UserModel::getUserInstitute($this->current_user->user_id, true);
         if (count($study_institutes) > 0 && $this->profile->checkVisibility('studying')) {
             $this->study_institutes = $study_institutes;
         }
     }
     if ($this->current_user->user_id == $this->user->user_id && $GLOBALS['has_denoted_fields']) {
         $this->has_denoted_fields = true;
     }
     // get kings informations
     if (Config::Get()->SCORE_ENABLE) {
         if ($this->current_user->user_id === $GLOBALS['user']->id || $this->current_user->score) {
             $kings = $this->profile->getKingsInformations();
             if ($kings != null) {
                 $this->kings = $kings;
             }
         }
     }
     $show_admin = $this->perm->have_perm('autor') && $this->user->user_id == $this->current_user->user_id || isDeputyEditAboutActivated() && isDeputy($this->user->user_id, $this->current_user->user_id, true);
     if ($this->profile->checkVisibility('news') or $show_admin === true) {
         $response = $this->relay('news/display/' . $this->current_user->user_id);
         $this->news = $response->body;
     }
     // calendar
     if (get_config('CALENDAR_ENABLE')) {
         if (!in_array($this->current_user->perms, words('admin root'))) {
             if ($this->profile->checkVisibility('termine')) {
                 $response = $this->relay('calendar/contentbox/display/' . $this->current_user->user_id);
                 $this->dates = $response->body;
             }
         }
     }
     // include and show votes and tests
     if (get_config('VOTE_ENABLE') && $this->profile->checkVisibility('votes')) {
         $response = $this->relay('questionnaire/widget/' . $this->current_user->user_id . "/user");
         $this->votes = $response->body;
     }
     // Hier werden Lebenslauf, Hobbys, Publikationen und Arbeitsschwerpunkte ausgegeben:
     $ausgabe_felder = array('lebenslauf' => _('Lebenslauf'), 'hobby' => _('Hobbys'), 'publi' => _('Publikationen'), 'schwerp' => _('Arbeitsschwerpunkte'));
     $ausgabe_inhalt = array();
     foreach ($ausgabe_felder as $key => $value) {
         if ($this->profile->checkVisibility($key)) {
             $ausgabe_inhalt[$value] = $this->current_user[$key];
         }
     }
     $this->ausgabe_inhalt = array_filter($ausgabe_inhalt);
     // Anzeige der Seminare, falls User = dozent
     if ($this->current_user['perms'] == 'dozent') {
         $this->seminare = array_filter($this->profile->getDozentSeminars());
     }
     // Hompageplugins
     $homepageplugins = PluginEngine::getPlugins('HomepagePlugin');
     foreach ($homepageplugins as $homepageplugin) {
         if ($homepageplugin->isActivated($this->current_user->user_id, 'user')) {
             // get homepageplugin tempaltes
             $template = $homepageplugin->getHomepageTemplate($this->current_user->user_id);
             // create output of the plugins
             if (!empty($template)) {
                 $render .= $template->render(null, $layout);
             }
             $layout->clear_attributes();
         }
     }
     $this->hompage_plugin = $render;
     // show literature info
     if (get_config('LITERATURE_ENABLE')) {
         $lit_list = StudipLitList::GetFormattedListsByRange($this->current_user->user_id);
         if ($this->current_user->user_id == $this->user->user_id) {
             $this->admin_url = 'dispatch.php/literature/edit_list.php?_range_id=self';
             $this->admin_title = _('Literaturlisten bearbeiten');
         }
         if ($this->profile->checkVisibility('literature')) {
             $this->show_lit = true;
             $this->lit_list = $lit_list;
         }
     }
     // get categories
     $category = Kategorie::findByUserId($this->current_user->user_id);
     foreach ($category as $cat) {
         $head = $cat->name;
         $body = $cat->content;
         unset($vis_text);
         if ($this->user->user_id == $this->current_user->user_id) {
             $vis_text .= ' ( ' . Visibility::getStateDescription('kat_' . $cat->kategorie_id) . ' )';
         }
         if ($this->profile->checkVisibility('kat_' . $cat->kategorie_id)) {
             $categories[$cat->kategorie_id]['head'] = $head;
             $categories[$cat->kategorie_id]['zusatz'] = $vis_text;
             $categories[$cat->kategorie_id]['content'] = $body;
         }
     }
     if (!empty($categories)) {
         $this->categories = array_filter($categories, function ($item) {
             return !empty($item['content']);
         });
     }
 }
Ejemplo n.º 7
0
 public static function DGParser($w, $l, $p = null)
 {
     if ($w == 0) {
         return "-";
     }
     $k = new Kategorie($w);
     return $k->getA() != null ? $k->getA()->name : "Kategorie unbekannt";
 }