本文整理匯總了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();
}
示例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">»</a>', $id) . ' ' . $message;
}
$message .= '<div id="' . $id . '" class="hide"><br>' . $trace . '</div>';
return $message;
}
示例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();
}