本文整理汇总了PHP中JText16类的典型用法代码示例。如果您正苦于以下问题:PHP JText16类的具体用法?PHP JText16怎么用?PHP JText16使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JText16类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tpl = null)
{
// if redirecting to another page, we need to simply send some javascript
// to : a / close the popup, b / redirect the parent page to where we
// want to go
if (!empty($this->redirectTo)) {
$js = 'window.addEvent( \'domready\', function () {
setTimeout( \'shRedirectTo()\', 2000);
});
function shRedirectTo() {
parent.window.location="' . $this->redirectTo . '";
parent.SqueezeBox.close();
}
';
$document =& JFactory::getDocument();
$document->addScriptDeclaration($js);
// insert needed css files
$this->_addCss();
} else {
// get action
$this->task = empty($this->task) ? 'delete' : $this->task;
// build the toolbar
$toolBar = $this->_makeToolbar();
$this->assignRef('toolbar', $toolBar);
// add confirmation phrase to toolbar
$this->assign('toolbarTitle', '<div class="headerconfirm" >' . JText16::_('COM_SH404SEF_CONFIRM_TITLE') . '</div>');
// insert needed css files
$this->_addCss();
// link to custom javascript
JHtml::script('edit.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
}
// now display normally
parent::display($tpl);
}
示例2: save
/**
* Save configuration to disk
* from POST data or input array of data
*
* When config will be saved to db, most of the code in this
* model will be removed and basemodel should handle everything
*
* @param array $dataArray an array holding data to save. If empty, $_POST is used
* @return integer id of created or updated record
*/
public function save($dataArray = null)
{
// get current configuration object
$sefConfig =& shRouter::shGetConfig();
// call the appropriate method for each
// configuration settings set
$methodName = '_save' . ucfirst($this->_layout);
if (is_callable(array($this, $methodName))) {
$status = true;
$this->{$methodName}();
} else {
$status = false;
$this->setError('Internal error : method not defined : _save' . ucfirst($params['layout']));
}
if ($status && !empty($_POST)) {
foreach ($_POST as $key => $value) {
$sefConfig->set($key, $value);
$this->_advancedConfig($key, $value);
}
}
// ask config class to save itself
$status = $status && $sefConfig->saveConfig();
// store any error
if (!$status) {
$this->setError(JText16::_('COM_SH404SEF_ERR_CONFIGURATION_NOT_SAVED'));
}
return $status;
}
示例3: confirmed
public function confirmed($deleteDuplicates = false)
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// find and store edited item id
$cid = JRequest::getVar('cid', array(0), 'default', 'array');
// check invalid data
if (!is_array($cid) || count($cid) < 1 || $cid[0] == 0) {
$this->setRedirect($this->_getDefaultRedirect(), JText16::_('COM_SH404SEF_SELECT_ONE_URL'));
}
// now perform url deletion
// get the model to do it, actually
// Get/Create the model
if ($model =& $this->getModel($this->_defaultModel, 'Sh404sefModel')) {
// store initial context in model
$model->setContext($this->_context);
// call the delete method on our list
if ($deleteDuplicates) {
$model->deleteByIdsWithDuplicates($cid);
} else {
$model->deleteByIds($cid);
}
// check errors and enqueue them for display if any
$errors = $model->getErrors();
if (!empty($errors)) {
$this->enqueuemessages($errors, 'error');
// clear success message, as we have just queued some error messages
$status = '';
}
}
// send back response through default view
$this->display();
}
示例4: makemainurl
public function makemainurl()
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// find and store edited item id
$cid = JRequest::getVar('cid', array(0), 'default', 'array');
// check invalid data
if (!is_array($cid) || count($cid) != 1 || intval($cid[0]) == 0) {
$redirect = array('c' => "duplicates", 'tmpl' => 'component', 'cid[]' => JRequest::getInt('mainurl_id'));
$this->setRedirect($this->_getDefaultRedirect($redirect), JText16::_('COM_SH404SEF_SELECT_ONE_URL'), 'error');
// send back response through default view
$this->display();
}
// now make that url the main url
// while also setting the previous
// with this url current rank
// get the model to do it, actually
// Get/Create the model
if ($model =& $this->getModel($this->_defaultModel, 'Sh404sefModel')) {
// store initial context in model
$model->setContext($this->_context);
// call the delete method on our list
$model->makeMainUrl(intval($cid[0]));
// check errors and enqueue them for display if any
$errors = $model->getErrors();
if (!empty($errors)) {
$this > enqueuemessages($errors, 'error');
}
}
// send back response through default view
$this->display();
}
示例5: selectnfredirect
public function selectnfredirect()
{
// collect input data : which url needs to be redirected ?
$notFoundUrlId = JRequest::getInt('notfound_url_id');
// which URL to redirect to?
$cid = JRequest::getVar('cid', array(0), 'default', 'array');
JArrayHelper::toInteger($cid);
if (count($cid) > 1) {
// more than one target url selected, display error
$this->setError(JText16::_('COM_SH404SEF_SELECT_ONLY_ONE_URL_TO_REDIRECT'));
$this->display();
return;
}
// only one url, use it
$targetUrlId = $cid[0];
if (empty($targetUrlId)) {
// bad url, probably not an integer was passed
$this->setError(JText16::_('COM_SH404SEF_INVALID_REDIRECT_TARGET_ID'));
$this->display();
return;
}
// get model and ask it to do the job
$model =& $this->getModel($this->_defaultModel);
$model->redirectNotFoundUrl($notFoundUrlId, $targetUrlId);
// check errors
$error = $model->getError();
if (!empty($error)) {
$this->setError($error);
}
// standard display
$this->display();
}
示例6: display
/**
* Display the view
*/
public function display($cachable = false)
{
// catch up any result message coming from an
// ajax save for instance, and push that into
// the application message queue
$messageCode = JRequest::getCmd('sh404sefMsg');
if (!empty($messageCode)) {
$msg = JText16::_($messageCode);
if ($msg != $messageCode) {
// if no language string exists, JText16 will
// return the input string, so only display if
// we have something to display
$app =& JFactory::getApplication();
$app->enqueuemessage($msg);
}
}
// get/create the view
$document =& JFactory::getDocument();
$viewType = $document->getType();
$view =& $this->getView($this->_adapter->_stepsMap[$this->_adapter->_step]['view'], $viewType, '', array('base_path' => $this->_basePath));
// Set the layout
$view->setLayout($this->_adapter->_stepsMap[$this->_adapter->_step]['layout']);
// push button list into the view
$view->assign('buttonsList', $this->_adapter->_buttonsList);
$view->assign('visibleButtonsList', $this->_adapter->_visibleButtonsList);
// push list of steps in to the view
foreach ($this->_adapter->_buttonsList as $button) {
$view->assign($button, $this->_adapter->_steps[$button]);
}
// push controller name into view
$view->assign('actionController', $this->_defaultController);
// push operation type and subject into the view
$view->assign('opType', $this->_opType);
$view->assign('opSubject', $this->_opSubject);
// push title, main and hidden text
$view->assign('pageTitle', $this->_pageTitle);
$view->assign('mainText', $this->_mainText);
$view->assign('hiddenText', $this->_hiddenText);
$view->assign('setFormEncType', $this->_setFormEncType);
// check if we are done, and need to set a redirect
if (!empty($this->_redirectTo)) {
$view->assign('redirectTo', $this->_redirectTo);
}
// check if we are continuein to another step, and need to set a redirect
if (!empty($this->_continue)) {
$view->assign('continue', $this->_continue);
}
if (!empty($this->_nextStart)) {
$view->assign('nextstart', $this->_nextStart);
}
// push controller errors in the view
$error = $this->getError();
if (!empty($error)) {
$view->setError($error);
}
// Display the view
$view->display();
}
示例7: _makeViewInfo
/**
* Attach css, js and create toolbar for Info view
*
* @param midxed $params
*/
private function _makeViewInfo($params = null)
{
global $mainframe;
// add our own css
JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
$mainframe->set('JComponentTitle', $title);
}
示例8: saveFromInput
/**
* Save a list of aliases as entered by user in backend to the database
*
* @param string $aliasList data from an html textarea field
* @param string $nonSefUrl the non sef url to which aliases are attached
*
* @return boolean true on success
*/
public function saveFromInput($aliasList, $nonSefUrl)
{
// split aliases from raw input data into an array
$aliasList = explode("\n", $aliasList);
// delete them all. We should do a transaction, but not worth it
$query = 'DELETE from #__sh404sef_aliases where newurl = ' . $this->_db->Quote($nonSefUrl);
$this->_db->setQuery($query);
$this->_db->query();
// Write new aliases.
if (!empty($aliasList[0])) {
$baseQuery = 'INSERT INTO #__sh404sef_aliases (newurl, alias, type) VALUES __shValue__;';
$endOfLine = array("\r\n", "\n", "\r");
foreach ($aliasList as $alias) {
// remove end of line chars
$alias = str_replace($endOfLine, '', $alias);
// if something left, try insert it into DB
if (!empty($alias)) {
// first check value is not invalid
// either the alias already exists
// or same SEF url already exists
try {
$count = Sh404sefHelperDb::count('#__sh404sef_aliases', 'id', 'oldurl = ? and newurl <> ?', array($alias, ''));
if (empty($count)) {
$count = Sh404sefHelperDb::count('#__sh404sef_aliases', '*', array('alias' => $alias));
}
} catch (Sh404sefExceptionDefault $e) {
$count = 0;
}
// if ok, insert into db
if (empty($count)) {
$value = '(' . $this->_db->Quote($nonSefUrl) . ', ' . $this->_db->Quote($alias) . ', ' . $this->_db->Quote(Sh404sefHelperGeneral::COM_SH404SEF_URLTYPE_ALIAS) . ')';
$query = str_replace('__shValue__', $value, $baseQuery);
$this->_db->setQuery($query);
$this->_db->query();
// check errors
$error = $this->_db->getErrorNum();
if (!empty($error)) {
$this->setError('Internal database error # ' . $query);
}
} else {
// alias already exists either as an alias or a SEF url
$this->setError(JText16::sprintf('COM_SH404SEF_ALIAS_ALREADY_EXISTS', $alias));
}
}
}
}
// return true if no error
$error = $this->getError();
return empty($error);
}
示例9: display
/**
* Display the view
*/
public function display($cachable = false)
{
// catch up any result message coming from an
// ajax save for instance, and push that into
// the application message queue
$messageCode = JRequest::getCmd('sh404sefMsg');
if (!empty($messageCode)) {
$msg = JText16::_($messageCode);
if ($msg != $messageCode) {
// if no language string exists, JText16 will
// return the input string, so only display if
// we have something to display
$app =& JFactory::getApplication();
$app->enqueuemessage($msg);
}
}
// Set the default view name in case it's missing
$viewName = JRequest::getWord('view');
if (empty($viewName)) {
JRequest::setVar('view', $this->_defaultView);
}
$document =& JFactory::getDocument();
$viewType = $document->getType();
$viewName = JRequest::getCmd('view', $this->_defaultView);
$viewLayout = JRequest::getCmd('layout', $this->_defaultLayout);
$view =& $this->getView($viewName, $viewType, '', array('base_path' => $this->_basePath));
// Get/Create the model
if ($model =& $this->getModel($viewName)) {
// store initial context in model
$model->setContext($this->_context);
// Push the model into the view (as default)
$view->setModel($model, true);
// and push also the default redirect
$view->assign('defaultRedirectUrl', $this->_getDefaultRedirect(array('layout' => $viewLayout)));
}
// Set the layout
$view->setLayout($viewLayout);
// push controller errors in the view
$error = $this->getError();
if (!empty($error)) {
$view->setError($error);
}
// Display the view
$view->display();
}
示例10: _makeToolbar
/**
* Create toolbar for current view
*
* @param midxed $params
*/
private function _makeToolbar($params = null)
{
// if redirect is set, no toolbar
if (!empty($this->redirectTo)) {
return;
}
// Get the JComponent instance of JToolBar
$bar =& JToolBar::getInstance('toolbar');
// add path to our custom buttons
$bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
// display all buttons we are supposed to display
foreach ($this->visibleButtonsList as $button) {
// we cannot use Joomla's buttons from a popup, as they use href="#" which causes the page to load in parallel with
// closing of the popup. Need use href="javascript: void(0);"
$bar->appendButton('Shpopupstandardbutton', $button, JText16::_($button), $task = $button, $list = false);
}
return $bar;
}
示例11: _getMessage
protected function _getMessage($type)
{
switch ($type) {
case 'success':
$msg = JText16::_('COM_SH404SEF_ELEMENT_SAVED');
break;
case 'failure':
$msg = JText16::_('COM_SH404SEF_ELEMENT_NOT_SAVED');
break;
case 'cancel':
$msg = JText16::_('COM_SH404SEF_CANCELLED');
break;
default:
$msg = '';
break;
}
return $msg;
}
示例12: _createRecord
/**
* Creates a record in the database, based
* on data read from import file
*
* @param array $header an array of fields, as built from the header line
* @param string $line raw record obtained from import file
*/
protected function _createRecord($header, $line)
{
// extract the record
$line = $this->_lineToArray($line);
// get table object to store record
jimport('joomla.database.table');
$table =& JTable::getInstance('pageids', 'Sh404sefTable');
// bind table to current record
$record = array();
$record['newurl'] = $line[3];
if ($record['newurl'] == '__ Homepage __') {
$record['newurl'] = sh404SEF_HOMEPAGE_CODE;
}
$record['pageid'] = $line[1];
$record['type'] = $line[4];
// save record
if (!$table->save($record)) {
throw new Sh404sefExceptionDefault(JText16::sprintf('COM_SH404SEF_IMPORT_ERROR_INSERTING_INTO_DB', $line[0]));
}
}
示例13:
<input type="text" name="search_all" id="search_all" value="<?php
echo $this->escape($this->options->search_all);
?>
" size="35" maxlength="255" class="text_area" onchange="document.adminForm.limitstart.value=0;document.adminForm.submit();" />
<button onclick="document.adminForm.limitstart.value=0;this.form.submit();"><?php
echo JText::_('Go');
?>
</button>
<button onclick="document.adminForm.limitstart.value=0;document.getElementById('search_all').value='';this.form.submit();"><?php
echo JText::_('Reset');
?>
</button>
</td>
<td align="left" nowrap="nowrap">
<?php
echo JText16::_('COM_SH404SEF_PAGE_ID');
?>
:
<input type="text" name="search_pageid" id="search_pageid" value="<?php
echo $this->escape($this->options->search_pageid);
?>
" size="20" maxlength="255" class="text_area" onchange="document.adminForm.limitstart.value=0;document.adminForm.submit();" />
<button onclick="document.adminForm.limitstart.value=0;this.form.submit();"><?php
echo JText::_('Go');
?>
</button>
<button onclick="document.adminForm.limitstart.value=0;document.getElementById('search_pageid').value='';this.form.submit();"><?php
echo JText::_('Reset');
?>
</button>
</td>
示例14: array
$linkData = array('c' => 'editnotfound', 'notfound_url_id' => $url->id, 'task' => 'newredirect', 'tmpl' => 'component');
$urlData = array('title' => JText16::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT_TITLE'), 'class' => 'modalediturl', 'anchor' => JText16::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT'));
$modalOptions = array('size' => array('x' => '\\window.getSize().scrollSize.x*.7', 'y' => '\\window.getSize().size.y*.5'));
echo Sh404sefHelperHtml::makeLink($this, $linkData, $urlData, $modal = true, $modalOptions, $hasTip = false, $extra = '');
?>
</td>
</tr>
<?php
$k = 1 - $k;
}
} else {
?>
<tr>
<td align="center" colspan="6">
<?php
echo JText16::_('COM_SH404SEF_NO_URL');
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<input type="hidden" name="c" value="urls" />
<input type="hidden" name="view" value="urls" />
<input type="hidden" name="layout" value="view404" />
<input type="hidden" name="option" value="com_sh404sef" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php
示例15: die
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @version $Id: default_visits.php 1559 2010-08-23 10:01:15Z silianacom-svn $
*/
// Security check to ensure this file is being included by a parent file.
if (!defined('_JEXEC')) {
die('Direct Access to this location is not allowed.');
}
switch ($this->sefConfig->analyticsDashboardDataType) {
case 'ga:visits':
$title = JText16::_('COM_SH404SEF_ANALYTICS_DATA_VISITS_DESC_RAW');
break;
case 'ga:visitors':
$title = JText16::_('COM_SH404SEF_ANALYTICS_DATA_VISITORS_DESC_RAW');
break;
case 'ga:pageviews':
$title = JText16::_('COM_SH404SEF_ANALYTICS_GLOBAL_PAGEVIEWS_DESC_RAW');
break;
default:
$title = '';
break;
}
$title = Sh404sefHelperAnalytics::getDataTypeTitle() . (empty($title) ? '' : '::' . $title);
?>
<div class="hasAnalyticsTip" title="<?php
echo $title;
?>
" >
<fieldset>