Exemple #1
0
 /**
  * show the data in an input element for editing
  *
  * @return string
  */
 protected function getWriteDisplay()
 {
     $selectedOptionNames = explode(', ', $this->value);
     $output = Html::startTag('div', ['class' => $this->class]);
     $connectedClassName = $this->fieldinfo->getConnectedClass();
     /** @var BaseConnectionObject $connObj */
     $connObj = new $connectedClassName();
     $class = $connObj->getOtherClass($this->fieldinfo->getClass());
     $obj = Factory::createObject($class);
     $connectedFieldName = $this->fieldinfo->getFieldsOfConnectedClass();
     $table = DB::table($obj->getTable());
     $result = Finder::create($class)->find([$table->getColumn($connectedFieldName), $table->getColumn('LK')]);
     foreach ($result as $row) {
         $params = [];
         $params['value'] = $row['LK'];
         $params['type']  = 'checkbox';
         $params['class'] = 'checkbox';
         $params['name']  = $this->name . '[]';
         if (in_array($row[$connectedFieldName], $selectedOptionNames)) {
             $params['checked'] = 'checked';
         }
         $output .= Html::startTag('p') . Html::singleTag('input', $params) . " " . $row[$connectedFieldName] . Html::endTag('p');
     }
     $output .= Html::endTag('div');
     return $output;
 }
Exemple #2
0
    public function display(OutputDevice $od)
    {
        $od->addContent(Html::startTag('div', ['class' => 'leftNavigation']));
        foreach ($this->getNaviStructure() as $category => $entries) {
            $od->addContent(Html::startTag('h3') . $category . Html::endTag('h3'));
            $od->addContent(Html::startTag('div'));
            $od->addContent(Html::startTag('ul'));
            foreach ($entries as $entryName => $url) {
                $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$url", $entryName) . Html::endTag('li'));
            }
            $od->addContent(Html::endTag('ul'));
            $od->addContent(Html::endTag('div'));
        }
//        $od->addContent(Html::startTag('div', ['id' => 'leftNavigation']));
//        $od->addContent(Html::startTag('ul', ['id' => 'leftNavigation']));
//        foreach ($this->getNaviStructure() as $category => $content) {
//            if (is_string($content)) {
//                $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$content", $category) . Html::endTag('li'));
//                continue;
//            }
//            $od->addContent(Html::startTag('li') . $category);
//            $od->addContent(Html::startTag('ul'));
//            foreach ($content as $name => $url) {
//                $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$url", $name) . Html::endTag('li'));
//            }
//            $od->addContent(Html::endTag('ul'));
//            $od->addContent(Html::endTag('li'));
//        }
//        $od->addContent(Html::endTag('ul'));
//        $od->addContent('<br style="clear:both" />');

        $od->addContent(Html::endTag('div'));
    }
Exemple #3
0
 /**
  * display the header div
  *
  * @param OutputDevice $od
  */
 public function display(OutputDevice $od)
 {
     $od->addContent(Html::startTag('body'));
     $od->addContent(Html::startTag('div', array('class' => 'pageStructure')) . "\n");
     $od->addContent(Html::startTag('div', array('class' => $this->getCssClass())) . "\n");
     $od->addContent($this->getContent());
     $od->addContent(Html::endTag('div'));
 }
Exemple #4
0
 /**
  * starts the main content section of the page
  *
  * @param OutputDevice $od
  */
 public static function startMainContent(OutputDevice $od)
 {
     $od->addContent(Html::startTag('div', array('class' => 'mainContent', 'id' => 'mainContent')));
     $requestHelper = new RequestHelper();
     $ajaxMsg = $requestHelper->getParam('ajaxMsg');
     $od->addContent(Html::ajaxMsgDiv($ajaxMsg));
     $od->addContent(Html::loaderDiv());
 }
Exemple #5
0
 /**
  * display the footer section of the page
  *
  * @param OutputDevice $od
  */
 public function display(OutputDevice $od)
 {
     $od->addContent(Html::startTag('div', ['style' => 'clear:both']) . Html::endTag('div'));
     $od->addContent(Html::startTag('div', array('class' => $this->getCssClass())));
     $od->addContent($this->getContent());
     $od->addContent(Html::endTag('div'));
     $od->addContent(Html::endTag('div'));
     $od->addContent(Html::endTag('body'));
 }
Exemple #6
0
function exception_handler(Exception $exception) {
    $div = Html::startTag('div', array('id' => 'exceptionBox'));
    $div .= Html::startTag('p', array('class' => 'h3')) . TMS(BaseException::HEADLINE) . Html::endTag('p');
    $div .= Html::startTag('hr');
    $div .= $exception->getMessage();
    $div .= Html::endTag('div');
    print($div);
    if ($exception instanceof BaseException) {
        $exception->debugOut();
    }
}
Exemple #7
0
 /**
  * create a string for output with all header information
  *
  * @param OutputDevice $od
  */
 public function display(OutputDevice $od)
 {
     $header = $this->getDoctypeTag() . "\n";
     $header .= $this->getHtmlTag() . "\n";
     $header .= Html::startTag('head') . "\n";
     $header .= "\t" . $this->getEncodingTag() . "\n";
     $header .= "\t" . $this->getTitleTag() . "\n";
     $header .= "\t" . $this->getDescriptionTag() . "\n";
     $header .= "\t" . $this->getCSSLink();
     $header .= "\t" . $this->getScripts();
     $header .= Html::endTag('head') . "\n";
     $od->addContent($header);
 }
Exemple #8
0
    /**
     * @param $content
     * @return string
     */
    private function _shortenContent($content)
    {
        $contentParts = str_split($content, 400);
        $contentShow = $contentParts[0]
            . Html::startTag('span', ['class' => 'show'])
            . '... '
            . Html::url('#', 'mehr', ['class' => 'show'])
            . Html::endTag('span');

        $contentHide = Html::startTag('span', ['class' => 'hide'])
            . $contentParts[1]
            . Html::endTag('span');
        $content = $contentShow . $contentHide;
        return $content;
    }
Exemple #9
0
 protected function getWriteDisplay()
 {
     $fi = $this->fieldinfo;
     $class = $fi->getConnectedClass();
     $connectedField = $fi->getFieldsOfConnectedClass();
     $objs = Finder::create($class)->find();
     $output = Html::startTag('select', array('class' => $this->class, 'name' => $this->name));
     foreach ($objs as $obj) {
         $params = [];
         $actualFieldValue = $obj[$connectedField];
         if ($this->value == $actualFieldValue) {
             $params['selected'] = 'selected';
         }
         $params['value'] = $obj->getLogicalKey();
         $output .= Html::startTag('option', $params) . $actualFieldValue . Html::endTag('option');
     }
     $output .= Html::endTag('select');
     return $output;
 }
Exemple #10
0
    /**
     * show the data in n input element for editing
     *
     * @return string
     */
    protected function getWriteDisplay()
    {
        $params['name'] = $this->getName();
        if (!empty($this->id)) {
            $params['id'] = $this->id;

        }
        if (!empty($this->class)) {
            $params['class'] = $this->class;
        }
        $params['cols'] = $this->cols;
        $params['rows'] = $this->rows;

        $textArea = Html::startTag('textarea', $params);
        if (!empty($this->value)) {
            $textArea .= $this->getValue();
        }
        $textArea .= Html::endTag('textarea');
        return $textArea;

    }
Exemple #11
0
 public function label($name, $inputName, $attributes = array())
 {
     $id = "label_$inputName";
     $attributes = Html::extendAttributeIfExists('id', $id, $attributes);
     $attributes = Html::extendAttributeIfExists('class', 'label', $attributes);
     $label = Html::startTag('span', $attributes);
     $label .= $name;
     $label .= Html::endTag('span');
     return $label;
 }
Exemple #12
0
    public function toString()
    {
        $this->attributes['class'] = $this->cssClass;

        if (isset($this->cssID)) {
            $this->attributes['id'] = $this->cssID;
        }

        $table  = Html::startTag('table', $this->attributes);

        if (isset($this->headRow)) {
            $table .= Html::startTag('thead') . $this->headRow->toString() . Html::endTag('thead');
        }

        if (!empty($this->rows)) {
            $table .= Html::startTag('tbody');
            foreach ($this->rows as $row) {
                $table .= $row->toString();
            }
            $table .= Html::endTag('tbody');
        }

        $table .= Html::endTag('table');
        return $table;
    }
Exemple #13
0
 private function _displayEntry(NavigationEntry $entry)
 {
     $string = Html::startTag('li', array('class' => 'naviEntry', 'id' => "entryLK_{$entry->getLogicalKey()}"));
     $string .= Html::url(HTML_ROOT . $entry['url'], $entry['name']);
     $string .= Html::endTag('li');
     return $string;
 }
Exemple #14
0
 /**
  * show the data without input element, because editing is not possible
  *
  * @return string
  */
 protected function getReadOnlyDisplay()
 {
     return Html::startTag('div', array('class' => $this->class. ' formWidth' . $this->displayedLength)) . $this->value . " %" . Html::endTag('div');
 }
Exemple #15
0
 * User: Alex
 * Date: 12.01.2015
 * Time: 11:54
 */

require_once (dirname(__DIR__) . '/config.php');

$od = new OutputDevice();

base_ui_Site::displayHead($od);
base_ui_Site::displayTop($od);
base_ui_Site::displayNavigation($od);
base_ui_Site::startMainContent($od);

$rh = new RequestHelper();
$controllerClass = $rh->getParam('controller');

/** @var Controller $controller */
$controller = new $controllerClass();

$od->addContent(Html::startTag('h3'));
$od->addContent($controller->getPageTitle());
$od->addContent(Html::endTag('h3'));

$controller->display($od);

base_ui_Site::endMainContent($od);
base_ui_Site::displayBottom($od);

print $od->toString();
Exemple #16
0
    $gridScript = new base_js_JqGrid();
    $gridScript->setGetParams($requestHelper->getAllParams())->setRowNum(10);
    $gridScript->setGetParam('controller', 'base_ajax_search_Controller');
    $gridScript->setRowNum(25);

    $width = 0;
    foreach ($columnNames as $columnName) {
        $fi = $object->getFieldinfo($columnName);
        $width += $fi->getDisplayedLength();
        $dtObj = $fi->getDatatypeObject();
        $gridScript->setColModels($dtObj->getJSColModelElement());
        $colNames[] = $fi->getFieldLabel();
    }
    $gridScript->setColNames($colNames);
    $gridScript->setSortname('LK');
    $gridScript->setCaption($object->getDisplayName());

    $od->addContent($gridScript->toString());

    $table = new base_html_model_Table();
    $table->setId('searchTable');
    $od->addContent($table->toString());
    $od->addContent(Html::startTag('div', array('id' => 'navGrid')), Html::endTag('div'));

}

base_ui_Site::endMainContent($od);
base_ui_Site::displayBottom($od);

print $od->toString();
Exemple #17
0
    /**
     *
     */
    public function toString()
    {
        $this->attributes['class'] = $this->cssClass;

        if (isset($this->cssID)) {
            $this->attributes['id'] = $this->cssID;
        }

        $tr  = Html::startTag('tr', $this->attributes);
        foreach ($this->getCells() as $cell) {
            if ($this->rowType) {
                $cell->setCellType($this->rowType);
            }
            $tr .= $cell->toString();
        }
        $tr .= Html::endTag('tr');
        return $tr;
    }
Exemple #18
0
if (User::logout() == User::LOGOUT_SUCCESS) {
    header('location: ' . HTML_ROOT . '/index.php');
} else {
    $msg = (Html::startTag('p'));
    $msg .= ('Ausloggen war nicht möglich');
    $msg .= (Html::endTag('p'));
}

$od = new OutputDevice();

base_ui_Site::displayHead($od);
base_ui_Site::displayTop($od);
base_ui_Site::displayNavigation($od);
base_ui_Site::startMainContent($od);

$od->addContent(Html::startTag('h3'));
$od->addContent('Benutzer LogIn');
$od->addContent(Html::endTag('h3'));

print $od->toString();
$od->flush();

$od->addContent(Html::startTag('div', array('id' => 'ajaxMsg')) . Html::endTag('div'));
$od->addContent($msg);

base_ui_Site::endMainContent($od);
base_ui_Site::displayBottom($od);

print $od->toString();
Exemple #19
0
 protected function displayListEntries(OutputDevice $od)
 {
     $counter = 0;
     $actualState = array_search(strtolower(Configuration::get()->getEntry('configStep')), $this->_getSetupSteps());
     $entries = '';
     foreach ($this->getNavigationEntries() as $link) {
         $displayName = $link->getDisplayName();
         if ($counter < $actualState) {
             $class = self::STATE_FINISHED;
         } elseif ($counter == $actualState) {
             $class = self::STATE_EDIT;
         } else {
             $entries .= Html::startTag('li', array('class' => 'naviStep', 'id' => "naviStep_{$link->getControllerName()}"));
             $entries .= $displayName;
             $entries .= Html::endTag('li');
             $counter++;
             continue;
         }
         $attributes = array('class' => $class);
         $href = $link->getHtmlTag($attributes);
         $entries .= Html::startTag('li', array('class' => 'naviStep', 'id' => "naviStep_{$link->getControllerName()}"));
         $entries .= $href;
         $entries .= Html::endTag('li');
         $counter++;
     }
     $od->addContent($entries);
 }
Exemple #20
0
    private function _setFilterOptions()
    {
        $form = new base_html_model_Form();
        $output = $form->start('#', 'post', array('id' => 'tableOperations'));

        $output .= Html::startTag('div', array('class' => 'tableOperations'));
        $output .= Html::startTag('div', array('id' => 'sort'));
        $output .= 'Sortieren nach: ';
        $output .= "<select name='sort' onChange='this.form.submit()'>";
        foreach ($this->showColumns as $colName => $colLabel) {
            if ($colName == $this->controller->getFilterParam('sort')) {
                $output .= "<option value='$colName' selected>$colLabel</option>";
            } else {
                $output .= "<option value='$colName'>$colLabel</option>";
            }
        }
        $output .= '</select>';
        $output .= "<select name='direction' onChange='$(\"#tableOperations\").submit()'>";
        $output .= "<option value='" . base_database_Order::ASC . "'>aufsteigend</option>";
        $output .= "<option value='" . base_database_Order::DESC ."'";
        if ($this->controller->getFilterParam('direction') == base_database_Order::DESC) {
            $output .= ' selected';
        }
        $output .= ">absteigend</option>";
        $output .= "</select>";

        $output .= Html::endTag('div');

        $output .= Html::startTag('div', array('class' => 'numberOfData'));
        $output .= 'Einträge ';
        $output .= "<select name='limit' onChange='this.form.submit()'>";
        $limit = $this->controller->getFilterParam('limit');
        foreach (array(10, 25, 50, 100) as $number) {
            if ($number == $limit) {
                $output .= "<option value=$number selected='selected'>$number</option>";
            } else {
                $output .= "<option value=$number>$number</option>";
            }
        }
        $output .= "</select> ";
        $numPages = ceil($this->controller->countData() / $limit);
        $output .= "Seite: " . Html::singleTag('input', array('name' => 'page', 'id' => 'pager', 'size' => 1, 'value' => $this->controller->getFilterParam('page'))) . " / "
            . Html::startTag('span', array('id' => 'numPages')) . $numPages . Html::endTag('span');
        $output .= Html::endTag('div');
        $output .= Html::endTag('div');

        return $output;
    }
Exemple #21
0
            $cell->setContent($title);
            $row->addCell($cell);
        }
        $table->addHeadRow($row);

        $orderBox = Html::startTag('div', array('id' => 'order'));
        $orderBox .= Html::startTag('p', array('id' => 'orderHeadline')) . 'Warenkorb' . Html::endTag('p');
        $orderBox .= Html::startTag('div', array('id' => 'orderNoContent'))
            . 'Es wurden noch keine Waren ausgewählt'
            . Html::endTag('div');
        $orderBox .= Html::startTag('div', array('id' => 'orderContent'));
        $form = new base_html_model_Form();
        $orderBox .= $form->start('ajax.php?controller=medexchange_ajax_save_medorder_Controller', 'post', array('class' => 'ajaxForm'));
        $orderBox .= $table->toString();
        $orderBox .= Html::startTag('div', array('id' => 'totalAmount'))
            . "Gesamt:\t" . Html::startTag('span') . Html::endTag('span') . " €"
            . Html::endTag('div') . "<br />";
        $formElement = new base_form_element_Submit(new Fieldinfo('MedOffer'));
        $formElement->setName('submit');
        $formElement->setValue('Absenden');
        $orderBox .= $formElement->display();
        $orderBox .= $form->end();
        $orderBox .= Html::endTag('div');
        $orderBox .= Html::endTag('div');
        $od->addContent(
            $orderBox);
    }
}

base_ui_Site::endMainContent($od);
base_ui_Site::displayBottom($od);
Exemple #22
0
    public function toString()
    {
        $this->attributes['class'] = $this->cssClass;

        if (isset($this->colSpan)) {
            $this->attributes['colspan'] = $this->colSpan;
        }

        if (isset($this->rowSpan)) {
            $this->attributes['rowspan'] = $this->rowSpan;
        }

        if (isset($this->cssID)) {
            $this->attributes['id'] = $this->cssID;
        }

        $td  = Html::startTag($this->cellType, $this->attributes);
        $td .= $this->content;
        $td .= Html::endTag($this->cellType);

        return $td;
    }
Exemple #23
0
    public function showSubmit()
    {
            $save = '';
        if ($this->model->getDisplayMode() == DisplayClass::EDIT) {
            $save .= Html::startTag('div', ['id' => 'editButtons']);
            $action = $this->model->getAction() . '&referer=' . self::SAVE_AND_EDIT;
            $picture = Html::img('buttons/save.png', ['class' => 'button', 'id' => self::SAVE_AND_EDIT]);
//            $save .= Html::url($action, $picture, ['class' => 'submitLink', 'title' => 'Speichern und auf dieser Seite bleiben']);
            $save .= Html::url($action, 'Speichern', ['class' => 'submitLink', 'title' => 'Speichern und auf dieser Seite bleiben']);

            $action = $this->model->getAction() . '&referer=' . self::SAVE_AND_NEW;
            $picture = Html::img('buttons/save_add.png', ['class' => 'button', 'id' => self::SAVE_AND_NEW]);
//            $save .= Html::url($action, $picture, ['class' => 'submitLink', 'title' => 'Datensatz speichern und einen Neuen anlegen']);
            $save .= Html::url($action, 'Speichern und neu', ['class' => 'submitLink', 'title' => 'Datensatz speichern und einen Neuen anlegen']);

            $action = $this->model->getAction() . '&referer=' . self::SAVE_AND_SEARCH;
            $picture = Html::img('buttons/save_go.png', ['class' => 'button', 'id' => self::SAVE_AND_SEARCH]);
//            $save .= Html::url($action, $picture, ['class' => 'submitLink', 'title' => 'Speichern und zur Ergebnisliste']);
            $save .= Html::url($action, 'Speichern und zur Liste', ['class' => 'submitLink', 'title' => 'Speichern und zur Liste']);
            $save .= Html::endTag('div');
        }
        $save .= Html::endTag('form');
        return $save;
    }