当前位置: 首页>>代码示例>>PHP>>正文


PHP JUDownloadHelper::generateCategoryPath方法代码示例

本文整理汇总了PHP中JUDownloadHelper::generateCategoryPath方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper::generateCategoryPath方法的具体用法?PHP JUDownloadHelper::generateCategoryPath怎么用?PHP JUDownloadHelper::generateCategoryPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JUDownloadHelper的用法示例。


在下文中一共展示了JUDownloadHelper::generateCategoryPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: echo

        ?>
						<?php 
    }
    ?>
						<p class="<?php 
    echo JUDownloadHelper::isJoomla3x() ? "small" : "smallsub";
    ?>
"><?php 
    echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));
    ?>
</p>
					</td>

					<td>
						<?php 
    echo JUDownloadHelper::generateCategoryPath($item->parent_id, " > ", true, true);
    ?>
					</td>
					<td>
						<?php 
    echo $item->access;
    ?>
					</td>
					<td>
						<?php 
    echo '<a href="index.php?option=com_judownload&task=fieldgroup.edit&id=' . $item->fieldgroup_id . '">' . $item->fieldgroup_name . '</a>';
    ?>
					</td>
					<td>
						<?php 
    echo (int) $item->total_documents;
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:default_categories.php

示例2: docChangeCategory

 public function docChangeCategory()
 {
     $app = JFactory::getApplication();
     if ($app->input->get('action', '') == 'update-maincat') {
         $ori_cat_id = $app->input->getInt('ori_cat_id', 0);
         $ori_cat = JUDownloadHelper::getCategoryById($ori_cat_id);
         $data['ori_field_group_id'] = 0;
         $data['new_field_group_id'] = 0;
         $data['new_field_group_name'] = "";
         $data['path'] = "";
         if ($ori_cat) {
             $data['ori_field_group_id'] = $ori_cat->fieldgroup_id;
         }
         $new_cat_id = $app->input->getInt('new_cat_id', 0);
         $rootCat = JUDownloadFrontHelperCategory::getRootCategory();
         $params = JUDownloadHelper::getParams();
         if ($rootCat->id == $new_cat_id && !$params->get('allow_add_doc_to_root', 0)) {
             return "";
         }
         $new_cat = JUDownloadHelper::getCategoryById($new_cat_id);
         if ($new_cat) {
             $db = JFactory::getDbo();
             $query = "SELECT id, name FROM #__judownload_fields_groups WHERE id = " . $new_cat->fieldgroup_id . " AND published = 1";
             $db->setQuery($query);
             $fieldgroup = $db->loadObject();
             if ($fieldgroup) {
                 $data['new_field_group_id'] = $fieldgroup->id;
                 $data['new_field_group_name'] = $fieldgroup->name;
             }
             $data['path'] = JUDownloadHelper::generateCategoryPath($new_cat_id);
         }
         if ($data['ori_field_group_id'] != $data['new_field_group_id']) {
             $data['msg_field_group'] = JText::_('COM_JUDOWNLOAD_CHANGE_MAIN_CATEGORY_CAUSE_CHANGE_FIELD_GROUP_WARNING');
         }
         $documentId = $app->input->getInt('id', 0);
         $data['message_style'] = JText::_('COM_JUDOWNLOAD_INHERIT');
         if ($documentId) {
             $documentObject = JUDownloadHelper::getDocumentById($documentId);
             if ($documentObject->style_id == -1) {
                 $oldStyleObject = JUDownloadFrontHelperTemplate::getTemplateStyleOfCategory($documentId->cat_id);
                 $newStyleObject = JUDownloadFrontHelperTemplate::getTemplateStyleOfCategory($new_cat->id);
                 if ($oldStyleObject->template_id != $newStyleObject->template_id) {
                     $data['msg_style'] = JText::_('COM_JUDOWNLOAD_CHANGE_MAIN_CATEGORY_CAUSE_CHANGE_TEMPLATE_WARNING');
                 }
             }
             $newTemplateStyleObject = JUDownloadFrontHelperTemplate::getTemplateStyleOfCategory($new_cat->id);
             $data['message_style'] = JText::_('COM_JUDOWNLOAD_INHERIT') . ' (' . $newTemplateStyleObject->title . ' [' . $newTemplateStyleObject->template_title . ' ]' . ')';
         }
         return json_encode($data);
     } elseif ($app->input->getInt('action', '') == 'insert_secondary_cat') {
         $cat_id_str = $app->input->get('secondary_cat_id', '', 'string');
         $html = '';
         if (!empty($cat_id_str)) {
             $cat_id_arr = explode(",", $cat_id_str);
             foreach ($cat_id_arr as $key => $cat_id) {
                 $html .= "<li id=\"cat-" . $cat_id . "\"><a class=\"drag-icon\"></a><span>" . JUDownloadHelper::generateCategoryPath($cat_id) . "</span><a href=\"#\" onclick=\"return false\" class=\"remove-secondary-cat\" ><i class=\"icon-minus fa fa-minus-circle\"></i> " . JText::_('COM_JUDOWNLOAD_REMOVE') . "</a></li>";
             }
         }
         return $html;
     }
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:61,代码来源:category.php

示例3: getInput

    protected function getInput()
    {
        $document = JFactory::getDocument();
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);
        $query->select('cat_id_related');
        $query->from('#__judownload_categories_relations');
        $query->where('cat_id = ' . (int) $this->form->getValue('id'));
        $query->order("ordering ASC");
        $db->setQuery($query);
        $relcategories = $db->loadColumn();
        $script = '
		jQuery(document).ready(function($){
			$(".category_list").dragsort({ dragSelector: "li", dragEnd: saveOrder, placeHolderTemplate: "<li class=\'placeHolder\'></li>", dragSelectorExclude: "input, textarea, span, a.removeitem"});

            function saveOrder() {
                var data = $("#gallery li").map(function() { return $(this).data("itemid"); }).get();
            };

			$(".category_list").on("click","a.removeitem", function(event){
				event.preventDefault();
				$(this).closest("li").remove();
			});

			$(".browse_cat").bind("dblclick",function(){
				var id = $(this).find("option:selected").val();
				$.ajax({
			  		type: "POST",
			  		url:"index.php?option=com_judownload&task=categories.loadcategories",
			  		data: {id : id, type : "category"}
				}).done(function(data){
					data = $.parseJSON(data);
					$(".browse_cat").html(data.html);
					$(".active_pathway").html(data.path);
				});
			});

			$(".change_categories").click(function(){
				$(".category_selection").slideToggle(400);
			});

			$("#add_related_categories").click(function(event){
    			event.preventDefault();
    			var has_element = [];
				var current_cat = ' . JFactory::getApplication()->input->get('id', 0) . ';
				$.each( $("option:selected",".browse_cat"), function(key, value ) {
					if($(this).data("noselect")){
						return;
					}

					var selectedValue = $(this).val();
					var selectedText = $(this).text();

  					if(current_cat == selectedValue){
						alert("' . JText::_('COM_JUDOWNLOAD_CAN_NOT_ADD_CATEGORY_ITSELF_AS_RELATED_CATEGORY') . '");
						return;
					}
  					if($(".category_list > li[id=\'category-"+selectedValue+"\']").length <= 0){
  						var path = $(".active_pathway").text() + " > " + selectedText;
  						$("<li id=\\"category-"+selectedValue+"\\"><a class=\\"drag-icon\\"></a><span>"+path+"</span><input type=\\"hidden\\" name=\\"relcategories[]\\" value=\\""+selectedValue+"\\" /> <a href=\\"#\\" class=\\"removeitem\\" ><i class=\\"icon-minus\\"></i> ' . JText::_('COM_JUDOWNLOAD_REMOVE') . '</a></li>").appendTo(".category_list");
   					}else{
  						has_element.push(selectedText);
  					}
				});

                if(has_element.length == 1){
                    alert("' . JText::_('COM_JUDOWNLOAD_CATEGORY_X_ALREADY_EXISTED') . '".replace("%s", has_element[0]));
				}else if(has_element.length > 1){
				    alert("' . JText::_('COM_JUDOWNLOAD_CATEGORIES_X_ALREADY_EXISTED') . '".replace("%s", has_element.join(", ")));
				}
				return false;
			});
		});';
        $document->addScriptDeclaration($script);
        $html = "";
        $html .= "<div class=\"categories\">";
        $html .= "<ul class=\"category_list nav clearfix\">";
        if ($relcategories) {
            foreach ($relcategories as $key => $relcategory) {
                $path = JUDownloadHelper::generateCategoryPath($relcategory);
                $html .= '<li id="category-' . $relcategory . '">';
                $html .= '<a class="drag-icon"></a>';
                $html .= '<span>' . $path . '</span>';
                $html .= '<input type="hidden" name="relcategories[]" value="' . $relcategory . '" />';
                $html .= '<a class="removeitem" href="#"><i class="icon-minus"></i> ' . JText::_('COM_JUDOWNLOAD_REMOVE') . '</a>';
                $html .= "</li>";
            }
        }
        $html .= '</ul>';
        $catId = $this->form->getValue('id', 0);
        $catParentId = !$catId ? JUDownloadFrontHelperCategory::getRootCategory()->id : JUDownloadHelper::getCategoryByID($catId)->parent_id;
        $query = $db->getQuery(true);
        $query->SELECT('title, id, published, parent_id');
        $query->FROM('#__judownload_categories');
        $query->WHERE('parent_id = ' . $catParentId);
        $query->ORDER('lft');
        $db->setQuery($query);
        $categoryList = $db->loadObjectList();
        foreach ($categoryList as $key => $cat) {
            if ($cat->published != 1) {
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:categoriesrelated.php

示例4: foreach

    }
    ?>
				</td>
				<?php 
    foreach ($this->model->fields_use as $field) {
        echo '<td>';
        switch ($field->field_name) {
            case "title":
                if (!$item->main) {
                    $main_cat_id = JUDownloadHelper::getDocumentById($item->id)->cat_id;
                    ?>
								<a href="<?php 
                    echo JRoute::_('index.php?option=com_judownload&view=listcats&cat_id=' . $main_cat_id);
                    ?>
"><?php 
                    echo JUDownloadHelper::generateCategoryPath($main_cat_id);
                    ?>
 </a> >
							<?php 
                }
                if ($item->checked_out) {
                    echo JHtml::_('jgrid.checkedout', $i, $item->checked_out_name, $item->checked_out_time, 'documents.', $canCheckin || $user->authorise('core.manage', 'com_checkin'), 'doc');
                }
                if ($canEdit || $canEditOwn) {
                    ?>
								<a href="<?php 
                    echo JRoute::_('index.php?option=com_judownload&amp;task=document.edit&amp;id=' . $item->id);
                    ?>
">
									<?php 
                    echo $item->title;
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:default_documents.php

示例5:

	if ($app->isSite())
	{
		if ((isset($documentObject->approved) && $documentObject->approved <= 0) || $params->get('can_change_secondary_categories', 1) || $params->get('can_change_main_category', 1))
		{
			$html .= "<a href='#' class='change_categories' onclick='return false;'><i class='icon-folder fa fa-folder-open'></i> " . JText::_('COM_JUDOWNLOAD_CHANGE_CATEGORIES') . "</a>";
		}
	}
	else
	{
		$html .= "<a href='#' class='change_categories' onclick='return false;'><i class='icon-folder fa fa-folder-open'></i> " . JText::_('COM_JUDOWNLOAD_CHANGE_CATEGORIES') . "</a>";
	}

	$html .= '<div class="category_selection" style="display: none;">';
	if ($this->params->get('cat_selection_mode', 'all') == 'drilldown')
	{
		$html .= '<div class="active_pathway">' . JUDownloadHelper::generateCategoryPath($mainCategory->parent_id, 'li') . '</div>';
	}
	$html .= '<input type="hidden" name="' . $this->getName() . '[main]" class="validate-numeric required" id="input-main-cat" value="' . $mainCategory->id . '" />';
	$html .= '<input type="hidden" name="' . $this->getName() . '[secondary]" id="input-secondary-cats" value="' . $secondaryCatIdsStr . '" />';

	
	if ($this->params->get('cat_selection_mode', 'all') == 'all')
	{
		$allCategoryOptions = $this->getAllCategoryOptions();
		$html .= JHtml::_('select.genericlist', $allCategoryOptions, 'browse_cat', 'class="browse_cat" multiple="multiple" size="10"', 'id', 'title', '');
	}
	
	else
	{
		$childCategoryOptions = $this->getChildCategoryOptions($mainCategory->parent_id);
		$html .= JHtml::_('select.genericlist', $childCategoryOptions, 'browse_cat', 'class="browse_cat category_drilldown" multiple="multiple" size="10"', 'id', 'title', '');
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:input.php

示例6:

	<div id="iframe-help"></div>

	<div id="splitterContainer">
		<div id="leftPane">
			<div class="inner-pane">
				<?php 
echo $this->loadTemplate('left');
?>
			</div>
		</div>

		<div id="rightPane">
			<div class="inner-pane">
				<?php 
echo JUDownloadHelper::generateCategoryPath($cat_id, "li", true, false);
?>

				<div class="list-item">
					<form
						action="<?php 
echo JRoute::_('index.php?option=com_judownload&view=listcats&cat_id=' . $cat_id);
?>
"
						method="post" name="adminForm" id="adminForm">
						<?php 
echo $this->loadTemplate('categories');
if ($this->allowAddDoc) {
    echo $this->loadTemplate('documents');
}
?>
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:30,代码来源:default.php


注:本文中的JUDownloadHelper::generateCategoryPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。