本文整理汇总了PHP中CostbenefitprojectionHelper::safeString方法的典型用法代码示例。如果您正苦于以下问题:PHP CostbenefitprojectionHelper::safeString方法的具体用法?PHP CostbenefitprojectionHelper::safeString怎么用?PHP CostbenefitprojectionHelper::safeString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CostbenefitprojectionHelper
的用法示例。
在下文中一共展示了CostbenefitprojectionHelper::safeString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Chartbuilder
$chart = new Chartbuilder('PieChart');
$i = 0;
$data = array();
$rowArray = array();
$rowArray_numbers = array();
$dataset = json_decode($displayData->{'percent' . $gender});
foreach ($dataset as $key => &$set) {
if ('age' == $key) {
$type = 'string';
$percent = false;
} else {
$type = 'number';
$percent = true;
}
// set header
$data['cols'][$i] = array('id' => '', 'lable' => CostbenefitprojectionHelper::safeString($key, 'Ww'), 'type' => $type);
foreach ($set as $nr => $val) {
if (!isset($rowArray_numbers[$nr])) {
$rowArray_numbers[$nr] = '';
}
if ($percent) {
$rowArray[$nr]['c'][] = array('v' => (int) $val);
// set the table values
$rowArray_numbers[$nr] .= '<td data-value="' . $val . '">' . $val . '%</td>';
} else {
$rowArray[$nr]['c'][] = array('v' => $val, 'f' => JText::_('COM_COSTBENEFITPROJECTION_AGE') . ' ' . $val);
// set the table values
$rowArray_numbers[$nr] .= '<td>' . JText::_('COM_COSTBENEFITPROJECTION_AGE') . ' ' . $val . '</td>';
}
}
$i++;
示例2: getIcons
public function getIcons()
{
// load user for access menus
$user = JFactory::getUser();
// reset icon array
$icons = array();
// view groups array
$viewGroups = array('main' => array('png.company.add', 'png.companies', 'png.service_provider.add', 'png.service_providers', 'png.countries', 'png.causerisk.add', 'png.causesrisks', 'png.health_data_sets', 'png.scaling_factor.add', 'png.scaling_factors', 'png.intervention.add', 'png.interventions', 'png.currencies', 'png.help_documents'));
// view access array
$viewAccess = array('combinedresults.dashboard_list' => 'combinedresults.dashboard_list', 'company.create' => 'company.create', 'companies.access' => 'company.access', 'company.access' => 'company.access', 'companies.submenu' => 'company.submenu', 'companies.dashboard_list' => 'company.dashboard_list', 'company.dashboard_add' => 'company.dashboard_add', 'service_provider.create' => 'service_provider.create', 'service_providers.access' => 'service_provider.access', 'service_provider.access' => 'service_provider.access', 'service_providers.submenu' => 'service_provider.submenu', 'service_providers.dashboard_list' => 'service_provider.dashboard_list', 'service_provider.dashboard_add' => 'service_provider.dashboard_add', 'country.create' => 'country.create', 'countries.access' => 'country.access', 'country.access' => 'country.access', 'countries.submenu' => 'country.submenu', 'countries.dashboard_list' => 'country.dashboard_list', 'causerisk.create' => 'causerisk.create', 'causesrisks.access' => 'causerisk.access', 'causerisk.access' => 'causerisk.access', 'causesrisks.submenu' => 'causerisk.submenu', 'causesrisks.dashboard_list' => 'causerisk.dashboard_list', 'causerisk.dashboard_add' => 'causerisk.dashboard_add', 'health_data.create' => 'health_data.create', 'health_data_sets.access' => 'health_data.access', 'health_data.access' => 'health_data.access', 'health_data_sets.submenu' => 'health_data.submenu', 'health_data_sets.dashboard_list' => 'health_data.dashboard_list', 'scaling_factor.create' => 'scaling_factor.create', 'scaling_factors.access' => 'scaling_factor.access', 'scaling_factor.access' => 'scaling_factor.access', 'scaling_factors.submenu' => 'scaling_factor.submenu', 'scaling_factors.dashboard_list' => 'scaling_factor.dashboard_list', 'scaling_factor.dashboard_add' => 'scaling_factor.dashboard_add', 'intervention.create' => 'intervention.create', 'interventions.access' => 'intervention.access', 'intervention.access' => 'intervention.access', 'interventions.submenu' => 'intervention.submenu', 'interventions.dashboard_list' => 'intervention.dashboard_list', 'intervention.dashboard_add' => 'intervention.dashboard_add', 'currency.create' => 'currency.create', 'currencies.access' => 'currency.access', 'currency.access' => 'currency.access', 'currencies.submenu' => 'currency.submenu', 'currencies.dashboard_list' => 'currency.dashboard_list', 'help_document.create' => 'help_document.create', 'help_documents.access' => 'help_document.access', 'help_document.access' => 'help_document.access', 'help_documents.submenu' => 'help_document.submenu', 'help_documents.dashboard_list' => 'help_document.dashboard_list');
foreach ($viewGroups as $group => $views) {
$i = 0;
if (CostbenefitprojectionHelper::checkArray($views)) {
foreach ($views as $view) {
$add = false;
if (strpos($view, '.') !== false) {
$dwd = explode('.', $view);
if (count($dwd) == 3) {
list($type, $name, $action) = $dwd;
} elseif (count($dwd) == 2) {
list($type, $name) = $dwd;
$action = false;
}
if ($action) {
$viewName = $name;
switch ($action) {
case 'add':
$url = 'index.php?option=com_costbenefitprojection&view=' . $name . '&layout=edit';
$image = $name . '_' . $action . '.' . $type;
$alt = $name . ' ' . $action;
$name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_' . CostbenefitprojectionHelper::safeString($name, 'U') . '_ADD';
$add = true;
break;
default:
$url = 'index.php?option=com_categories&view=categories&extension=com_costbenefitprojection.' . $name;
$image = $name . '_' . $action . '.' . $type;
$alt = $name . ' ' . $action;
$name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_' . CostbenefitprojectionHelper::safeString($name, 'U') . '_' . CostbenefitprojectionHelper::safeString($action, 'U');
break;
}
} else {
$viewName = $name;
$alt = $name;
$url = 'index.php?option=com_costbenefitprojection&view=' . $name;
$image = $name . '.' . $type;
$name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_' . CostbenefitprojectionHelper::safeString($name, 'U');
$hover = false;
}
} else {
$viewName = $view;
$alt = $view;
$url = 'index.php?option=com_costbenefitprojection&view=' . $view;
$image = $view . '.png';
$name = ucwords($view) . '<br /><br />';
$hover = false;
}
// first make sure the view access is set
if (CostbenefitprojectionHelper::checkArray($viewAccess)) {
// setup some defaults
$dashboard_add = false;
$dashboard_list = false;
$accessTo = '';
$accessAdd = '';
// acces checking start
$accessCreate = isset($viewAccess[$viewName . '.create']) ? CostbenefitprojectionHelper::checkString($viewAccess[$viewName . '.create']) : false;
$accessAccess = isset($viewAccess[$viewName . '.access']) ? CostbenefitprojectionHelper::checkString($viewAccess[$viewName . '.access']) : false;
// set main controllers
$accessDashboard_add = isset($viewAccess[$viewName . '.dashboard_add']) ? CostbenefitprojectionHelper::checkString($viewAccess[$viewName . '.dashboard_add']) : false;
$accessDashboard_list = isset($viewAccess[$viewName . '.dashboard_list']) ? CostbenefitprojectionHelper::checkString($viewAccess[$viewName . '.dashboard_list']) : false;
// check for adding access
if ($add && $accessCreate) {
$accessAdd = $viewAccess[$viewName . '.create'];
} elseif ($add) {
$accessAdd = 'core.create';
}
// check if acces to view is set
if ($accessAccess) {
$accessTo = $viewAccess[$viewName . '.access'];
}
// set main access controllers
if ($accessDashboard_add) {
$dashboard_add = $user->authorise($viewAccess[$viewName . '.dashboard_add'], 'com_costbenefitprojection');
}
if ($accessDashboard_list) {
$dashboard_list = $user->authorise($viewAccess[$viewName . '.dashboard_list'], 'com_costbenefitprojection');
}
if (CostbenefitprojectionHelper::checkString($accessAdd) && CostbenefitprojectionHelper::checkString($accessTo)) {
// check access
if ($user->authorise($accessAdd, 'com_costbenefitprojection') && $user->authorise($accessTo, 'com_costbenefitprojection') && $dashboard_add) {
$icons[$group][$i] = new StdClass();
$icons[$group][$i]->url = $url;
$icons[$group][$i]->name = $name;
$icons[$group][$i]->image = $image;
$icons[$group][$i]->alt = $alt;
}
} elseif (CostbenefitprojectionHelper::checkString($accessTo)) {
// check access
if ($user->authorise($accessTo, 'com_costbenefitprojection') && $dashboard_list) {
$icons[$group][$i] = new StdClass();
$icons[$group][$i]->url = $url;
//.........这里部分代码省略.........
示例3: foreach
</th>
<?php
foreach ($this->usagedata->items as $items) {
?>
<?php
foreach ($items as $key => $value) {
?>
<?php
if ('name' == $key) {
break;
} elseif (strpos($key, 'employees') !== false) {
continue;
}
?>
<th class="nowrap center" width="16%"><?php
echo CostbenefitprojectionHelper::safeString($key, 'Ww');
?>
</th>
<?php
}
?>
<?php
break;
?>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
示例4: setHeaderString
function setHeaderString($n)
{
return CostbenefitprojectionHelper::safeString($n, 'Ww');
}