本文整理汇总了PHP中TBGContext::getTBGPath方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGContext::getTBGPath方法的具体用法?PHP TBGContext::getTBGPath怎么用?PHP TBGContext::getTBGPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGContext
的用法示例。
在下文中一共展示了TBGContext::getTBGPath方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
?>
<a class="logo" href="<?php
print $link;
?>
"><img src="<?php
print TBGSettings::getHeaderIconURL();
?>
" alt="[logo]" title="[logo]"></a>
<?php
} elseif (TBGSettings::isUsingCustomHeaderIcon() == TBGSettings::APPEARANCE_HEADER_CUSTOM) {
?>
<a class="logo" href="<?php
print $link;
?>
"><img src="<?php
print TBGContext::getTBGPath();
?>
header.png" alt="[logo]" title="[logo]"></a>
<?php
} else {
?>
<a class="logo" href="<?php
print $link;
?>
"><?php
echo image_tag('logo_24.png', array('alt' => '[logo]', 'title' => '[logo]'));
?>
</a>
<?php
}
?>
示例2: image_tag
<header>
<div id="logo_container">
<?php
TBGEvent::createNew('core', 'header_before_logo')->trigger();
?>
<?php
$link = TBGSettings::getHeaderLink() == '' ? TBGContext::getTBGPath() : TBGSettings::getHeaderLink();
?>
<a class="logo" href="<?php
print $link;
?>
"><?php
echo image_tag(TBGSettings::getHeaderIconUrl(), array('style' => 'max-height: 24px;'), TBGSettings::isUsingCustomHeaderIcon());
?>
</a>
<div class="logo_name"><?php
echo TBGSettings::getTBGname();
?>
</div>
</div>
<?php
if (!TBGSettings::isMaintenanceModeEnabled()) {
?>
<?php
if (TBGEvent::createNew('core', 'header_mainmenu_decider')->trigger()->getReturnValue() !== false) {
?>
<?php
require THEBUGGENIE_CORE_PATH . 'templates/headermainmenu.inc.php';
?>
<?php
}
示例3: mb_strtolower
echo mb_strtolower(str_replace('_', '-', TBGContext::getI18n()->getCurrentLanguage()));
?>
</language>
<image>
<?php
if (TBGSettings::isUsingCustomHeaderIcon() == '2') {
?>
<url><?php
echo TBGSettings::getHeaderIconURL();
?>
</url>
<?php
} elseif (TBGSettings::isUsingCustomHeaderIcon() == '1') {
?>
<url><?php
echo TBGContext::getUrlHost() . TBGContext::getTBGPath() . 'header.png';
?>
</url>
<?php
} else {
?>
<url><?php
echo image_url('logo_24.png', false, null, false);
?>
</url>
<?php
}
?>
<title><?php
echo TBGSettings::getTBGname() . ' ~ ' . $searchtitle;
?>
示例4:
.rounded_box h4 { margin-bottom: 0px; margin-top: 7px; font-size: 14px; }
.error_content { padding: 10px; }
.description { padding: 3px 3px 3px 0;}
pre { overflow: scroll; padding: 5px; }
.command_box { border: 1px dashed #DDD; background-color: #F5F5F5; padding: 4px; font-family: 'Droid Sans Mono', monospace; display: inline-block; margin-top: 5px; margin-bottom: 15px; }
</style>
<!--[if IE]>
<style>
body { background-color: #DFDFDF; font-family: sans-serif; font-size: 13px; }
</style>
<![endif]-->
</head>
<body>
<div class="rounded_box" style="margin: 30px auto 0 auto; width: 700px;">
<img style="float: left; margin: 10px;" src="<?php
echo TBGContext::getTBGPath();
?>
header.png"><h1>An error occurred in <?php
echo TBGSettings::getTBGname();
?>
</h1>
<div class="error_content">
<?php
if (isset($exception) && $exception instanceof Exception) {
?>
<?php
if ($exception instanceof TBGComposerException) {
?>
<h2>External libraries not initialized</h2>
<p>
The Bug Genie uses the <a href="http://getcomposer.org">composer</a> dependency management tool to control external libraries.<br>
示例5: 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 = TBGEvent::createNew('core', 'TBGUser::getAvatarURL', $this)->trigger();
$url = $event->getReturnValue();
if ($url === null) {
if ($this->usesGravatar() && $this->getEmail()) {
$url = TBGContext::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 = TBGContext::getTBGPath() . 'avatars/' . $this->getAvatar();
if ($small) {
$url .= '_small';
}
$url .= '.png';
}
}
return $url;
}
示例6: deleteCookie
/**
* Deletes a cookie on the client
*
* @param $key string the cookie key to delete
*
* @return bool
*/
public function deleteCookie($key)
{
setcookie($key, '', NOW - 36000, TBGContext::getTBGPath());
return true;
}
示例7: runIssueRevertField
/**
* Reverts an issue field back to the original value
*
* @param TBGRequest $request
*/
public function runIssueRevertField(TBGRequest $request)
{
if ($issue_id = $request['issue_id']) {
try {
$issue = TBGContext::factory()->TBGIssue($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;
TBGContext::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 'category':
$issue->revertCategory();
$field = $issue->getCategory() instanceof TBGCategory ? array('id' => $issue->getCategory()->getID(), 'name' => $issue->getCategory()->getName()) : array('id' => 0);
break;
case 'resolution':
$issue->revertResolution();
$field = $issue->getResolution() instanceof TBGResolution ? array('id' => $issue->getResolution()->getID(), 'name' => $issue->getResolution()->getName()) : array('id' => 0);
break;
case 'severity':
$issue->revertSeverity();
$field = $issue->getSeverity() instanceof TBGSeverity ? array('id' => $issue->getSeverity()->getID(), 'name' => $issue->getSeverity()->getName()) : array('id' => 0);
break;
case 'reproducability':
$issue->revertReproducability();
$field = $issue->getReproducability() instanceof TBGReproducability ? array('id' => $issue->getReproducability()->getID(), 'name' => $issue->getReproducability()->getName()) : array('id' => 0);
break;
case 'priority':
$issue->revertPriority();
$field = $issue->getPriority() instanceof TBGPriority ? 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 TBGStatus ? 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 TBGIssuetype ? array('id' => $issue->getIssuetype()->getID(), 'name' => $issue->getIssuetype()->getName(), 'src' => htmlspecialchars(TBGContext::getTBGPath() . 'iconsets/' . TBGSettings::getThemeName() . '/' . $issue->getIssuetype()->getIcon() . '_small.png')) : array('id' => 0);
$visible_fields = $issue->getIssuetype() instanceof TBGIssuetype ? $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 TBGMilestone ? 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' => TBGIssue::getFormattedTime($issue->getEstimatedTime())) : array('id' => 0), 'values' => $issue->getEstimatedTime()));
break;
case 'spent_time':
$issue->revertSpentTime();
return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $issue->hasSpentTime() ? array('id' => 1, 'name' => TBGIssue::getFormattedTime($issue->getSpentTime())) : array('id' => 0), 'values' => $issue->getSpentTime()));
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 TBGUser ? $this->getComponentHTML('main/userdropdown', array('user' => $issue->getOwner())) : $this->getComponentHTML('main/teamdropdown', array('team' => $issue->getOwner()))) : array('id' => 0)));
break;
case 'assigned_to':
$issue->revertAssignee();
return $this->renderJSON(array('changed' => $issue->isAssigneeChanged(), 'field' => $issue->isAssigned() ? array('id' => $issue->getAssignee()->getID(), 'name' => $issue->getAssignee() instanceof TBGUser ? $this->getComponentHTML('main/userdropdown', array('user' => $issue->getAssignee())) : $this->getComponentHTML('main/teamdropdown', array('team' => $issue->getAssignee()))) : array('id' => 0)));
//.........这里部分代码省略.........
示例8: tbg_exception
/**
* Displays a nicely formatted exception message
*
* @param string $title
* @param Exception $exception
*/
function tbg_exception($title, $exception)
{
if (TBGContext::getRequest() instanceof TBGRequest && TBGContext::getRequest()->isAjaxCall()) {
TBGContext::getResponse()->ajaxResponseText(404, $title);
}
$ob_status = ob_get_status();
if (!empty($ob_status) && $ob_status['status'] != PHP_OUTPUT_HANDLER_END) {
ob_end_clean();
}
if (TBGContext::isCLI()) {
$trace_elements = null;
if ($exception instanceof Exception) {
if ($exception instanceof TBGActionNotFoundException) {
TBGCliCommand::cli_echo("Could not find the specified action\n", 'white', 'bold');
} elseif ($exception instanceof TBGTemplateNotFoundException) {
TBGCliCommand::cli_echo("Could not find the template file for the specified action\n", 'white', 'bold');
} elseif ($exception instanceof B2DBException) {
TBGCliCommand::cli_echo("An exception was thrown in the B2DB framework\n", 'white', 'bold');
} else {
TBGCliCommand::cli_echo("An unhandled exception occurred:\n", 'white', 'bold');
}
echo TBGCliCommand::cli_echo($exception->getMessage(), 'red', 'bold') . "\n";
echo "\n";
TBGCliCommand::cli_echo('Stack trace') . ":\n";
$trace_elements = $exception->getTrace();
} else {
if ($exception['code'] == 8) {
TBGCliCommand::cli_echo('The following notice has stopped further execution:', 'white', 'bold');
} else {
TBGCliCommand::cli_echo('The following error occured:', 'white', 'bold');
}
echo "\n";
echo "\n";
TBGCliCommand::cli_echo($title, 'red', 'bold');
echo "\n";
TBGCliCommand::cli_echo("occured in\n");
TBGCliCommand::cli_echo($exception['file'] . ', line ' . $exception['line'], 'blue', 'bold');
echo "\n";
echo "\n";
TBGCliCommand::cli_echo("Backtrace:\n", 'white', 'bold');
$trace_elements = debug_backtrace();
}
foreach ($trace_elements as $trace_element) {
if (array_key_exists('class', $trace_element)) {
TBGCliCommand::cli_echo($trace_element['class'] . $trace_element['type'] . $trace_element['function'] . '()');
} elseif (array_key_exists('function', $trace_element)) {
if (in_array($trace_element['function'], array('tbg_error_handler', 'tbg_exception'))) {
continue;
}
TBGCliCommand::cli_echo($trace_element['function'] . '()');
} else {
TBGCliCommand::cli_echo('unknown function');
}
echo "\n";
if (array_key_exists('file', $trace_element)) {
TBGCliCommand::cli_echo($trace_element['file'] . ', line ' . $trace_element['line'], 'blue', 'bold');
} else {
TBGCliCommand::cli_echo('unknown file', 'red', 'bold');
}
echo "\n";
}
if (class_exists('B2DB')) {
echo "\n";
TBGCliCommand::cli_echo("SQL queries:\n", 'white', 'bold');
try {
$cc = 1;
foreach (B2DB::getSQLHits() as $details) {
TBGCliCommand::cli_echo("(" . $cc++ . ") [");
$str = $details['time'] >= 1 ? round($details['time'], 2) . ' seconds' : round($details['time'] * 1000, 1) . 'ms';
TBGCliCommand::cli_echo($str);
TBGCliCommand::cli_echo("] from ");
TBGCliCommand::cli_echo($details['filename'], 'blue');
TBGCliCommand::cli_echo(", line ");
TBGCliCommand::cli_echo($details['line'], 'white', 'bold');
TBGCliCommand::cli_echo(":\n");
TBGCliCommand::cli_echo("{$details['sql']}\n");
}
echo "\n";
} catch (Exception $e) {
TBGCliCommand::cli_echo("Could not generate query list (there may be no database connection)", "red", "bold");
}
}
echo "\n";
die;
}
echo "\n\t\t<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\t\t<html>\n\t\t<head>\n\t\t<style>\n\t\tbody { background-color: #DFDFDF; font-family: \"Droid Sans\", \"Trebuchet MS\", \"Liberation Sans\", \"Nimbus Sans L\", \"Luxi Sans\", Verdana, sans-serif; font-size: 13px; }\n\t\th1 { margin: 5px 0 0 0; font-size: 19px; }\n\t\th2 { margin: 0 0 15px 0; font-size: 16px; }\n\t\th3 { margin: 15px 0 0 0; font-size: 14px; }\n\t\tinput[type=\"text\"], input[type=\"password\"] { float: left; margin-right: 15px; }\n\t\tlabel { float: left; font-weight: bold; margin-right: 5px; display: block; width: 150px; }\n\t\tlabel span { font-weight: normal; color: #888; }\n\t\t.rounded_box {background: transparent; margin:0px;}\n\t\t.rounded_box h4 { margin-bottom: 0px; margin-top: 7px; font-size: 14px; }\n\t\t.xtop, .xbottom {display:block; background:transparent; font-size:1px;}\n\t\t.xb1, .xb2, .xb3, .xb4 {display:block; overflow:hidden;}\n\t\t.xb1, .xb2, .xb3 {height:1px;}\n\t\t.xb2, .xb3, .xb4 {background:#F9F9F9; border-left:1px solid #CCC; border-right:1px solid #CCC;}\n\t\t.xb1 {margin:0 5px; background:#CCC;}\n\t\t.xb2 {margin:0 3px; border-width:0 2px;}\n\t\t.xb3 {margin:0 2px;}\n\t\t.xb4 {height:2px; margin:0 1px;}\n\t\t.xboxcontent {display:block; background:#F9F9F9; border:0 solid #CCC; border-width:0 1px; padding: 0 5px 0 5px;}\n\t\t.xboxcontent table td.description { padding: 3px 3px 3px 0;}\n\t\t.white .xb2, .white .xb3, .white .xb4 { background: #FFF; border-color: #CCC; }\n\t\t.white .xb1 { background: #CCC; }\n\t\t.white .xboxcontent { background: #FFF; border-color: #CCC; }\n\t\tpre { overflow: scroll; padding: 5px; }\n\t\t</style>\n\t\t<!--[if IE]>\n\t\t<style>\n\t\tbody { background-color: #DFDFDF; font-family: sans-serif; font-size: 13px; }\n\t\t</style>\n\t\t<![endif]-->\n\t\t</head>\n\t\t<body>\n\t\t<div class=\"rounded_box white\" style=\"margin: 30px auto 0 auto; width: 700px;\">\n\t\t\t<b class=\"xtop\"><b class=\"xb1\"></b><b class=\"xb2\"></b><b class=\"xb3\"></b><b class=\"xb4\"></b></b>\n\t\t\t<div class=\"xboxcontent\" style=\"vertical-align: middle; padding: 10px 10px 10px 15px;\">\n\t\t\t<img style=\"float: left; margin-right: 10px;\" src=\"" . TBGContext::getTBGPath() . "header.png\"><h1>An error occured in The Bug Genie</h1>";
echo "<h2>{$title}</h2>";
$report_description = null;
if ($exception instanceof Exception) {
if ($exception instanceof TBGActionNotFoundException) {
echo "<h3>Could not find the specified action</h3>";
$report_description = "Could not find the specified action";
} elseif ($exception instanceof TBGTemplateNotFoundException) {
echo "<h3>Could not find the template file for the specified action</h3>";
//.........这里部分代码省略.........
示例9: 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 ? TBGContext::getTBGPath() . 'iconsets/' . TBGSettings::getIconsetName() . '/' . $image : $image;
return '<input type="image" ' . parseHTMLoptions($params) . ' />';
}
示例10: 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)
{
$url = '';
if ($this->usesGravatar()) {
$url = 'http://www.gravatar.com/avatar/' . md5(trim($this->getEmail())) . '.png?d=wavatar&s=';
$url .= $small ? 22 : 48;
} else {
$url = TBGContext::getTBGPath() . 'avatars/' . $this->getAvatar();
if ($small) {
$url .= '_small';
}
$url .= '.png';
}
return $url;
}
示例11: foreach
?>
</div>
</form>
</div>
<div id="custom_types_list">
<?php
foreach ($custom_types as $type_key => $type) {
?>
<?php
include_component('issuefields_customtype', array('type_key' => $type_key, 'type' => $type));
?>
<?php
}
?>
</div>
</div>
</td>
</tr>
</table>
<script>
var picker = new ColorPicker({iconPath: '<?php
echo TBGSettings::getURLhost() . TBGContext::getTBGPath() . 'themes/' . TBGSettings::getThemeName() . '/cpicker/';
?>
'});
picker.setCallback(function (color) {
picker.selector.style.backgroundColor = color;
picker.selector.value = color;
picker.hide();
});
</script>