本文整理汇总了PHP中JUDirectoryHelper::obCleanData方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDirectoryHelper::obCleanData方法的具体用法?PHP JUDirectoryHelper::obCleanData怎么用?PHP JUDirectoryHelper::obCleanData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDirectoryHelper
的用法示例。
在下文中一共展示了JUDirectoryHelper::obCleanData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changeTemplateId
public function changeTemplateId()
{
$app = JFactory::getApplication();
$jInput = $app->input;
$templateId = $jInput->post->getInt("value");
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('parent_id');
$query->from('#__judirectory_templates');
$query->where('id = ' . $templateId);
$db->setQuery($query);
$templateParentId = $db->loadResult();
$query = $db->getQuery(true);
$query->select('*');
$query->select('title AS text');
$query->select('id AS value');
$query->from('#__judirectory_template_styles');
$query->where('template_id =' . $templateParentId);
$query->order('lft ASC');
$db->setQuery($query);
$styleObjectList = $db->loadObjectList();
$html = "";
$html .= "<option value=\"\">" . JText::_('COM_JUDIRECTORY_SELECT_PARENT_TEMPLATE') . "</option>";
if (!empty($styleObjectList)) {
foreach ($styleObjectList as $styleObject) {
$html .= "<option value=\"" . $styleObject->value . "\">" . $styleObject->text . "</option>";
}
}
JUDirectoryHelper::obCleanData();
echo $html;
exit;
}
示例2: rebuildCommentTree
public function rebuildCommentTree()
{
$model = $this->getModel();
JUDirectoryHelper::obCleanData();
echo $model->rebuildCommentTree();
exit;
}
示例3: captchaSecurityImages
public static function captchaSecurityImages($namespace = null)
{
$secureImage = JUDirectoryFrontHelperCaptcha::initCaptcha($namespace);
JUDirectoryHelper::obCleanData();
$secureImage->show();
$secureImage->getCode();
}
示例4: listingChangeCategory
public function listingChangeCategory()
{
$model = $this->getModel();
$data = $model->listingChangeCategory();
JUDirectoryHelper::obCleanData();
echo $data;
exit;
}
示例5: listingChangeCategory
public function listingChangeCategory()
{
require_once JPATH_ADMINISTRATOR . '/components/com_judirectory/models/category.php';
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_judirectory/models');
$backendCategoryModel = JModelLegacy::getInstance('Category', 'JUDirectoryModel');
$data = $backendCategoryModel->listingChangeCategory();
JUDirectoryHelper::obCleanData();
echo $data;
exit;
}
示例6: getChartData
public function getChartData()
{
$app = JFactory::getApplication();
$type = $app->input->get('type');
$model = $this->getModel();
$data = $model->getSubmissionData($type);
$app = JFactory::getApplication();
$app->setUserState('com_judirectory.dashboard.chart.type', $type);
JUDirectoryHelper::obCleanData();
echo json_encode($data);
exit;
}
示例7: autoSuggest
public function autoSuggest()
{
$app = JFactory::getApplication();
$field = $app->input->get('field', '', 'string');
$string = $app->input->get('string', '', 'string');
$model = $this->getModel();
$result = $model->getAutoSuggestValues($field, $string);
if ($result === false) {
exit;
}
JUDirectoryHelper::obCleanData();
echo json_encode($result);
exit;
}
示例8: downloadFile
public static function downloadFile($file, $fileName, $transport = 'php', $speed = 50, $resume = true, $downloadMultiParts = true, $mimeType = false)
{
if (ini_get('zlib.output_compression')) {
@ini_set('zlib.output_compression', 'Off');
}
if (function_exists('apache_setenv')) {
apache_setenv('no-gzip', '1');
}
$agent = isset($_SERVER['HTTP_USER_AGENT']) ? trim($_SERVER['HTTP_USER_AGENT']) : null;
if ($agent && preg_match('#(?:MSIE |Internet Explorer/)(?:[0-9.]+)#', $agent) && (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')) {
header('Pragma: ');
header('Cache-Control: ');
} else {
header('Pragma: no-store,no-cache');
header('Cache-Control: no-cache, no-store, must-revalidate, max-age=-1');
header('Cache-Control: post-check=0, pre-check=0', false);
}
header('Expires: Mon, 14 Jul 1789 12:30:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
if (is_resource($file) && get_resource_type($file) == "stream") {
$transport = 'php';
} elseif (!JFile::exists($file)) {
return JText::sprintf("COM_JUDIRECTORY_FILE_NOT_FOUND_X", $fileName);
}
if ($transport != 'php') {
header('Content-Description: File Transfer');
header('Date: ' . @gmdate("D, j M m Y H:i:s ") . 'GMT');
if ($resume) {
header('Accept-Ranges: bytes');
} elseif (isset($_SERVER['HTTP_RANGE'])) {
exit;
}
if (!$downloadMultiParts) {
header('Accept-Ranges: none');
}
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="' . $fileName . '"');
}
switch ($transport) {
case 'apache':
$modules = apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
}
break;
case 'ngix':
$path = preg_replace('/' . preg_quote(JPATH_ROOT, '/') . '/', '', $file, 1);
header('X-Accel-Redirect: ' . $path);
break;
case 'lighttpd':
header('X-LIGHTTPD-send-file: ' . $file);
header('X-Sendfile: ' . $file);
break;
case 'php':
default:
JLoader::register('JUDownload', JPATH_ADMINISTRATOR . '/components/com_judirectory/helpers/judownload.class.php');
JUDirectoryHelper::obCleanData();
$download = new JUDownload($file);
$download->rename($fileName);
if ($mimeType) {
$download->mime($mimeType);
}
if ($resume) {
$download->resume();
}
$download->speed($speed);
$download->start();
if ($download->error) {
return $download->error;
}
unset($download);
break;
}
return true;
}
示例9: testPhpCode
public function testPhpCode()
{
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$field_id = $app->input->post->getInt('field_id', 0);
$plugin_id = $app->input->post->getInt('plugin_id', 0);
$php_code = $app->input->post->get('php_predefined_values', '', 'raw');
if (trim($php_code)) {
if ($plugin_id) {
$db = JFactory::getDbo();
$query = "SELECT folder FROM #__judirectory_plugins WHERE id = " . $plugin_id;
$db->setQuery($query);
$folder = $db->loadResult();
$fieldClassName = 'JUDirectoryField' . $folder;
if ($field_id) {
$fieldObj = new $fieldClassName($field_id);
} else {
$fieldObj = new $fieldClassName();
}
} else {
echo 'No plugin selected';
exit;
}
$fieldObj->php_predefined_values = $php_code;
JUDirectoryHelper::obCleanData(true);
$result = $fieldObj->getPredefinedFunction();
echo '<div class="return">';
var_dump($result);
echo '</div>';
}
exit;
}
示例10: checkInheritedDataWhenChangeParentCat
public function checkInheritedDataWhenChangeParentCat()
{
$app = JFactory::getApplication();
$model = $this->getModel();
$jInput = $app->input;
$data = array();
$data['id'] = $jInput->post->getInt('id');
$data['parent_id'] = $jInput->post->getInt('parent_id');
$data['selected_fieldgroup'] = $jInput->post->getInt('selected_fieldgroup');
$data['selected_criteriagroup'] = $jInput->post->getInt('selected_criteriagroup');
$data['style_id'] = $jInput->post->getInt('style_id');
$result = $model->checkInheritedDataWhenChangeParentCat($data);
JUDirectoryHelper::obCleanData();
$result = json_encode($result);
echo $result;
exit;
}
示例11: switch
if (JUDirectoryHelper::isJoomla3x()) {
JHtml::_('script', 'system/core.js', false, true);
}
$app = JFactory::getApplication();
$task = $app->input->get('task');
switch ($task) {
case 'captcha':
$namespace = $app->input->getString('captcha_namespace', '');
JUDirectoryFrontHelperCaptcha::captchaSecurityImages($namespace);
exit;
break;
case 'rawdata':
$field_id = $app->input->getInt('field_id', 0);
$listing_id = $app->input->getInt('listing_id', 0);
$fieldObj = JUDirectoryFrontHelperField::getField($field_id, $listing_id);
JUDirectoryHelper::obCleanData();
$fieldObj->getRawData();
exit;
break;
case 'cron':
JUDirectoryFrontHelperMail::sendMailq();
exit;
break;
default:
$controller = JControllerLegacy::getInstance('judirectory');
$controller->execute($app->input->get('task'));
$controller->redirect();
break;
}
$params = JUDirectoryHelper::getParams();
if ($params->get('send_mailqs_on_pageload', 0)) {
示例12: changeBLVorder
public function changeBLVorder()
{
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$id = $app->input->getInt('id', 0);
$value = $app->input->getInt('value', 0);
$data = array(0, 1, 2);
$value = JArrayHelper::getValue($data, $value, 0, 'int');
if (!$id) {
die;
}
$model = $this->getModel();
$result = $model->changeBLVorder($id, $value);
JUDirectoryHelper::obCleanData();
if ($result) {
echo $result;
}
exit;
}
示例13: checkDeleteTemplateHasChild
public function checkDeleteTemplateHasChild()
{
$app = JFactory::getApplication();
$jInput = $app->input;
$result = array('status' => 0, 'message' => '');
$data = $jInput->post->get("pluginIDs", array(), 'array');
$dataTemplateId = array();
$dataTemplateTree = array();
foreach ($data as $pluginId) {
$templateId = $this->getTemplateId($pluginId);
if ($templateId) {
$dataTemplateId[] = $templateId;
}
}
$dataTemplateId = array_unique($dataTemplateId);
foreach ($dataTemplateId as $templateId) {
$dataTemplateTree = array_merge($dataTemplateTree, $this->getChildTemplateIdByTree($templateId));
$dataTemplateTree = array_unique($dataTemplateTree);
}
$dataTemplateTree = array_unique($dataTemplateTree);
if (!empty($dataTemplateId) && !empty($dataTemplateTree)) {
if (implode(',', $dataTemplateId) != implode(',', $dataTemplateTree)) {
$result['status'] = 1;
$dataMessage = array();
if (is_array($dataTemplateTree) && count($dataTemplateTree)) {
$dataTemplateTreeString = implode(',', $dataTemplateTree);
$dataMessage = $this->orderTemplateTreeBeforeDelete($dataTemplateTreeString);
}
$html = '<div class="alert alert-warning">' . JText::_('COM_JUDIRECTORY_DELETE_TEMPLATE_WARNING_MESSAGE') . '</div>';
$html .= '<table class="table table-condensed">';
$html .= '<thead>';
$html .= '<tr>';
$html .= '<th>' . JText::_('COM_JUDIRECTORY_TEMPLATE_ID') . '</th>';
$html .= '<th>' . JText::_('COM_JUDIRECTORY_TEMPLATE_TITLE') . '</th>';
$html .= '</tr>';
$html .= '</thead>';
$html .= '<tbody>';
foreach ($dataMessage as $element) {
$html .= '<tr>';
$html .= '<td>' . $element->id . '</td>';
$html .= '<td>' . str_repeat('<span class="gi">—</span>', $element->level - 1) . ' ' . ucfirst($element->title) . '</td>';
$html .= '</tr>';
}
$html .= '</tbody>';
$html .= '</table>';
$result['message'] = $html;
}
}
JUDirectoryHelper::obCleanData();
$result = json_encode($result);
echo $result;
exit;
}
示例14: voteComment
public function voteComment($commentId)
{
$commentObj = JUDirectoryFrontHelperComment::getCommentObject($commentId);
if (!$commentObj) {
return;
}
$vote_up = JFactory::getApplication()->input->getInt('vote_up', 0);
$helpful_votes = intval($commentObj->helpful_votes);
$total_votes = intval($commentObj->total_votes);
$params = JUDirectoryHelper::getParams(null, $commentObj->listing_id);
$allow_vote_down_comment = $params->get('allow_vote_down_comment', 1);
if (!$allow_vote_down_comment) {
$like_system = true;
if ($vote_up != 1) {
$voteType = 0;
$reference = 'unlike';
$total_votes--;
$helpful_votes--;
} else {
$voteType = 1;
$reference = 'like';
$total_votes++;
$helpful_votes++;
}
} else {
$like_system = false;
if ($vote_up != 1) {
$voteType = -1;
$reference = 'vote_down';
$total_votes++;
} else {
$voteType = 1;
$reference = 'vote_up';
$total_votes++;
$helpful_votes++;
}
}
$votedValue = $this->getCommentVotedValue($commentObj->id);
if ($allow_vote_down_comment && $votedValue || $votedValue == $voteType) {
$return = array();
$return['message'] = JText::_('COM_JUDIRECTORY_VOTING_ERROR');
$return['like_system'] = $like_system;
$return['vote_type'] = null;
JUDirectoryHelper::obCleanData();
echo json_encode($return);
exit;
}
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->update('#__judirectory_comments')->set('helpful_votes = ' . $helpful_votes)->set('total_votes = ' . $total_votes)->where('id = ' . $commentObj->id);
$db->setQuery($query);
if ($db->execute()) {
$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('judirectory');
$dispatcher->trigger('onVoteComment', $commentObj, $like_system, $voteType);
$user = JFactory::getUser();
$userId = $user->id;
$logData = array('user_id' => $user->id, 'event' => 'comment.vote', 'item_id' => $commentObj->id, 'listing_id' => $commentObj->listing_id, 'value' => $voteType, 'reference' => $reference);
JUDirectoryFrontHelperLog::addLog($logData);
if ($userId > 0) {
$cookieName = 'judir-comment-vote-' . $commentObj->id . '_' . $userId;
} else {
$ipAddress = JUDirectoryFrontHelper::getIpAddress();
$ipAddress = str_replace('.', '_', $ipAddress);
$cookieName = 'judir-comment-vote-' . $commentObj->id . '_' . $ipAddress;
}
$config = JFactory::getConfig();
$cookie_domain = $config->get('cookie_domain', '');
$cookie_path = $config->get('cookie_path', '/');
setcookie($cookieName, $voteType, time() + 60 * 60 * 24 * 30, $cookie_path, $cookie_domain);
$return = array();
$return['message'] = JText::sprintf('COM_JUDIRECTORY_N_HELPFUL_VOTES_N_TOTAL_VOTES', $helpful_votes, $total_votes);
$return['like_system'] = $like_system;
$return['vote_type'] = $voteType;
} else {
$return = array();
$return['message'] = JText::_('COM_JUDIRECTORY_VOTING_ERROR');
$return['like_system'] = $like_system;
$return['vote_type'] = null;
}
JUDirectoryHelper::obCleanData();
echo json_encode($return);
exit;
}
示例15: export
public function export()
{
$app = JFactory::getApplication();
$filter = $app->input->post->get('jform', array(), 'array');
$exportColumns = $app->input->post->get('col', array(), 'array');
$file_name = $filter['csv_export_file_name'] ? $filter['csv_export_file_name'] : "Export_";
$data = $this->getExportData($exportColumns, $filter);
JUDirectoryHelper::obCleanData();
$file_name = str_replace(' ', '_', $file_name) . "-" . date("Y-m-d") . ".csv";
$this->downloadSendHeaders($file_name);
echo chr(239) . chr(187) . chr(191);
$csv_data = $this->array2csv($data);
echo $csv_data;
exit;
}