本文整理汇总了PHP中JFilterOutput类的典型用法代码示例。如果您正苦于以下问题:PHP JFilterOutput类的具体用法?PHP JFilterOutput怎么用?PHP JFilterOutput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JFilterOutput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
public function store($updateNulls = true)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
if ($this->id) {
$this->modified_time = $date->toSql();
$this->modified_user_id = $user->get('id');
} else {
if (!(int) $this->created_time) {
$this->created_time = $date->toSql();
}
if (empty($this->created_user_id)) {
$this->created_user_id = $user->get('id');
}
}
$table = JTable::getInstance('Page', 'SppagebuilderTable');
$alias = JFilterOutput::stringURLSafe($this->alias);
if ($alias == '') {
$alias = JFilterOutput::stringURLSafe($this->title);
}
$this->alias = $alias;
if ($table->load(array('alias' => $alias)) && ($table->id != $this->id || $this->id == 0)) {
$this->setError(JText::_('COM_SPPAGEBUILDER_ERROR_UNIQUE_ALIAS'));
return false;
}
return parent::store($updateNulls);
}
示例2: edit
function edit()
{
$country_id = JRequest::getInt("country_id");
$countries = $this->getModel("countries");
$country = JTable::getInstance('country', 'jshop');
$country->load($country_id);
$first[] = JHTML::_('select.option', '0', _JSHOP_ORDERING_FIRST, 'ordering', 'name');
$rows = array_merge($first, $countries->getAllCountries(0));
$lists['order_countries'] = JHTML::_('select.genericlist', $rows, 'ordering', 'class="inputbox" size="1"', 'ordering', 'name', $country->ordering);
$_lang = $this->getModel("languages");
$languages = $_lang->getAllLanguages(1);
$multilang = count($languages) > 1;
$edit = $country_id ? $edit = 1 : ($edit = 0);
JFilterOutput::objectHTMLSafe($country, ENT_QUOTES);
$view = $this->getView("countries", 'html');
$view->setLayout("edit");
$view->assign('country', $country);
$view->assign('lists', $lists);
$view->assign('edit', $edit);
$view->assign('languages', $languages);
$view->assign('etemplatevar', '');
$view->assign('multilang', $multilang);
JPluginHelper::importPlugin('jshoppingadmin');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeEditCountries', array(&$view));
$view->displayEdit();
}
示例3: run
function run($form, $actiondata)
{
$params = new JParameter($actiondata->params);
$mainframe =& JFactory::getApplication();
//save the data to db
$db_save_details = $actiondata;
$db_save_details->type = 'db_save';
//create params
$db_save_details_params = new JParameter('');
$db_save_details_params->set('table_name', $mainframe->getCfg('dbprefix') . 'content');
$db_save_details_params->set('model_id', 'Article');
$db_save_details->params = $db_save_details_params->toString();
//set data
$user =& JFactory::getUser();
$form->data['created_by'] = $user->id;
$form->data['created'] = date("Y-m-d H:i:s");
$form->data['catid'] = $params->get('catid', '');
$form->data['sectionid'] = $params->get('sectionid', 0);
$form->data['state'] = $params->get('state', 0);
$form->data['title'] = $form->data[$params->get('title', '')];
$form->data['fulltext'] = $form->data[$params->get('fulltext', '')];
$form->data['introtext'] = isset($form->data[$params->get('introtext', '')]) ? $form->data[$params->get('introtext', '')] : '';
$form->data['created_by_alias'] = $form->data[$params->get('created_by_alias', '')];
//alias
$form->data['alias'] = JFilterOutput::stringURLSafe($form->data['title']);
$form->data['id'] = null;
//$form->data['alias'] = null;
$form->runAction($db_save_details);
}
示例4: edit
function edit()
{
$db = JFactory::getDBO();
$currency = JSFactory::getTable('currency', 'jshop');
$currencies = JSFactory::getModel("currencies");
$currency_id = JRequest::getInt('currency_id');
$currency->load($currency_id);
if ($currency->currency_value == 0) {
$currency->currency_value = 1;
}
$first[] = JHTML::_('select.option', '0', _JSHOP_ORDERING_FIRST, 'currency_ordering', 'currency_name');
$rows = array_merge($first, $currencies->getAllCurrencies());
$lists['order_currencies'] = JHTML::_('select.genericlist', $rows, 'currency_ordering', 'class="inputbox" size="1"', 'currency_ordering', 'currency_name', $currency->currency_ordering);
$edit = $currency_id ? $edit = 1 : ($edit = 0);
JFilterOutput::objectHTMLSafe($currency, ENT_QUOTES);
$view = $this->getView("currencies", 'html');
$view->setLayout("edit");
$view->assign('currency', $currency);
$view->assign('lists', $lists);
$view->assign('edit', $edit);
$view->assign('etemplatevar', '');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeEditCurrencies', array(&$view));
$view->displayEdit();
}
示例5: tranAlias
function tranAlias($easyset)
{
// set translate language
$SourceLan = $easyset->params->get('originLan');
$ResultLan = $easyset->params->get('tranLlan', 'en');
// get query
$post = JRequest::get('post');
if (!isset($post['jform']) || !isset($post['jform']['alias'])) {
return;
}
$alias = $post['jform']['alias'];
$title = $post['jform']['title'];
$titleTmp = explode('::', $post['jform']['title']);
if (!empty($titleTmp[1])) {
$title = $titleTmp[0];
$alias = JFilterOutput::stringURLSafe($titleTmp[1]);
}
if (trim($alias) == '') {
$alias = AKHelper::_('lang.translate', $title, $SourceLan, $ResultLan);
$alias = trim($alias);
$alias = JFilterOutput::stringURLSafe($alias);
$replace = array('aquot' => '', 'a39' => '', '--' => '-');
$alias = strtr($alias, $replace);
$alias = trim($alias, '-');
}
$post['jform']['alias'] = $alias;
$post['jform']['title'] = $title;
$input = JFactory::getApplication()->input;
JRequest::setVar('jform', $post['jform'], 'method', true);
$input->post->set('jform', $post['jform']);
$input->request->set('jform', $post['jform']);
}
示例6: getBadgeAlias
function getBadgeAlias($id)
{
$badge = FD::table('Badge');
$badge->load($id);
$alias = JFilterOutput::stringURLSafe($badge->alias);
return $alias;
}
示例7: check
/**
* Check data integrity
*
* @access public
* @return boolean True on success
*/
public function check()
{
if (empty($this->name)) {
$this->setError(JText::_('ERROR NAME REQUIRED'));
return false;
}
if (empty($this->alias)) {
$this->alias = JFilterOutput::stringURLSafe($this->name);
} else {
$this->alias = JFilterOutput::stringURLSafe($this->alias);
}
// check if Position is unique
// by checking: name+parent_id+sports_type_id+persontype
if (!$this->id) {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('name');
$query->from('#__joomleague_position');
$query->where('name =' . $db->Quote($this->name));
$query->where('parent_id = ' . $db->Quote($this->parent_id));
$query->where('sports_type_id = ' . $db->Quote($this->sports_type_id));
$query->where('persontype = ' . $db->Quote($this->persontype));
$db->setQuery($query);
$result = $db->loadColumn();
if ($result) {
$app = JFactory::getApplication()->enqueueMessage('EventType already exists', 'warning');
return false;
}
}
return true;
}
示例8: displayDefault
function displayDefault()
{
global $mainframe;
//Load pane behavior
jimport('joomla.html.pane');
//initialise variables
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
JHTML::_('behavior.tooltip');
//get vars
$cid = JRequest::getVar('cid');
//create the toolbar
if ($cid) {
JToolBarHelper::title(JText::_('HG_EDIT_AD_TYPE'), 'adtypeedit');
} else {
JToolBarHelper::title(JText::_('HG_ADD_AD_TYPE'), 'adtypeadd');
}
JToolBarHelper::apply();
JToolBarHelper::save();
JToolBarHelper::cancel();
//Get data from the model
$model =& $this->getModel();
$row =& $this->get('Type');
// fail if checked out not by 'me'
if ($row->id) {
if ($model->isCheckedOut($user->get('id'))) {
JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('HG_EDITED_BY_ANOTHER_ADMIN'));
$mainframe->redirect('index.php?option=com_hotelguide&view=adtypes');
}
}
//clean data
JFilterOutput::objectHTMLSafe($row, ENT_QUOTES);
//assign data to template
$this->assignRef('row', $row);
}
示例9: edit
function edit()
{
$db = JFactory::getDBO();
$man_id = JRequest::getInt("man_id");
$manufacturer = JSFactory::getTable('manufacturer', 'jshop');
$manufacturer->load($man_id);
$edit = $man_id ? 1 : 0;
if (!$man_id) {
$manufacturer->manufacturer_publish = 1;
}
$_lang = JSFactory::getModel("languages");
$languages = $_lang->getAllLanguages(1);
$multilang = count($languages) > 1;
$nofilter = array();
JFilterOutput::objectHTMLSafe($manufacturer, ENT_QUOTES, $nofilter);
$view = $this->getView("manufacturer", 'html');
$view->setLayout("edit");
$view->assign('manufacturer', $manufacturer);
$view->assign('edit', $edit);
$view->assign('languages', $languages);
$view->assign('etemplatevar', '');
$view->assign('multilang', $multilang);
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeEditManufacturers', array(&$view));
$view->displayEdit();
}
示例10: onContentPrepare
function onContentPrepare($context, &$article, &$params, $limitstart = 1)
{
preg_match_all($this->regex, $article->text, $results, PREG_PATTERN_ORDER);
//var_dump($results);
if (count($results[0]) > 0) {
for ($i = 0; $i < count($results[0]); $i++) {
$subArray = array();
$subArray = explode("|", $results[1][$i]);
//var_dump($subArray);
$contactId = $subArray[0] == '' || $subArray[0] == NULL ? 0 : $subArray[0];
if (isset($subArray[1])) {
$itemId = $subArray[1] == '' || $subArray[1] == NULL ? 0 : $subArray[1];
//echo $itemId;
}
$itemId = isset($itemId) ? '&Itemid=' . $itemId : NULL;
// Get Contact Details from Contact Component
$query = 'SELECT * FROM #__contact_details' . ' WHERE id = ' . $contactId . ' AND published = 1';
$contactInfo = $this->_getObject($query);
// Set contact form link
if (isset($contactInfo->email_to)) {
$contactFormLink = 'index.php?option=com_contact&view=contact&id=' . $contactId . $itemId . '&tmpl=component';
$contactFormLink = JFilterOutput::ampReplace($contactFormLink);
$contactFormOutput = '<iframe id="contact-form" onload="setIframeHeight(this.id)" src="' . $contactFormLink . '" scrolling="no" style="border:none;width:100%;"></iframe>';
$script = 'function setIframeHeight( iframeId ){var ifDoc, ifRef = document.getElementById( iframeId );try{ifDoc = ifRef.contentWindow.document.documentElement;}catch( e ){try{ifDoc = ifRef.contentDocument.documentElement;}catch(ee){}}if( ifDoc ){ifRef.height = 1;ifRef.height = ifDoc.scrollHeight;}}';
$doc =& JFactory::getDocument();
$doc->addScriptDeclaration($script);
$article->text = preg_replace($this->regex, $contactFormOutput, $article->text, 1);
}
}
}
return true;
}
示例11: _fixOldAlias
private function _fixOldAlias($tablename = "content")
{
require_once dirname(__FILE__) . DS . 'output.php';
$db =& JFactory::getDBO();
$query = $db->getQuery(true);
// $query = "SELECT id, title FROM #__$tablename;";
$query->select('id, title');
$query->from($db->quoteName("#__{$tablename}"));
$db->setQuery($query);
$rows = $db->loadAssocList();
// If found any rows
if (!empty($rows) && count($rows)) {
foreach ($rows as $row) {
$id = (int) $row["id"];
$alias = JFilterOutput::stringURLSafe($row["title"]);
// $query = "UPDATE #__$tablename SET alias='$alias' WHERE id=$id;";
$query = $db->getQuery(true);
$query->update($db->quoteName("#__{$tablename}"));
$query->set('alias=' . $db->quote($alias));
$query->where('id=' . $db->quote($id));
$db->setQuery($query);
$result = $db->query();
}
}
}
示例12: importImage
/**
* Takes an image file, moves the file and adds database entry
* @param the verified REAL name of the local file including path
* @param name of file according to user/browser or just the name excluding path
* @param desired category
* @param title of image, if empty will be created from $name
* @param description of image, if empty will remain empty
* @return returns true if successfull otherwise returns an ImageUploadError
*/
function importImage($tmpName, $name, $cat, $title = '', $desc = '')
{
global $rsgConfig;
$database =& JFactory::getDBO();
$my =& JFactory::getUser();
$destination = fileUtils::move_uploadedFile_to_orignalDir($tmpName, $name);
if (is_a($destination, imageUploadError)) {
return $destination;
}
$parts = pathinfo($destination);
$newName = $parts['basename'];
// fill $title if empty
if ($title == '') {
$title = substr($parts['basename'], 0, -(strlen($parts['extension']) + ($parts['extension'] == '' ? 0 : 1)));
}
// determine ordering
$database->setQuery("SELECT COUNT(1) FROM #__rsgallery2_files WHERE gallery_id = '{$cat}'");
$ordering = $database->loadResult() + 1;
//Store image details in database
$alias = mysql_real_escape_string(JFilterOutput::stringURLSafe($title));
$desc = mysql_real_escape_string($desc);
$title = mysql_real_escape_string($title);
$database->setQuery("INSERT INTO #__rsgallery2_files" . " (title, name, descr, gallery_id, date, ordering, userid, alias) VALUES" . " ('{$title}', '{$newName}', '{$desc}', '{$cat}', now(), '{$ordering}', '{$my->id}', '{$alias}')");
if (!$database->query()) {
audioUtils::deleteAudio($parts['basename']);
return new imageUploadError($parts['basename'], $database->stderr(true));
}
return true;
}
示例13: filterTitle
public function filterTitle(&$alias)
{
if ($alias == "") {
$alias = JRequest::getString("refField_title");
}
$alias = JFilterOutput::stringURLSafe($alias);
}
示例14: edit
function edit()
{
$jshopConfig = JSFactory::getConfig();
$shipping_id = JRequest::getInt("shipping_id");
$shipping = JTable::getInstance('shippingMethod', 'jshop');
$shipping->load($shipping_id);
$edit = $shipping_id ? $edit = 1 : ($edit = 0);
$_lang = $this->getModel("languages");
$languages = $_lang->getAllLanguages(1);
$multilang = count($languages) > 1;
$_payments = $this->getModel("payments");
$list_payments = $_payments->getAllPaymentMethods(0);
$lists['payments'] = JHTML::_('select.genericlist', $list_payments, 'listpayments[]', 'class="inputbox" size="10" multiple = "multiple"', 'payment_id', 'name', $shipping->getPayments());
$nofilter = array();
JFilterOutput::objectHTMLSafe($shipping, ENT_QUOTES, $nofilter);
$view = $this->getView("shippings", 'html');
$view->setLayout("edit");
$view->assign('shipping', $shipping);
$view->assign('edit', $edit);
$view->assign('languages', $languages);
$view->assign('multilang', $multilang);
$view->assign('lists', $lists);
$view->assign('config', $jshopConfig);
$view->assign('etemplatevar', '');
JPluginHelper::importPlugin('jshoppingadmin');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeEditShippings', array(&$view));
$view->displayEdit();
}
示例15: check
/**
* Overloaded check method to ensure data integrity
*
* @access public
* @return boolean True on success
* @since 1.0
*/
function check()
{
if (empty($this->name)) {
$this->setError(JText::_('NAME REQUIRED'));
return false;
}
// add default middle size name
if (empty($this->middle_name)) {
$parts = explode(" ", $this->name);
$this->middle_name = substr($parts[0], 0, 20);
}
// add default short size name
if (empty($this->short_name)) {
$parts = explode(" ", $this->name);
$this->short_name = substr($parts[0], 0, 2);
}
// setting alias
if (empty($this->alias)) {
$this->alias = JFilterOutput::stringURLSafe($this->name);
} else {
$this->alias = JFilterOutput::stringURLSafe($this->alias);
// make sure the user didn't modify it to something illegal...
}
return true;
}