/**
     * Display the content
     * @see PluginPanel::displayContent()
     */
    protected function displayContent()
    {
        echo $this->getStyle();
        echo '<div id="schuhe">';
        // TODO: Use data from shoe factory
        $inuse = true;
        $schuhe = DB::getInstance()->query('SELECT * FROM `' . PREFIX . 'shoe` WHERE accountid = ' . SessionAccountHandler::getId() . ' ORDER BY `inuse` DESC, `km` DESC')->fetchAll();
        foreach ($schuhe as $schuh) {
            $Shoe = new Shoe($schuh);
            if ($inuse && $Shoe->isInUse() == 0) {
                echo '<div id="hiddenschuhe" style="display:none;">';
                $inuse = false;
            }
            echo '<p style="position:relative;">
				<span class="right">' . $Shoe->getKmString() . '</span>
				<strong>' . ShoeFactory::getSearchLink($schuh['id']) . '</strong>
				' . $this->getShoeUsageImage($Shoe->getKm()) . '
			</p>';
        }
        if (empty($schuhe)) {
            echo HTML::em(__('You don\'t have any shoes'));
        }
        if (!$inuse) {
            echo '</div>';
        }
        echo '</div>';
        if (!$inuse) {
            echo Ajax::toggle('<a class="right" href="#schuhe" name="schuhe">' . __('Show unused shoes') . '</a>', 'hiddenschuhe');
        }
        echo HTML::clearBreak();
    }
Exemple #2
0
 /**
  * Form an error-message with backtrace-info
  * @param string $message
  * @param array $backtrace
  * @return string
  */
 private function formErrorMessage($message, $backtrace)
 {
     $id = md5($message);
     $trace = '';
     foreach ($backtrace as $i => $part) {
         if (!isset($part['args'])) {
             $args = '';
         } elseif (is_array($part['args'])) {
             $args = self::r_implode(', ', $part['args']);
         }
         $class = isset($part['class']) ? $part['class'] . '::' : '';
         $func = isset($part['function']) ? $part['function'] : '';
         if ($i != 0) {
             if (isset($part['file'])) {
                 $trace .= $part['file'];
                 if (isset($part['line'])) {
                     $trace .= '<small>::' . $part['line'] . '</small><br>';
                 }
             }
             $trace .= '<strong>' . $class . $func . '</strong>';
             $trace .= '<small>(' . $args . ')</small><br><br>' . NL;
         }
     }
     if (defined('RUNALYZE_TEST')) {
         return $message . NL . strip_tags(str_replace('<br>', ' ', $trace));
     }
     if (class_exists('Ajax')) {
         $message = Ajax::toggle('<a class="error" href="#errorInfo">&raquo;</a>', $id) . ' ' . $message;
     }
     $message .= '<div id="' . $id . '" class="hide"><br>' . $trace . '</div>';
     return $message;
 }
 /**
  * Display the content
  * @see PluginPanel::displayContent()
  */
 protected function displayContent()
 {
     $Factory = new Model\Factory(SessionAccountHandler::getId());
     $EquipmentType = $Factory->equipmentType((int) $this->Configuration()->value('type'));
     if ($EquipmentType->isEmpty()) {
         echo HTML::warning(__('Please choose an equipment type in the plugin configuration.'));
         return;
     }
     echo $this->getStyle();
     echo '<div id="equipment">';
     $inuse = true;
     $this->showListFor($EquipmentType, $inuse);
     echo '</div>';
     if (!$inuse) {
         echo Ajax::toggle('<a class="right" href="#equipment" name="equipment">' . __('Show unused equipment') . '</a>', 'hiddenequipment');
     }
     echo HTML::clearBreak();
 }