protected function createControls()
 {
     $panel = new CaptionedPanelControl($this, 'panel');
     $panel->setCaption('Teilen von Dateien');
     $upload = new UploaderControl($panel);
     $upload->setAction('uploadShare');
     $upload->setNotify('medien');
     $size = "<?php echo round({me_groesse}/1024/1024,1); ?> MB";
     $sendLink = Configuration::get('site.url') . '/index.php/medien/get?token={me_token}';
     $send = "<a class='btn-xs btn-default' href='mailto:?body=" . $sendLink . "'><span class='glyphicon glyphicon-envelope'></span></a>";
     $editLink = Application::routing()->appLink('medien', 'editShare', array('id' => '{me_id}'));
     $edit = "<a class='btn-xs btn-default' href=" . $editLink . "><span class='glyphicon glyphicon-edit'></span></a>";
     $buttons = $send . $edit;
     $token = new InputTextboxControl(null);
     $token->setValue($sendLink)->addCssClass('input-sm');
     $valid = "<?php echo ((strtotime('{me_valid_until}')) < strtotime(date('d.m.Y'))) ? '<span style=\"color: red;\">Abgelaufen</span>' : '{me_valid_until}'; ?>";
     $downloads = "<?php echo '{me_downloads}' == '' ? 0 : {me_downloads}?>";
     $medien = new GridControl($panel, 'medien');
     $medien->setEntity(new Medien(), array('share' => 1));
     $medien->setDeleteAction('deleteMedien');
     $medien->createColumn(GridColumn::LINK, 'me_titel')->setAppLink('medien', 'editShare', array('id' => '{me_id}'));
     $medien->createColumn(GridColumn::FIELD, 'me_erweiterung')->setHeader('Typ');
     $medien->createColumn(GridColumn::FIELD, 'me_groesse', $size);
     $medien->createColumn(GridColumn::FIELD, 'me_token', $token->toHtml())->setHeader('Download-Link');
     $medien->createColumn(GridColumn::FIELD, 'me_downloads', $downloads);
     $medien->createColumn(GridColumn::FIELD, 'me_valid_until', $valid);
     $medien->createColumn(GridColumn::FIELD, 'me_titel', $buttons)->setHeader('');
     $medien->createColumn(GridColumn::DELETELINK);
     $hinweis = new CoreControls\HtmlControl($this);
     $hinweis->setInnerHtml("<span style='color: #AAA;'><b>Hinweis:</b> Abgelaufene Dateien werden nach 14 Tagen automatisch gelöscht.</span>");
 }
 protected function createControls()
 {
     $medien = $this->controller->kollektion->getMedien();
     $lView = new ListViewControl($this, 'lView');
     $lView->setSkin('
         <table class="table table-striped table-hover">
             <thead>
                 <tr>
                     <th>Dokument</th>
                     <th>Datum</th>
                     <th>Größe</th>
                 </tr>
             </thead>
             <tbody>
                 {controls}
             </tbody>
         </table>
     ');
     $lView->setItemSkin('
                 <tr>
                     <td><a href="' . Configuration::get('site.internalUrl') . '/medien/{me_kollektion}/{me_dateiname}">{me_titel}</a></td>
                     <td>{me_upload_am}</td>
                     <td><?php echo ceil({me_groesse} / 1024); ?> KB</td>
                 </tr>
     ');
     $lView->addItems($medien);
 }
 function __construct(Kollektion $kollektion, $options = null, $initialize = true, $error_messages = null)
 {
     $this->kollektionId = $kollektion->id;
     $this->options = array('user_dirs' => true, 'upload_dir' => Configuration::get('site.sharePath') . '/medien/', 'upload_url' => Configuration::get('site.url') . '/medien/', 'download_via_php' => 1, 'image_versions' => array());
     if ($options) {
         $this->options = $options + $this->options;
     }
     parent::__construct($this->options, $initialize, $error_messages);
 }
 protected function addMenuitems()
 {
     Logging::info('Bearbeite Menü');
     // TODO: Site dynamisieren
     $db = Database::getInstance();
     $db->query('select pa_link from pages where pa_site = 2 and pa_ausblenden = 0');
     while ($row = $db->fetch()) {
         if ($row['pa_link'] != '') {
             $link = Configuration::get('site.url') . '/' . rawurlencode($row['pa_link']);
             $this->addItem($link, 0.5, 'daily');
         }
     }
 }