当前位置: 首页>>代码示例>>PHP>>正文


PHP Ajax::toggle方法代码示例

本文整理汇总了PHP中Ajax::toggle方法的典型用法代码示例。如果您正苦于以下问题:PHP Ajax::toggle方法的具体用法?PHP Ajax::toggle怎么用?PHP Ajax::toggle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ajax的用法示例。


在下文中一共展示了Ajax::toggle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayContent

    /**
     * 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();
    }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:35,代码来源:class.RunalyzePluginPanel_Schuhe.php

示例2: formErrorMessage

 /**
  * 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;
 }
开发者ID:9x,项目名称:Runalyze,代码行数:38,代码来源:class.Error.php

示例3: displayContent

 /**
  * 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();
 }
开发者ID:Nugman,项目名称:Runalyze,代码行数:22,代码来源:class.RunalyzePluginPanel_Equipment.php


注:本文中的Ajax::toggle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。