本文整理汇总了PHP中JUDownloadHelper类的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper类的具体用法?PHP JUDownloadHelper怎么用?PHP JUDownloadHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JUDownloadHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getInput
protected function getInput()
{
$html = '';
$db = JFactory::getDbo();
$options = JUDownloadHelper::getFieldGroupOptions();
if ($this->element['usenone'] == 'true') {
array_unshift($options, array('value' => '0', 'text' => JText::_('COM_JUDOWNLOAD_NONE')));
}
if ($this->element['useinherit'] == 'true') {
$appendInherit = "";
if ($this->form->getValue("id")) {
$appendInherit = " ( " . JText::_('COM_JUDOWNLOAD_NONE') . " )";
if ($this->form->getValue("id") > 0) {
$catObj = JUDownloadHelper::getCategoryById($this->form->getValue("parent_id"));
if ($catObj->fieldgroup_id > 1) {
$query = "SELECT name, published FROM #__judownload_fields_groups WHERE id = " . (int) $catObj->fieldgroup_id . " AND id != 1";
$db->setQuery($query);
$fieldgroup = $db->loadObject();
$groupName = $fieldgroup->published != 1 ? "[" . $fieldgroup->name . "]" : $fieldgroup->name;
$appendInherit = "( " . $groupName . " )";
}
}
}
array_unshift($options, array('value' => '-1', 'text' => JText::_('COM_JUDOWNLOAD_INHERIT') . $appendInherit));
} else {
array_unshift($options, array('value' => '', 'text' => JText::_('COM_JUDOWNLOAD_SELECT_FIELD_GROUP')));
}
$required_class = $this->element['required'] == 'true' ? 'required' : '';
$attributes = "class=\"inputbox {$required_class}\"";
$html .= JHtml::_('select.genericlist', $options, $this->name, $attributes, 'value', 'text', $this->value, $this->id);
return $html;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:fieldgroupforcat.php
示例2: display
public function display($tpl = null)
{
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode('<br />', $errors));
return false;
}
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->canDo = JUDownloadHelper::getActions('com_judownload');
$this->addToolBar();
if (JUDownloadHelper::isJoomla3x()) {
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
}
$options = array();
$options[] = JHtml::_('select.option', '1', JText::_('J1'));
$options[] = JHtml::_('select.option', '2', JText::_('J2'));
$options[] = JHtml::_('select.option', '3', JText::_('J3'));
$options[] = JHtml::_('select.option', '4', JText::_('J4'));
$options[] = JHtml::_('select.option', '5', JText::_('J5'));
$options[] = JHtml::_('select.option', '6', JText::_('J6'));
$options[] = JHtml::_('select.option', '7', JText::_('J7'));
$options[] = JHtml::_('select.option', '8', JText::_('J8'));
$options[] = JHtml::_('select.option', '9', JText::_('J9'));
$options[] = JHtml::_('select.option', '10', JText::_('J10'));
$this->f_levels = $options;
$optionsPublished = array();
$optionsPublished[] = JHtml::_('select.option', '1', JText::_('COM_JUDOWNLOAD_PUBLISHED'));
$optionsPublished[] = JHtml::_('select.option', '0', JText::_('COM_JUDOWNLOAD_UNPUBLISHED'));
$this->published_options = $optionsPublished;
parent::display($tpl);
$this->setDocument();
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:view.html.php
示例3: display
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->state = $this->get('State');
$this->pagination = $this->get('Pagination');
$this->params = JUDownloadHelper::getParams();
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->listOrder = $this->escape($this->state->get('list.ordering', 'tag.title'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->order_name_array = array(
'tag.id' => JText::_('COM_JUDOWNLOAD_FIELD_ID'),
'tag.title' => JText::_('COM_JUDOWNLOAD_FIELD_TITLE'),
'tag.created' => JText::_('COM_JUDOWNLOAD_FIELD_CREATED'),
'tag.ordering' => JText::_('COM_JUDOWNLOAD_FIELD_ORDERING')
);
$this->order_dir_array = array('ASC' => JText::_('COM_JUDOWNLOAD_ASC'),
'DESC' => JText::_('COM_JUDOWNLOAD_DESC'));
$this->_prepareDocument();
$this->_setBreadcrumb();
parent::display($tpl);
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:33,代码来源:view.html.php
示例4: addToolBar
protected function addToolBar()
{
$app = JFactory::getApplication();
$app->input->set('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = JUDownloadHelper::getActions('com_judownload');
$user = JFactory::getUser();
$userId = $user->id;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_PAGE_' . ($checkedOut ? 'VIEW_TEMPLATE_STYLE' : ($isNew ? 'ADD_TEMPLATE_STYLE' : 'EDIT_TEMPLATE_STYLE'))), 'style-add');
if ($isNew) {
if ($canDo->get('core.create')) {
JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('style.save2new', 'JTOOLBAR_SAVE_AND_NEW');
JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE');
}
JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CANCEL');
} else {
if ($canDo->get('core.edit')) {
JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY');
if ($canDo->get('core.create')) {
JToolBarHelper::save('style.save2new', 'JTOOLBAR_SAVE_AND_NEW');
}
JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE');
}
JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
$bar = JToolBar::getInstance('toolbar');
$bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judownload/helpers/button");
$bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP'));
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:view.html.php
示例5: __set
public function __set($name, $value)
{
switch ($name) {
case 'height':
case 'width':
case 'assetField':
case 'authorField':
case 'asset':
$this->{$name} = (string) $value;
break;
case 'buttons':
$value = (string) $value;
if ($value == 'true' || $value == 'yes' || $value == '1') {
$this->buttons = true;
} elseif ($value == 'false' || $value == 'no' || $value == '0') {
$this->buttons = false;
} else {
$this->buttons = explode(',', $value);
}
break;
case 'hide':
$value = (string) $value;
$this->hide = $value ? explode(',', $value) : array();
break;
case 'editorType':
$this->editorType = explode('|', trim((string) $value));
break;
default:
if (JUDownloadHelper::isJoomla3x()) {
parent::__set($name, $value);
} else {
$this->{$name} = $value;
}
}
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:35,代码来源:editorsourcecode.php
示例6: populateState
protected function populateState($ordering = null, $direction = null)
{
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '');
$this->setState('filter.search', $search);
$featured = $this->getUserStateFromRequest($this->context . '.filter.featured', 'filter_featured', '');
$this->setState('filter.featured', $featured);
$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_catid', '');
$this->setState('filter.catid', $categoryId);
$license = $this->getUserStateFromRequest($this->context . '.filter.license', 'filter_licenseid', '');
$this->setState('filter.licenseid', $license);
$params = JUDownloadHelper::getParams();
$this->setState('params', $params);
parent::populateState('d.title', 'asc');
$field_display = $this->getUserStateFromRequest($this->context . '.field_display', 'field_display', array());
$this->setState('field_display', $field_display);
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:25,代码来源:embeddocument.php
示例7: rebuildCommentTree
public function rebuildCommentTree()
{
$model = $this->getModel();
JUDownloadHelper::obCleanData();
echo $model->rebuildCommentTree();
exit;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:tools.php
示例8: 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;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:style.php
示例9: approve
function approve($comment_ids)
{
if (!is_array($comment_ids) || empty($comment_ids)) {
$this->setError('COM_JUDOWNLOAD_NO_ITEM_SELECTED');
return false;
}
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_judownload/tables');
$comment_table = JTable::getInstance("Comment", "JUDownloadTable");
$count = 0;
$comment_ids = (array) $comment_ids;
$rootComment = JUDownloadFrontHelperComment::getRootComment();
$docIds = array();
foreach ($comment_ids as $comment_id) {
$comment_table->reset();
if ($comment_table->load($comment_id) && $comment_table->parent_id == $rootComment->id && $comment_table->approved == 0) {
$docIds[$comment_table->doc_id] = $comment_table->doc_id;
}
$user = JFactory::getUser();
$date = JFactory::getDate();
$comment_table->approved = 1;
$comment_table->published = 1;
$comment_table->approved_by = $user->id;
$comment_table->approved_time = $date->toSql();
$comment_table->store();
$count++;
JUDownloadFrontHelperMail::sendEmailByEvent('comment.approve', $comment_id);
$logData = array('user_id' => $comment_table->user_id, 'event' => 'comment.approve', 'item_id' => $comment_id, 'doc_id' => $comment_table->doc_id, 'value' => 0, 'reference' => '');
JUDownloadFrontHelperLog::addLog($logData);
}
foreach ($docIds as $docId) {
JUDownloadHelper::rebuildRating($docId);
}
return $count;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:pendingcomment.php
示例10: loadLanguageForTopLevelCat
public static function loadLanguageForTopLevelCat()
{
$app = JFactory::getApplication();
$view = $app->input->getString('view', '');
$id = $app->input->getInt('id', 0);
if (isset($view))
{
switch ($view)
{
case 'category':
$topLevelCats = JUDownloadHelper::getCatsByLevel(1, $id);
break;
case 'document':
$catId = JUDownloadFrontHelperCategory::getMainCategoryId($id);
$topLevelCats = JUDownloadHelper::getCatsByLevel(1, $catId);
break;
}
if (!empty($topLevelCats))
{
$topLevelCat = $topLevelCats[0];
if ($view == 'category' || $view == 'document')
{
JUDownloadFrontHelperLanguage::loadLanguageFile('com_judownload_' . $topLevelCat->id, JPATH_SITE);
}
}
}
return;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:language.php
示例11: getOptions
protected function getOptions()
{
$document = JFactory::getDocument();
if (JUDownloadHelper::isJoomla3x()) {
$triggerJqueryChosen = '$("#jform_parent_id").trigger("liszt:updated");';
} else {
$triggerJqueryChosen = '';
}
$script = '
jQuery(document).ready(function($){
$("#jform_template_id").change(function(){
var objData = {};
objData.value = $(this).val();
$.ajax({
type: "POST",
url : "index.php?option=com_judownload&task=style.changeTemplateId",
data: objData
}).done(function (data) {
$("option","#jform_parent_id").remove();
$("#jform_parent_id").append(data);
' . $triggerJqueryChosen . '
});
});
});
';
$document->addScriptDeclaration($script);
$db = JFactory::getDbo();
$options = array();
$styleId = $this->form->getValue('id');
if ($styleId) {
$templateId = $this->form->getValue('template_id');
$query = $db->getQuery(true);
$query->select('parent_id');
$query->from('#__judownload_templates');
$query->where('id = ' . (int) $templateId);
$db->setQuery($query);
$templateParentId = $db->loadResult();
} else {
$templateParentId = 0;
}
$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 = ' . (int) $templateParentId);
$query->order('lft ASC');
$db->setQuery($query);
try {
$options = $db->loadObjectList();
} catch (RuntimeException $e) {
JError::raiseWarning(500, $e->getMessage());
}
for ($i = 0, $n = count($options); $i < $n; $i++) {
$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;
}
$options = array_merge(parent::getOptions(), $options);
return $options;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:59,代码来源:style.php
示例12: docChangeCategory
public function docChangeCategory()
{
$model = $this->getModel();
$data = $model->docChangeCategory();
JUDownloadHelper::obCleanData();
echo $data;
exit;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:8,代码来源:categories.php
示例13: populateState
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
$catId = $app->input->getInt('id', 1);
$params = JUDownloadHelper::getParams($catId);
$this->setState('params', $params);
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:9,代码来源:categories.php
示例14: getCriteriaGroupIdByCategoryId
public static function getCriteriaGroupIdByCategoryId($mainCatId)
{
$catObj = JUDownloadHelper::getCategoryById($mainCatId);
if ($catObj)
{
return $catObj->criteriagroup_id;
}
return null;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:10,代码来源:criteria.php
示例15: 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();
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:11,代码来源:categories.php
示例16: loadFormData
protected function loadFormData()
{
$data = JFactory::getApplication()->getUserState('com_judownload.edit.criteria.data', array());
if (empty($data)) {
$data = $this->getItem();
}
if (JUDownloadHelper::isJoomla3x()) {
$this->preprocessData('com_judownload.criteria', $data);
}
return $data;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:11,代码来源:criteria.php
示例17: populateState
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
$rootCategory = JUDownloadFrontHelperCategory::getRootCategory();
$categoryId = $app->input->getInt('id', $rootCategory->id);
$this->setState('category.id', $categoryId);
$params = JUDownloadHelper::getParams($categoryId);
$this->setState('params', $params);
if ($this->context)
{
$documentPagination = $params->get('document_pagination', 10);
$limitArray = JUDownloadFrontHelper::customLimitBox();
if (is_array($limitArray) && count($limitArray))
{
$limit = $app->input->getUint('limit', null);
if (is_null($limit) || in_array($limit, $limitArray))
{
$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $documentPagination, 'uint');
}
else
{
$limit = $documentPagination;
}
}
else
{
$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $documentPagination, 'uint');
}
$this->setState('list.limit', $limit);
$this->setState('list.start', $app->input->getUint('limitstart', 0));
$orderCol = $app->getUserStateFromRequest($this->context . '.list.ordering', 'filter_order', '');
$this->setState('list.ordering', $orderCol);
$listOrder = $app->getUserStateFromRequest($this->context . '.list.direction', 'filter_order_Dir', 'ASC');
$this->setState('list.direction', $listOrder);
}
else
{
$this->setState('list.start', 0);
$this->state->set('list.limit', 0);
}
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:53,代码来源:featured.php
示例18: 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;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:12,代码来源:dashboard.php
示例19: calculatorInheritStyle
protected function calculatorInheritStyle($cat_id)
{
do {
$category = JUDownloadHelper::getCategoryById($cat_id);
$style_id = $category->style_id;
$cat_id = $category->parent_id;
} while ($style_id == -1 && $cat_id != 0);
if ($style_id == -2) {
return $this->getStyle();
} else {
return $this->getStyle($style_id);
}
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:13,代码来源:componenttemplatestyle.php
示例20: back
public function back()
{
$app = JFactory::getApplication();
$doc_id = $app->input->getInt('doc_id', 0);
$cat_id = JUDownloadFrontHelperCategory::getRootCategory()->id;
if ($doc_id) {
$docObj = JUDownloadHelper::getDocumentById($doc_id);
if (isset($docObj->cat_id) && $docObj->cat_id) {
$cat_id = $docObj->cat_id;
}
}
$this->setRedirect("index.php?option=com_judownload&view=listcats&cat_id={$cat_id}");
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:13,代码来源:comments.php
注:本文中的JUDownloadHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论