本文整理汇总了PHP中JUDownloadHelper::obCleanData方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper::obCleanData方法的具体用法?PHP JUDownloadHelper::obCleanData怎么用?PHP JUDownloadHelper::obCleanData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDownloadHelper
的用法示例。
在下文中一共展示了JUDownloadHelper::obCleanData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rebuildCommentTree
public function rebuildCommentTree()
{
$model = $this->getModel();
JUDownloadHelper::obCleanData();
echo $model->rebuildCommentTree();
exit;
}
示例2: 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('#__judownload_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('#__judownload_template_styles');
$query->where('template_id =' . $templateParentId);
$query->order('lft ASC');
$db->setQuery($query);
$styleObjectList = $db->loadObjectList();
$html = "";
$html .= "<option value=\"\">" . JText::_('COM_JUDOWNLOAD_SELECT_PARENT_TEMPLATE') . "</option>";
if (!empty($styleObjectList)) {
foreach ($styleObjectList as $styleObject) {
$html .= "<option value=\"" . $styleObject->value . "\">" . $styleObject->text . "</option>";
}
}
JUDownloadHelper::obCleanData();
echo $html;
exit;
}
示例3: captchaSecurityImages
public static function captchaSecurityImages($namespace = null)
{
$secureImage = JUDownloadFrontHelperCaptcha::initCaptcha($namespace);
JUDownloadHelper::obCleanData();
$secureImage->show();
$secureImage->getCode();
}
示例4: docChangeCategory
public function docChangeCategory()
{
$model = $this->getModel();
$data = $model->docChangeCategory();
JUDownloadHelper::obCleanData();
echo $data;
exit;
}
示例5: docChangeCategory
public function docChangeCategory()
{
require_once JPATH_ADMINISTRATOR . '/components/com_judownload/models/category.php';
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_judownload/models');
$backendCategoryModel = JModelLegacy::getInstance('Category', 'JUDownloadModel');
$data = $backendCategoryModel->docChangeCategory();
JUDownloadHelper::obCleanData();
echo $data;
exit();
}
示例6: getChartData
public function getChartData()
{
$app = JFactory::getApplication();
$type = $app->input->get('type');
$model = $this->getModel();
$data = $model->getUploadDownloadData($type);
$app = JFactory::getApplication();
$app->setUserState('com_judownload.dashboard.chart.type', $type);
JUDownloadHelper::obCleanData();
echo json_encode($data);
exit;
}
示例7: voteComment
public function voteComment($commentId)
{
$commentObj = JUDownloadFrontHelperComment::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 = JUDownloadHelper::getParams(null, $commentObj->doc_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_JUDOWNLOAD_VOTING_ERROR');
$return['like_system'] = $like_system;
$return['vote_type'] = null;
JUDownloadHelper::obCleanData();
echo json_encode($return);
exit();
}
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->update('#__judownload_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('judownload');
$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,
'doc_id' => $commentObj->doc_id,
'value' => $voteType,
'reference' => $reference
);
//.........这里部分代码省略.........
示例8: updateComment
public function updateComment()
{
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$user = JFactory::getUser();
$model = $this->getModel();
$app = JFactory::getApplication();
$data = $app->input->getArray($_POST);
$documentId = $data['doc_id'];
$commentId = $data['comment_id'];
$canEditComment = JUDownloadFrontHelperPermission::canEditComment($commentId);
$redirectUrl = JRoute::_(JUDownloadHelperRoute::getDocumentRoute($documentId) . '#comment-item-' . $commentId);
if (!$canEditComment)
{
$this->setMessage(JText::_('COM_JUDOWNLOAD_UPDATE_COMMENT_ERROR'));
$this->setRedirect($redirectUrl);
return false;
}
$params = JUDownloadHelper::getParams(null, $documentId);
$ratingValue = $this->validateCriteria($data);
if ($ratingValue)
{
$data = array_merge($data, $ratingValue);
}
else
{
$this->setMessage(JText::_('COM_JUDOWNLOAD_UPDATE_COMMENT_ERROR'));
$this->setRedirect($redirectUrl);
return false;
}
JUDownloadHelper::obCleanData();
if ($model->updateComment($data, $params))
{
$logData = array(
'user_id' => $user->id,
'event' => 'comment.edit',
'item_id' => $commentId,
'doc_id' => $documentId,
'value' => 0,
'reference' => '',
);
JUDownloadFrontHelperLog::addLog($logData);
$this->setMessage(JText::_('COM_JUDOWNLOAD_UPDATE_COMMENT_SUCCESSFULLY'));
$this->setRedirect($redirectUrl);
return true;
}
else
{
$this->setMessage(JText::_('COM_JUDOWNLOAD_UPDATE_COMMENT_ERROR'));
$this->setRedirect($redirectUrl);
return false;
}
}
示例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 #__judownload_plugins WHERE id = " . $plugin_id;
$db->setQuery($query);
$folder = $db->loadResult();
$fieldClassName = 'JUDownloadField' . $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;
JUDownloadHelper::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);
JUDownloadHelper::obCleanData();
$result = json_encode($result);
echo $result;
exit;
}
示例11: 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);
JUDownloadHelper::obCleanData();
if ($result) {
echo $result;
}
exit;
}
示例12: 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_JUDOWNLOAD_FILE_NOT_FOUND_X", $fileName);
}
$transport = 'php';
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 'php':
default:
JLoader::register('JUDownload', JPATH_ADMINISTRATOR . '/components/com_judownload/helpers/judownload.class.php');
JUDownloadHelper::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;
}
示例13: checkPasswordAjax
//.........这里部分代码省略.........
{
if ($interval <= $blockEnterPasswordTime)
{
$passwordStatus = -1;
}
else
{
$session->clear($ss_wrongPasswordTimes);
$session->clear($ss_blockDownloadTime);
$checkPassword = $model->checkPassword($documentId, $password);
if (!$checkPassword)
{
$passwordStatus = 0;
}
else
{
$passwordStatus = 1;
}
}
}
else
{
$session->clear($ss_wrongPasswordTimes);
$session->clear($ss_blockDownloadTime);
$passwordStatus = '';
}
}
}
else
{
$checkPassword = $model->checkPassword($documentId, $password);
if (!$checkPassword)
{
$passwordStatus = 0;
}
else
{
$passwordStatus = 1;
}
}
}
else
{
$passwordStatus = '';
}
if ($passwordStatus == 1)
{
$html = '<div class="alert alert-success">';
$html .= '<button type="button" class="close" data-dismiss="alert">×</button>';
$html .= JText::_('COM_JUDOWNLOAD_VALID_PASSWORD');
$html .= '</div>';
$token = JSession::getFormToken();
$link = JRoute::_('index.php?option=com_judownload&task=download.download&doc_id=' . $documentId . '&' . $token . '=1', false);
$documentObject = JUDownloadHelper::getDocumentById($documentId);
$result = array('status' => '1', 'message' => $html, 'link' => $link, 'id' => $documentObject->id, 'title' => $documentObject->title, 'downloads' => $documentObject->downloads);
}
elseif ($passwordStatus == 0)
{
$wrongPasswordTimes = $session->get($ss_wrongPasswordTimes, 0);
$html = '<div class="alert alert-error">';
$html .= '<button type="button" class="close" data-dismiss="alert">×</button>';
$html .= JText::plural('COM_JUDOWNLOAD_YOU_HAVE_ENTERED_WRONG_PASSWORD_N_TIMES_PLEASE_TRY_AGAIN', $wrongPasswordTimes);
$html .= '</div>';
$result = array('status' => '0', 'message' => $html);
}
elseif ($passwordStatus == -1)
{
$html = '<div class="alert alert-error">';
$html .= '<button type="button" class="close" data-dismiss="alert">×</button>';
if ($blockEnterPasswordTime == 0)
{
$html .= JText::plural('COM_JUDOWNLOAD_YOU_HAVE_ENTERED_WRONG_PASSWORD_OVER_MAX_N_TIMES_YOU_HAVE_BEEN_LOCKED_OUT', $maxWrongPasswordTimes);
}
else
{
$html .= JText::plural('COM_JUDOWNLOAD_YOU_HAVE_ENTERED_WRONG_PASSWORD_OVER_MAX_N_TIMES_YOU_HAVE_BEEN_LOCKED_OUT_FOR_N_SECONDS', $maxWrongPasswordTimes, $blockEnterPasswordTime);
}
$html .= '</div>';
$result = array('status' => '-1', 'message' => $html);
}
else
{
$result = null;
}
JUDownloadHelper::obCleanData();
$result = json_encode($result);
echo $result;
exit;
}
示例14: getGroupIdsByCats
public function getGroupIdsByCats()
{
$db = JFactory::getDbo();
$app = JFactory::getApplication();
$cats = $app->input->get('cats', array(), 'array');
$groupIds = array();
foreach ($cats as $cat) {
$db->setQuery("SELECT fieldgroup_id FROM #__judownload_categories WHERE id = " . $cat);
if ($db->loadResult()) {
$groupIds[] = $db->loadResult();
}
}
$groupIds = array_unique($groupIds);
JUDownloadHelper::obCleanData();
echo json_encode($groupIds);
exit;
}
示例15: 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_JUDOWNLOAD_DELETE_TEMPLATE_WARNING_MESSAGE') . '</div>';
$html .= '<table class="table table-condensed">';
$html .= '<thead>';
$html .= '<tr>';
$html .= '<th>' . JText::_('COM_JUDOWNLOAD_TEMPLATE_ID') . '</th>';
$html .= '<th>' . JText::_('COM_JUDOWNLOAD_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;
}
}
JUDownloadHelper::obCleanData();
$result = json_encode($result);
echo $result;
exit;
}