本文整理汇总了PHP中thebuggenie\core\framework\Context::getWebroot方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getWebroot方法的具体用法?PHP Context::getWebroot怎么用?PHP Context::getWebroot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Context
的用法示例。
在下文中一共展示了Context::getWebroot方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: format
?>
fonts/open_sans_bold.ttf') format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: bold;
src: url('<?php
echo \thebuggenie\core\framework\Context::getWebroot();
?>
fonts/open_sans_bold_italic.eot');
src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url('<?php
echo \thebuggenie\core\framework\Context::getWebroot();
?>
fonts/open_sans_bold_italic.woff') format('woff'), url('<?php
echo \thebuggenie\core\framework\Context::getWebroot();
?>
fonts/open_sans_bold_italic.ttf') format('truetype');
}
body { font-size: 12px; }
body, html, div, p, td, input { font-family: "Open Sans", arial; color: #555; }
h1, h2, h3, h4, h5 { text-shadow: none; border-bottom: 1px dotted #CCC; text-transform: uppercase; font-weight: normal; color: #888; }
h1 { font-size: 1.6em; }
h2 { font-size: 1.4em; margin-bottom: 8px; }
h3 { font-size: 1.2em; }
h4 { font-size: 1.1em; }
h5 { font-size: 1.05em; }
h2 .smaller { font-size: 0.9em; text-shadow: none; }
p { font-size: 1.1em; }
label { vertical-align: middle; font-weight: normal; font-size: 1em; }
示例2: mb_strtolower
echo mb_strtolower(str_replace('_', '-', \thebuggenie\core\framework\Context::getI18n()->getCurrentLanguage()));
?>
</language>
<image>
<?php
if (\thebuggenie\core\framework\Settings::isUsingCustomHeaderIcon() == '2') {
?>
<url><?php
echo \thebuggenie\core\framework\Settings::getHeaderIconURL();
?>
</url>
<?php
} elseif (\thebuggenie\core\framework\Settings::isUsingCustomHeaderIcon() == '1') {
?>
<url><?php
echo \thebuggenie\core\framework\Context::getUrlHost() . \thebuggenie\core\framework\Context::getWebroot() . 'header.png';
?>
</url>
<?php
} else {
?>
<url><?php
echo image_url('logo_24.png', false, null, false);
?>
</url>
<?php
}
?>
<title><?php
echo \thebuggenie\core\framework\Settings::getSiteHeaderName() . ' ~ ' . $searchtitle;
?>
示例3: getAvatarURL
/**
* Return the users avatar url
*
* @param boolean $small [optional] Whether to get the URL for the small avatar (default small)
*
* @return string an URL to put in an <img> tag
*/
public function getAvatarURL($small = true)
{
$event = \thebuggenie\core\framework\Event::createNew('core', 'self::getAvatarURL', $this)->trigger();
$url = $event->getReturnValue();
if ($url === null) {
if ($this->usesGravatar() && $this->getEmail()) {
$url = framework\Context::getScope()->isSecure() ? 'https://secure.gravatar.com/avatar/' : 'http://www.gravatar.com/avatar/';
$url .= md5(trim($this->getEmail())) . '.png?d=wavatar&s=';
$url .= $small ? 22 : 48;
} else {
$url = framework\Context::getWebroot() . 'avatars/' . $this->getAvatar();
if ($small) {
$url .= '_small';
}
$url .= '.png';
}
}
return $url;
}
示例4: image_tag
<header>
<div id="logo_container">
<?php
\thebuggenie\core\framework\Event::createNew('core', 'header_before_logo')->trigger();
?>
<span class="mobile_menuanchor" onclick="$('body').toggleClassName('mobile_leftmenu_visible');"> </span>
<?php
$link = \thebuggenie\core\framework\Settings::getHeaderLink() == '' ? \thebuggenie\core\framework\Context::getWebroot() : \thebuggenie\core\framework\Settings::getHeaderLink();
?>
<a class="logo" href="<?php
print $link;
?>
"><?php
echo image_tag(\thebuggenie\core\framework\Settings::getHeaderIconUrl(), array('style' => 'max-height: 24px;'), \thebuggenie\core\framework\Settings::isUsingCustomHeaderIcon());
?>
</a>
<div class="logo_name"><?php
echo \thebuggenie\core\framework\Settings::getSiteHeaderName();
?>
</div>
</div>
<?php
if (!\thebuggenie\core\framework\Settings::isMaintenanceModeEnabled()) {
?>
<div id="topmenu-container">
<?php
if (\thebuggenie\core\framework\Event::createNew('core', 'header_mainmenu_decider')->trigger()->getReturnValue() !== false) {
?>
<?php
require THEBUGGENIE_CORE_PATH . 'templates/headermainmenu.inc.php';
?>
示例5: image_submit_tag
/**
* Returns an <input type="image"> tag
*
* @param string $image image source
* @param array $params [optional] html parameters
* @param bool $notheme [optional] whether this is a themed image or a top level path
*
* @return string
*/
function image_submit_tag($image, $params = array(), $notheme = false)
{
$params['src'] = !$notheme ? \thebuggenie\core\framework\Context::getWebroot() . 'iconsets/' . Settings::getIconsetName() . '/' . $image : $image;
return '<input type="image" ' . parseHTMLoptions($params) . ' />';
}
示例6: runIssueRevertField
/**
* Reverts an issue field back to the original value
*
* @param \thebuggenie\core\framework\Request $request
*/
public function runIssueRevertField(framework\Request $request)
{
if ($issue_id = $request['issue_id']) {
try {
$issue = entities\Issue::getB2DBTable()->selectById($issue_id);
} catch (\Exception $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderText('fail');
}
} else {
$this->getResponse()->setHttpStatus(400);
return $this->renderText('no issue');
}
$field = null;
framework\Context::loadLibrary('common');
switch ($request['field']) {
case 'description':
$issue->revertDescription();
$issue->revertDescription_Syntax();
$field = array('id' => (int) ($issue->getDescription() != ''), 'name' => $issue->getParsedDescription(array('issue' => $issue)), 'form_value' => $issue->getDescription());
break;
case 'reproduction_steps':
$issue->revertReproduction_Steps();
$issue->revertReproduction_Steps_Syntax();
$field = array('id' => (int) ($issue->getReproductionSteps() != ''), 'name' => $issue->getParsedReproductionSteps(array('issue' => $issue)), 'form_value' => $issue->getReproductionSteps());
break;
case 'title':
$issue->revertTitle();
$field = array('id' => 1, 'name' => strip_tags($issue->getTitle()));
break;
case 'shortname':
$issue->revertShortname();
$field = array('id' => 1, 'name' => strip_tags($issue->getShortname()));
break;
case 'category':
$issue->revertCategory();
$field = $issue->getCategory() instanceof entities\Category ? array('id' => $issue->getCategory()->getID(), 'name' => $issue->getCategory()->getName()) : array('id' => 0);
break;
case 'resolution':
$issue->revertResolution();
$field = $issue->getResolution() instanceof entities\Resolution ? array('id' => $issue->getResolution()->getID(), 'name' => $issue->getResolution()->getName()) : array('id' => 0);
break;
case 'severity':
$issue->revertSeverity();
$field = $issue->getSeverity() instanceof entities\Severity ? array('id' => $issue->getSeverity()->getID(), 'name' => $issue->getSeverity()->getName()) : array('id' => 0);
break;
case 'reproducability':
$issue->revertReproducability();
$field = $issue->getReproducability() instanceof entities\Reproducability ? array('id' => $issue->getReproducability()->getID(), 'name' => $issue->getReproducability()->getName()) : array('id' => 0);
break;
case 'priority':
$issue->revertPriority();
$field = $issue->getPriority() instanceof entities\Priority ? array('id' => $issue->getPriority()->getID(), 'name' => $issue->getPriority()->getName()) : array('id' => 0);
break;
case 'percent_complete':
$issue->revertPercentCompleted();
$field = $issue->getPercentCompleted();
break;
case 'status':
$issue->revertStatus();
$field = $issue->getStatus() instanceof entities\Status ? array('id' => $issue->getStatus()->getID(), 'name' => $issue->getStatus()->getName(), 'color' => $issue->getStatus()->getColor()) : array('id' => 0);
break;
case 'pain_bug_type':
$issue->revertPainBugType();
$field = $issue->hasPainBugType() ? array('id' => $issue->getPainBugType(), 'name' => $issue->getPainBugTypeLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
break;
case 'pain_likelihood':
$issue->revertPainLikelihood();
$field = $issue->hasPainLikelihood() ? array('id' => $issue->getPainLikelihood(), 'name' => $issue->getPainLikelihoodLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
break;
case 'pain_effect':
$issue->revertPainEffect();
$field = $issue->hasPainEffect() ? array('id' => $issue->getPainEffect(), 'name' => $issue->getPainEffectLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
break;
case 'issuetype':
$issue->revertIssuetype();
$field = $issue->getIssuetype() instanceof entities\Issuetype ? array('id' => $issue->getIssuetype()->getID(), 'name' => $issue->getIssuetype()->getName(), 'src' => htmlspecialchars(framework\Context::getWebroot() . 'images/' . $issue->getIssuetype()->getIcon() . '_small.png')) : array('id' => 0);
$visible_fields = $issue->getIssuetype() instanceof entities\Issuetype ? $issue->getProject()->getVisibleFieldsArray($issue->getIssuetype()->getID()) : array();
return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $field, 'visible_fields' => $visible_fields));
break;
case 'milestone':
$issue->revertMilestone();
$field = $issue->getMilestone() instanceof entities\Milestone ? array('id' => $issue->getMilestone()->getID(), 'name' => $issue->getMilestone()->getName()) : array('id' => 0);
break;
case 'estimated_time':
$issue->revertEstimatedTime();
return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $issue->hasEstimatedTime() ? array('id' => 1, 'name' => entities\Issue::getFormattedTime($issue->getEstimatedTime(true, true))) : array('id' => 0), 'values' => $issue->getEstimatedTime(true, true), 'percentbar' => $this->getComponentHTML('main/percentbar', array('percent' => $issue->getEstimatedPercentCompleted(), 'height' => 3))));
break;
case 'spent_time':
$issue->revertSpentTime();
return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $issue->hasSpentTime() ? array('id' => 1, 'name' => entities\Issue::getFormattedTime($issue->getSpentTime(true, true))) : array('id' => 0), 'values' => $issue->getSpentTime(true, true)));
break;
case 'owned_by':
$issue->revertOwner();
return $this->renderJSON(array('changed' => $issue->isOwnerChanged(), 'field' => $issue->isOwned() ? array('id' => $issue->getOwner()->getID(), 'name' => $issue->getOwner() instanceof entities\User ? $this->getComponentHTML('main/userdropdown', array('user' => $issue->getOwner())) : $this->getComponentHTML('main/teamdropdown', array('team' => $issue->getOwner()))) : array('id' => 0)));
//.........这里部分代码省略.........
示例7: runStatus
public function runStatus(framework\Request $request)
{
$status_info = array('api_version' => $this->getApiVersion(), 'version' => framework\Settings::getVersion(), 'version_long' => framework\Settings::getVersion(true, true), 'site_name' => framework\Settings::getSiteHeaderName(), 'host' => framework\Settings::getURLhost(), 'urls' => array('site' => framework\Settings::getHeaderLink() == '' ? framework\Context::getWebroot() : framework\Settings::getHeaderLink(), 'logo' => framework\Settings::getHeaderIconURL(), 'icon' => framework\Settings::getFaviconURL()), 'online' => !(bool) framework\Settings::isMaintenanceModeEnabled());
if (framework\Settings::hasMaintenanceMessage()) {
$status_info['maintenance_msg'] = framework\Settings::getMaintenanceMessage();
}
$this->status_info = $status_info;
}