本文整理汇总了PHP中PFApplicationHelper::getActiveProjectTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP PFApplicationHelper::getActiveProjectTitle方法的具体用法?PHP PFApplicationHelper::getActiveProjectTitle怎么用?PHP PFApplicationHelper::getActiveProjectTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFApplicationHelper
的用法示例。
在下文中一共展示了PFApplicationHelper::getActiveProjectTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: select2
/**
* Renders a select2 input field for selecting a project
*
* @param int $value The state value
* @param bool $can_change
*
* @return string The input field html
*/
public static function select2($value = 0, $can_change = true)
{
JHtml::_('pfhtml.script.jQuerySelect2');
static $field_id = 0;
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
// Get currently active project data
$active_id = (int) PFApplicationHelper::getActiveProjectId();
$active_title = PFApplicationHelper::getActiveProjectTitle();
$field_id++;
// Prepare title value
$title_val = htmlspecialchars($active_title, ENT_COMPAT, 'UTF-8');
// Prepare field attributes
$attr_read = $can_change ? '' : ' readonly="readonly"';
$css_txt = ($can_change ? '' : ' disabled muted') . ($active_id ? ' success' : ' warning');
$placehold = htmlspecialchars(JText::_('COM_PROJECTFORK_SELECT_PROJECT'), ENT_COMPAT, 'UTF-8');
// Query url
$url = 'index.php?option=com_pfprojects&view=projects&tmpl=component&format=json&select2=1';
// Prepare JS typeahead script
$js = array();
$js[] = "jQuery(document).ready(function()";
$js[] = "{";
$js[] = " jQuery('#filter_project_id" . $field_id . "').select2({";
$js[] = " placeholder: '" . $placehold . "',";
if ($active_id) {
$js[] = " allowClear: true,";
}
$js[] = " minimumInputLength: 0,";
$js[] = " ajax: {";
$js[] = " url: '" . $url . "',";
$js[] = " dataType: 'json',";
$js[] = " quietMillis: 200,";
$js[] = " data: function (term, page) {return {filter_search: term, limit: 10, limitstart: ((page - 1) * 10)};},";
$js[] = " results: function (data, page) {var more = (page * 10) < data.total;return {results: data.items, more: more};}";
$js[] = " },";
$js[] = " escapeMarkup:function(markup) { return markup; },";
$js[] = " initSelection: function(element, callback) {";
$js[] = " callback({id:" . $active_id . ", text: '" . ($active_id ? htmlspecialchars($active_title, ENT_QUOTES) : htmlspecialchars($placehold, ENT_QUOTES)) . "'});";
$js[] = " }";
$js[] = " });";
$js[] = " jQuery('#filter_project_id" . $field_id . "').change(function(){this.form.submit();});";
$js[] = "});";
// Prepare html output
$html = array();
$html[] = '<input type="hidden" id="filter_project_id' . $field_id . '" name="filter_project" placeholder="' . $placehold . '"';
$html[] = ' value="' . $active_id . '" autocomplete="off"' . $attr_read . ' class="input-large" tabindex="-1" />';
if ($can_change) {
// Add script
JFactory::getDocument()->addScriptDeclaration(implode("\n", $js));
}
return implode("\n", $html);
}
示例2:
echo JText::_('COM_PROJECTFORK_TIME_TRACKING_ESTIMATED');
?>
(<?php
echo JHtml::_('time.format', $this->total_estimated_time, 'decimal');
?>
)
</div>
</fieldset>
</div>
<div class="span6">
<fieldset>
<legend><?php
echo JText::_('COM_PROJECTFORK_TIME_TRACKING_TOTAL_HOURS');
?>
: <?php
echo PFApplicationHelper::getActiveProjectTitle();
?>
</legend>
<div class="progress progress-success">
<div class="bar" style="width: <?php
echo $billable_percent;
?>
%;">
<?php
if ($billable_percent) {
?>
<?php
echo JHtml::_('time.format', $this->total_time_billable, 'decimal');
?>
<?php
echo JText::_('COM_PROJECTFORK_TIME_TRACKING_BILLABLE');
示例3:
window.focus();
window.print();
});
');
?>
<div id="projectfork" class="category-list<?php
echo $this->pageclass_sfx;
?>
view-milestones-print">
<?php
if ($this->state->get('filter.project')) {
?>
<h2>
<?php
echo $this->escape(PFApplicationHelper::getActiveProjectTitle());
?>
</h2>
<?php
}
?>
<table class="table table-striped cat-items">
<thead>
<tr>
<th><?php
echo JText::_('JGRID_HEADING_TASK');
?>
</th>
<th class="nowrap" style="width: 20%"><?php
echo JText::_('JGRID_HEADING_AUTHOR');