• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP K2HelperHTML类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getInput

 public function getInput()
 {
     if (!is_array($this->value)) {
         $this->value = $this->value ? array($this->value) : array();
     }
     return '<div data-widget="extrafieldgroups" data-value="' . implode('|', $this->value) . '">' . K2HelperHTML::extraFieldsGroups($this->name, null, ' ', array('data-role' => 'extra-field-groups-selector'), 'item') . '<div data-role="list"></div></div>';
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:7,代码来源:k2extrafieldgroups.php


示例2: display

 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $user = JFactory::getUser();
     $option = JRequest::getCmd('option');
     $view = JRequest::getCmd('view');
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = $mainframe->getUserStateFromRequest($option . $view . '.limitstart', 'limitstart', 0, 'int');
     $filter_order = $mainframe->getUserStateFromRequest($option . $view . 'filter_order', 'filter_order', '', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($option . $view . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $model = $this->getModel();
     $total = $model->getTotalGroups();
     if ($limitstart > $total - $limit) {
         $limitstart = max(0, (int) (ceil($total / $limit) - 1) * $limit);
         JRequest::setVar('limitstart', $limitstart);
     }
     $extraFieldGroups = $model->getGroups();
     $this->assignRef('rows', $extraFieldGroups);
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $this->assignRef('page', $pageNav);
     JToolBarHelper::title(JText::_('K2_EXTRA_FIELD_GROUPS'), 'k2.png');
     JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
     JToolBarHelper::editList();
     JToolBarHelper::addNew();
     if (K2_JVERSION != '15') {
         JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
     } else {
         $toolbar = JToolBar::getInstance('toolbar');
         $toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
     }
     $this->loadHelper('html');
     K2HelperHTML::subMenu();
     parent::display($tpl);
 }
开发者ID:grchis,项目名称:Site-Auto,代码行数:35,代码来源:view.html.php


示例3: display

 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $user = JFactory::getUser();
     $document = JFactory::getDocument();
     $document->addStyleSheet('//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css');
     $document->addStyleSheet(JURI::root(true) . '/media/k2/assets/css/theme.css?v=2.6.8');
     $document->addStyleSheet(JURI::root(true) . '/media/k2/assets/css/elfinder.min.css?v=2.6.8');
     $type = JRequest::getCmd('type');
     $fieldID = JRequest::getCmd('fieldID');
     if ($type == 'video') {
         $mimes = "'video','audio'";
     } elseif ($type == 'image') {
         $mimes = "'image'";
     } else {
         $mimes = '';
     }
     $this->assignRef('mimes', $mimes);
     $this->assignRef('type', $type);
     $this->assignRef('fieldID', $fieldID);
     if ($mainframe->isAdmin()) {
         $toolbar = JToolBar::getInstance('toolbar');
         if (K2_JVERSION != '15') {
             JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
         } else {
             $toolbar->appendButton('Popup', 'config', 'K2_PARAMETERS', 'index.php?option=com_k2&view=settings');
         }
         JToolBarHelper::title(JText::_('K2_MEDIA_MANAGER'), 'k2.png');
         $this->loadHelper('html');
         K2HelperHTML::subMenu();
     }
     parent::display($tpl);
 }
开发者ID:educakanchay,项目名称:educa,代码行数:33,代码来源:view.html.php


示例4: setFilters

 protected function setFilters()
 {
     // Sorting filter
     $sortingOptions = array('K2_NONE' => 'ordering', 'K2_ID_ASC' => 'id', 'K2_ID_DESC' => 'id.reverse', 'K2_TITLE_ASC' => 'title', 'K2_TITLE_DESC' => 'title.reverse');
     K2Response::addFilter('sorting', JText::_('K2_SORT_BY'), K2HelperHTML::sorting($sortingOptions), false, 'header');
     // Search filter
     K2Response::addFilter('search', JText::_('K2_SEARCH'), K2HelperHTML::search(), false, 'sidebar');
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:8,代码来源:view.json.php


示例5: fetchElement

    function fetchElement($name, $value, &$node, $control_name)
    {
        JHTML::_('behavior.modal');
        $params = JComponentHelper::getParams('com_k2');
        $document = JFactory::getDocument();
        if (version_compare(JVERSION, '1.6.0', 'ge')) {
            JHtml::_('behavior.framework');
        } else {
            JHTML::_('behavior.mootools');
        }
        K2HelperHTML::loadjQuery();
        $mainframe = JFactory::getApplication();
        if (K2_JVERSION != '15') {
            $fieldName = $name;
            if (!$node->attributes()->multiple) {
                $fieldName .= '[]';
            }
            $image = JURI::root(true) . '/administrator/templates/' . $mainframe->getTemplate() . '/images/admin/publish_x.png';
        } else {
            $fieldName = $control_name . '[' . $name . '][]';
            $image = JURI::root(true) . '/administrator/images/publish_x.png';
        }
        $js = "\n\t\tfunction jSelectCategory(id, title, object) {\n\t\t\tvar exists = false;\n\t\t\t\$K2('#categoriesList input').each(function(){\n\t\t\t\t\tif(\$K2(this).val()==id){\n\t\t\t\t\t\talert('" . JText::_('K2_THE_SELECTED_CATEGORY_IS_ALREADY_IN_THE_LIST', true) . "');\n\t\t\t\t\t\texists = true;\n\t\t\t\t\t}\n\t\t\t});\n\t\t\tif(!exists){\n\t\t\t\tvar container = \$K2('<li/>').appendTo(\$K2('#categoriesList'));\n\t\t\t\tvar img = \$K2('<img/>',{class:'remove', src:'" . $image . "'}).appendTo(container);\n\t\t\t\timg.click(function(){\$K2(this).parent().remove();});\n\t\t\t\tvar span = \$K2('<span/>',{class:'handle'}).html(title).appendTo(container);\n\t\t\t\tvar input = \$K2('<input/>',{value:id, type:'hidden', name:'" . $fieldName . "'}).appendTo(container);\n\t\t\t\tvar div = \$K2('<div/>',{style:'clear:both;'}).appendTo(container);\n\t\t\t\t\$K2('#categoriesList').sortable('refresh');\n\t\t\t\talert('" . JText::_('K2_CATEGORY_ADDED_IN_THE_LIST', true) . "');\n\t\t\t}\n\t\t}\n\n\t\t\$K2(document).ready(function(){\n\t\t\t\$K2('#categoriesList').sortable({\n\t\t\t\tcontainment: '#categoriesList',\n\t\t\t\titems: 'li',\n\t\t\t\thandle: 'span.handle'\n\t\t\t});\n\t\t\t\$K2('body').css('overflow-y', 'scroll');\n\t\t\t\$K2('#categoriesList .remove').click(function(){\n\t\t\t\t\$K2(this).parent().remove();\n\t\t\t});\n\t\t});\n\t\t";
        $document->addScriptDeclaration($js);
        $document->addStyleSheet(JURI::root(true) . '/media/k2/assets/css/k2.modules.css?v=2.6.0');
        $current = array();
        if (is_string($value) && !empty($value)) {
            $current[] = $value;
        }
        if (is_array($value)) {
            $current = $value;
        }
        $output = '
		<div class="button2-left">
			<div class="blank">
				<a class="modal btn" title="' . JText::_('K2_CLICK_TO_SELECT_ONE_OR_MORE_CATEGORIES') . '"  href="index.php?option=com_k2&view=categories&task=element&tmpl=component" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">' . JText::_('K2_CLICK_TO_SELECT_ONE_OR_MORE_CATEGORIES') . '</a>
			</div>
		</div>
		<div style="clear:both;"></div>
		';
        JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2' . DS . 'tables');
        $output .= '<ul id="categoriesList">';
        foreach ($current as $id) {
            $row = JTable::getInstance('K2Category', 'Table');
            $row->load($id);
            $output .= '
			<li>
				<img class="remove" src="' . $image . '"/>
				<span class="handle">' . $row->name . '</span>
				<input type="hidden" value="' . $row->id . '" name="' . $fieldName . '"/>
				<span style="clear:both;"></span>
			</li>
			';
        }
        $output .= '</ul>';
        return $output;
    }
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:57,代码来源:categorieslatest.php


示例6: display

 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $user = JFactory::getUser();
     $option = JRequest::getCmd('option');
     $view = JRequest::getCmd('view');
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = $mainframe->getUserStateFromRequest($option . $view . '.limitstart', 'limitstart', 0, 'int');
     $filter_order = $mainframe->getUserStateFromRequest($option . $view . 'filter_order', 'filter_order', 'id', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($option . $view . 'filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
     $filter_state = $mainframe->getUserStateFromRequest($option . $view . 'filter_state', 'filter_state', -1, 'int');
     $search = $mainframe->getUserStateFromRequest($option . $view . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     $model = $this->getModel();
     $total = $model->getTotal();
     $task = JRequest::getCmd('task');
     if ($limitstart > $total - $limit) {
         $limitstart = max(0, (int) (ceil($total / $limit) - 1) * $limit);
         JRequest::setVar('limitstart', $limitstart);
     }
     $tags = $model->getData();
     foreach ($tags as $key => $tag) {
         $tag->numOfItems = $model->countTagItems($tag->id);
         $tag->status = K2_JVERSION == '15' ? JHTML::_('grid.published', $tag, $key) : JHtml::_('jgrid.published', $tag->published, $key, '', $task != 'element');
     }
     $this->assignRef('rows', $tags);
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $this->assignRef('page', $pageNav);
     $lists = array();
     $lists['search'] = $search;
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
     $filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
     $filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
     $lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
     $this->assignRef('lists', $lists);
     JToolBarHelper::title(JText::_('K2_TAGS'), 'k2.png');
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
     JToolBarHelper::editList();
     JToolBarHelper::addNew();
     if (K2_JVERSION != '15') {
         JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
     } else {
         $toolbar = JToolBar::getInstance('toolbar');
         $toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
     }
     $this->loadHelper('html');
     K2HelperHTML::subMenu();
     parent::display($tpl);
 }
开发者ID:Gskflute,项目名称:joomla25,代码行数:54,代码来源:view.html.php


示例7: display

    public function display($cachable = false, $urlparams = array())
    {

        $user = JFactory::getUser();
        if ($user->guest)
        {
            $uri = JFactory::getURI();
            if (K2_JVERSION != '15')
            {
                $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
            }
            else
            {
                $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
            }
            $application = JFactory::getApplication();
            $application->redirect(JRoute::_($url, false), JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'));
        }
        JRequest::setVar('tmpl', 'component');

        $params = JComponentHelper::getParams('com_k2');

        $document = JFactory::getDocument();

        if (version_compare(JVERSION, '1.6.0', 'ge'))
        {
            JHtml::_('behavior.framework');
        }
        else
        {
            JHTML::_('behavior.mootools');
        }

        // Language
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);

        // CSS
        $document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.css?v=2.6.6');

        // JS
        K2HelperHTML::loadjQuery(true);
        $document->addScript(JURI::root(true).'/media/k2/assets/js/k2.js?v=2.6.6&amp;sitepath='.JURI::root(true).'/');

        $this->addViewPath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views');
        $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models');
        $view = $this->getView('comments', 'html');
        $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'comments'.DS.'tmpl');
        $view->addHelperPath(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers');
        $view->display();
    }
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:51,代码来源:comments.php


示例8: fetchElement

    function fetchElement($name, $value, &$node, $control_name)
    {
        $params = JComponentHelper::getParams('com_k2');
        $document = JFactory::getDocument();
        if (version_compare(JVERSION, '1.6.0', 'ge')) {
            JHtml::_('behavior.framework');
        } else {
            JHTML::_('behavior.mootools');
        }
        K2HelperHTML::loadjQuery();
        $mainframe = JFactory::getApplication();
        if (K2_JVERSION != '15') {
            $fieldName = $name;
            $attribute = K2_JVERSION == '25' ? $node->getAttribute('multiple') : $node->attributes()->multiple;
            if (!$attribute) {
                $fieldName .= '[]';
            }
            $image = JURI::root(true) . '/administrator/templates/' . $mainframe->getTemplate() . '/images/admin/publish_x.png';
        } else {
            $fieldName = $control_name . '[' . $name . '][]';
            $image = JURI::root(true) . '/administrator/images/publish_x.png';
        }
        $js = "\n\t\tfunction jSelectItem(id, title, object) {\n\t\t\tvar exists = false;\n\t\t\t\$K2('#itemsList input').each(function(){\n\t\t\t\t\tif(\$K2(this).val()==id){\n\t\t\t\t\t\talert('" . JText::_('K2_THE_SELECTED_ITEM_IS_ALREADY_IN_THE_LIST') . "');\n\t\t\t\t\t\texists = true;\n\t\t\t\t\t}\n\t\t\t});\n\t\t\tif(!exists){\n\t\t\t\tvar container = \$K2('<li/>').appendTo(\$K2('#itemsList'));\n\t\t\t\tvar img = \$K2('<img/>',{'class':'remove', src:'" . $image . "'}).appendTo(container);\n\t\t\t\timg.click(function(){\$K2(this).parent().remove();});\n\t\t\t\tvar span = \$K2('<span/>',{'class':'handle'}).html(title).appendTo(container);\n\t\t\t\tvar input = \$K2('<input/>',{value:id, type:'hidden', name:'" . $fieldName . "'}).appendTo(container);\n\t\t\t\tvar div = \$K2('<div/>',{style:'clear:both;'}).appendTo(container);\n\t\t\t\t\$K2('#itemsList').sortable('refresh');\n\t\t\t\talert('" . JText::_('K2_ITEM_ADDED_IN_THE_LIST', true) . "');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\$K2(document).ready(function(){\n\t\t\t\$K2('#itemsList').sortable({\n\t\t\t\tcontainment: '#itemsList',\n\t\t\t\titems: 'li',\n\t\t\t\thandle: 'span.handle'\n\t\t\t});\n\t\t\t\$K2('#itemsList .remove').click(function(){\n\t\t\t\t\$K2(this).parent().remove();\n\t\t\t});\n\t\t});\n\t\t";
        $document->addScriptDeclaration($js);
        $document->addStyleSheet(JURI::root(true) . '/media/k2/assets/css/k2.modules.css?v=2.6.8');
        $current = array();
        if (is_string($value) && !empty($value)) {
            $current[] = $value;
        }
        if (is_array($value)) {
            $current = $value;
        }
        JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2' . DS . 'tables');
        $output = '<div style="clear:both"></div><ul id="itemsList">';
        foreach ($current as $id) {
            $row = JTable::getInstance('K2Item', 'Table');
            $row->load($id);
            $output .= '
			<li>
				<img class="remove" src="' . $image . '" alt="' . JText::_('K2_REMOVE_ENTRY_FROM_LIST') . '" />
				<span class="handle">' . $row->title . '</span>
				<input type="hidden" value="' . $row->id . '" name="' . $fieldName . '"/>
				<span style="clear:both;"></span>
			</li>
			';
        }
        $output .= '</ul>';
        return $output;
    }
开发者ID:educakanchay,项目名称:educa,代码行数:49,代码来源:items.php


示例9: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $params = JComponentHelper::getParams('com_k2');
     $document = JFactory::getDocument();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         JHtml::_('behavior.framework');
     } else {
         JHTML::_('behavior.mootools');
     }
     K2HelperHTML::loadjQuery();
     $db = JFactory::getDBO();
     $query = 'SELECT m.* FROM #__k2_categories m WHERE trash = 0 ORDER BY parent, ordering';
     $db->setQuery($query);
     $mitems = $db->loadObjectList();
     $children = array();
     if ($mitems) {
         foreach ($mitems as $v) {
             if (K2_JVERSION != '15') {
                 $v->title = $v->name;
                 $v->parent_id = $v->parent;
             }
             $pt = $v->parent;
             $list = @$children[$pt] ? $children[$pt] : array();
             array_push($list, $v);
             $children[$pt] = $list;
         }
     }
     $list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
     $mitems = array();
     foreach ($list as $item) {
         $item->treename = JString::str_ireplace('&#160;', '- ', $item->treename);
         $mitems[] = JHTML::_('select.option', $item->id, '   ' . $item->treename);
     }
     $doc = JFactory::getDocument();
     if (K2_JVERSION != '15') {
         $js = "\n\t\t\t\$K2(document).ready(function(){\n\t\t\t\t\n\t\t\t\t\$K2('#jform_params_catfilter0').click(function(){\n\t\t\t\t\t\$K2('#jformparamscategory_id').attr('disabled', 'disabled');\n\t\t\t\t\t\$K2('#jformparamscategory_id option').each(function() {\n\t\t\t\t\t\t\$K2(this).attr('selected', 'selected');\n\t\t\t\t\t});\n\t\t\t\t\t\$K2('#jformparamscategory_id').trigger('liszt:updated');\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\$K2('#jform_params_catfilter1').click(function(){\n\t\t\t\t\t\$K2('#jformparamscategory_id').removeAttr('disabled');\n\t\t\t\t\t\$K2('#jformparamscategory_id option').each(function() {\n\t\t\t\t\t\t\$K2(this).removeAttr('selected');\n\t\t\t\t\t});\n\t\t\t\t\t\$K2('#jformparamscategory_id').trigger('liszt:updated');\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif (\$K2('#jform_params_catfilter0').attr('checked')) {\n\t\t\t\t\t\$K2('#jformparamscategory_id').attr('disabled', 'disabled');\n\t\t\t\t\t\$K2('#jformparamscategory_id option').each(function() {\n\t\t\t\t\t\t\$K2(this).attr('selected', 'selected');\n\t\t\t\t\t});\n\t\t\t\t\t\$K2('#jformparamscategory_id').trigger('liszt:updated');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (\$K2('#jform_params_catfilter1').attr('checked')) {\n\t\t\t\t\t\$K2('#jformparamscategory_id').removeAttr('disabled');\n\t\t\t\t\t\$K2('#jformparamscategory_id').trigger('liszt:updated');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t";
     } else {
         $js = "\n\t\t\t\$K2(document).ready(function(){\n\t\t\t\t\n\t\t\t\t\$K2('#paramscatfilter0').click(function(){\n\t\t\t\t\t\$K2('#paramscategory_id').attr('disabled', 'disabled');\n\t\t\t\t\t\$K2('#paramscategory_id option').each(function() {\n\t\t\t\t\t\t\$K2(this).attr('selected', 'selected');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\$K2('#paramscatfilter1').click(function(){\n\t\t\t\t\t\$K2('#paramscategory_id').removeAttr('disabled');\n\t\t\t\t\t\$K2('#paramscategory_id option').each(function() {\n\t\t\t\t\t\t\$K2(this).removeAttr('selected');\n\t\t\t\t\t});\n\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif (\$K2('#paramscatfilter0').attr('checked')) {\n\t\t\t\t\t\$K2('#paramscategory_id').attr('disabled', 'disabled');\n\t\t\t\t\t\$K2('#paramscategory_id option').each(function() {\n\t\t\t\t\t\t\$K2(this).attr('selected', 'selected');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (\$K2('#paramscatfilter1').attr('checked')) {\n\t\t\t\t\t\$K2('#paramscategory_id').removeAttr('disabled');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t";
     }
     if (K2_JVERSION != '15') {
         $fieldName = $name . '[]';
     } else {
         $fieldName = $control_name . '[' . $name . '][]';
     }
     $doc->addScriptDeclaration($js);
     $output = JHTML::_('select.genericlist', $mitems, $fieldName, 'class="inputbox" multiple="multiple" size="10"', 'value', 'text', $value);
     return $output;
 }
开发者ID:educakanchay,项目名称:educa,代码行数:48,代码来源:categoriesmultiple.php


示例10: setFormFields

 protected function setFormFields(&$form, $row)
 {
     $form->scope = K2HelperHTML::extraFieldsScopes('scope', $row->scope);
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:4,代码来源:view.json.php


示例11:

    echo $row->id;
    ?>
" class="closeComment"><?php 
    echo JText::_('K2_CANCEL');
    ?>
</a>
								<div class="clr"></div>
							</div>
							<input type="hidden" name="currentValue[]" value="<?php 
    echo $row->commentText;
    ?>
" />
						</td>
						<td class="k2Center">
							<?php 
    echo $this->mainframe->isSite() ? K2HelperHTML::stateToggler($row, $key) : JHTML::_('grid.published', $row, $key);
    ?>
						</td>
						<td>
							<?php 
    if ($this->mainframe->isAdmin() && $row->userID) {
        ?>
							<a href="<?php 
        echo $this->userEditLink . $row->userID;
        ?>
"><?php 
        echo $row->userName;
        ?>
</a>
							<?php 
    } else {
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:31,代码来源:default.php


示例12: getInput

 public function getInput()
 {
     // Load javascript
     JHtml::_('jquery.framework');
     $document = JFactory::getDocument();
     $document->addScript(JURI::root(true) . '/media/k2app/assets/js/fields.js?v=3.0.0');
     // Set values if are not set
     if (!is_array($this->value)) {
         $this->value = array();
     }
     if (!isset($this->value['enabled'])) {
         $this->value['enabled'] = '0';
     }
     if (!isset($this->value['categories'])) {
         $this->value['categories'] = '';
     }
     if (!isset($this->value['recursive'])) {
         $this->value['recursive'] = '';
     }
     // Get some variables from XML
     $this->multiple = (bool) $this->element['k2multiple'];
     $this->recursive = (string) $this->element['k2recursive'];
     $this->mode = (string) $this->element['k2mode'];
     $this->size = (int) $this->element['size'];
     // Build attributes string
     $attributes = '';
     if ($this->multiple) {
         $attributes .= ' multiple="multiple"';
     }
     if ($this->size) {
         $attributes .= ' size="' . $this->size . '"';
     }
     if ($this->mode == 'menu') {
         $attributes .= ' data-mode="k2categoriesmenu"';
     }
     // Init output
     $output = '';
     // First show the category filter switch for multiple instances
     if ($this->multiple) {
         $options = array();
         $options[] = JHtml::_('select.option', '0', JText::_('K2_ALL'));
         $options[] = JHtml::_('select.option', '1', JText::_('K2_SELECT'));
         $output .= K2HelperHTML::radiolist($options, $this->name . '[enabled]', $this->value['enabled'], false, 'data-categories="' . $this->name . '[categories][]"');
         $placeholder = null;
     } else {
         $output .= '<input type="hidden" name="' . $this->name . '[enabled]" value="1" />';
         $placeholder = 'K2_NONE_ONSELECTLISTS';
     }
     // Then the categories list
     $output .= K2HelperHTML::categories($this->name . '[categories][]', $this->value['categories'], $placeholder, null, $attributes);
     // And finally the recursive switch
     if ($this->recursive == 'select') {
         $options = array();
         $options[] = JHtml::_('select.option', '1', JText::_('K2_YES'));
         $options[] = JHtml::_('select.option', '0', JText::_('K2_NO'));
         $output .= '<label>' . JText::_('K2_APPLY_RECUSRIVELY') . '</label>' . K2HelperHTML::radiolist($options, $this->name . '[recursive]', $this->value['recursive'], true);
     } else {
         $output .= '<input type="hidden" name="' . $this->name . '[recursive]" value="' . $this->recursive . '" />';
     }
     // Return
     return $output;
 }
开发者ID:Naldo100,项目名称:k2-v3-dev-build,代码行数:62,代码来源:k2categories.php


示例13: setFormFields

 protected function setFormFields(&$form, $row)
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/html.php';
     $form->state = K2HelperHTML::state('state', $row->state, false, false, 'radio', true);
 }
开发者ID:sofian86,项目名称:k2-v3-dev-build,代码行数:5,代码来源:view.json.php


示例14: setBatchActions

 protected function setBatchActions()
 {
     K2Response::addBatchAction('category', 'K2_CATEGORY', K2HelperHTML::categories('catid', null, 'K2_LEAVE_UNCHANGED'));
     K2Response::addBatchAction('author', 'K2_AUTHOR', '<input data-widget="user" data-null="' . JText::_('K2_LEAVE_UNCHANGED') . '" data-min="0" data-placeholder="' . JText::_('K2_LEAVE_UNCHANGED') . '" type="hidden" name="created_by" value="" />');
     K2Response::addBatchAction('access', 'K2_ACCESS', JHtml::_('access.level', 'access', null, '', array(JHtml::_('select.option', '', JText::_('K2_LEAVE_UNCHANGED')))));
     K2Response::addBatchAction('language', 'K2_LANGUAGE', K2HelperHTML::language('language', '', 'K2_LEAVE_UNCHANGED'));
 }
开发者ID:sofian86,项目名称:k2-v3-dev-build,代码行数:7,代码来源:view.json.php


示例15: display


//.........这里部分代码省略.........
     }
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $filter_trash_options[] = JHTML::_('select.option', 0, JText::_('K2_CURRENT'));
     $filter_trash_options[] = JHTML::_('select.option', 1, JText::_('K2_TRASHED'));
     $lists['trash'] = JHTML::_('select.genericlist', $filter_trash_options, 'filter_trash', '', 'value', 'text', $filter_trash);
     require_once JPATH_COMPONENT . DS . 'models' . DS . 'categories.php';
     $categoriesModel = new K2ModelCategories();
     $categories_option[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_CATEGORY'));
     $categories = $categoriesModel->categoriesTree(NULL, false, false);
     $categories_options = @array_merge($categories_option, $categories);
     $lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'filter_category', '', 'value', 'text', $filter_category);
     $authors = $model->getItemsAuthors();
     $options = array();
     $options[] = JHTML::_('select.option', 0, '- ' . JText::_('K2_NO_USER') . ' -');
     foreach ($authors as $author) {
         $name = $author->name;
         if ($author->block) {
             $name .= ' [' . JText::_('K2_USER_DISABLED') . ']';
         }
         $options[] = JHTML::_('select.option', $author->id, $name);
     }
     $lists['authors'] = JHTML::_('select.genericlist', $options, 'filter_author', '', 'value', 'text', $filter_author);
     $filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_PUBLISHING_STATE'));
     $filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
     $filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
     $lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
     $filter_featured_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_FEATURED_STATE'));
     $filter_featured_options[] = JHTML::_('select.option', 1, JText::_('K2_FEATURED'));
     $filter_featured_options[] = JHTML::_('select.option', 0, JText::_('K2_NOT_FEATURED'));
     $lists['featured'] = JHTML::_('select.genericlist', $filter_featured_options, 'filter_featured', '', 'value', 'text', $filter_featured);
     if ($params->get('showTagFilter')) {
         require_once JPATH_COMPONENT . DS . 'models' . DS . 'tags.php';
         $tagsModel = new K2ModelTags();
         $options = $tagsModel->getFilter();
         $option = new JObject();
         $option->id = 0;
         $option->name = JText::_('K2_SELECT_TAG');
         array_unshift($options, $option);
         $lists['tag'] = JHTML::_('select.genericlist', $options, 'tag', '', 'id', 'name', $tag);
     }
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $languages = JHTML::_('contentlanguage.existing', true, true);
         array_unshift($languages, JHTML::_('select.option', '', JText::_('K2_SELECT_LANGUAGE')));
         $lists['language'] = JHTML::_('select.genericlist', $languages, 'language', '', 'value', 'text', $language);
     }
     $this->assignRef('lists', $lists);
     $total = $model->getTotal();
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $this->assignRef('page', $pageNav);
     JToolBarHelper::title(JText::_('K2_ITEMS'), 'k2.png');
     if ($filter_trash == 1) {
         JToolBarHelper::custom('restore', 'restore.png', 'restore_f2.png', 'K2_RESTORE', true);
         JToolBarHelper::deleteList('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_ITEMS', 'remove', 'K2_DELETE');
     } else {
         $params =& JComponentHelper::getParams('com_k2');
         $toolbar =& JToolBar::getInstance('toolbar');
         JToolBarHelper::customX('featured', 'default.png', 'default_f2.png', 'K2_TOGGLE_FEATURED_STATE');
         JToolBarHelper::publishList();
         JToolBarHelper::unpublishList();
         JToolBarHelper::customX('move', 'move.png', 'move_f2.png', 'K2_MOVE');
         JToolBarHelper::customX('copy', 'copy.png', 'copy_f2.png', 'K2_COPY');
         JToolBarHelper::editList();
         JToolBarHelper::addNew();
         JToolBarHelper::trash('trash');
     }
     $toolbar =& JToolBar::getInstance('toolbar');
     if (K2_JVERSION == '16') {
         JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
     } else {
         $toolbar->appendButton('Popup', 'config', 'K2_PARAMETERS', 'index.php?option=com_k2&view=settings');
     }
     // Import Joomla! content button
     if ($user->gid > 23 && !$params->get('hideImportButton')) {
         $buttonUrl = JURI::base() . 'index.php?option=com_k2&amp;view=items&amp;task=import';
         $buttonText = JText::_('K2_IMPORT_JOOMLA_CONTENT');
         $button = '<a id="K2ImportContentButton" href="' . $buttonUrl . '"><span class="icon-32-archive" title="' . $buttonText . '"></span>' . $buttonText . '</a>';
         $toolbar->appendButton('Custom', $button);
     }
     $this->loadHelper('html');
     K2HelperHTML::subMenu();
     $template = $mainframe->getTemplate();
     $this->assignRef('template', $template);
     $this->assignRef('filter_featured', $filter_featured);
     $this->assignRef('filter_trash', $filter_trash);
     $this->assignRef('user', $user);
     if (K2_JVERSION == '16') {
         $dateFormat = JText::_('K2_J16_DATE_FORMAT');
     } else {
         $dateFormat = JText::_('K2_DATE_FORMAT');
     }
     $this->assignRef('dateFormat', $dateFormat);
     $db =& JFactory::getDBO();
     $nullDate = $db->getNullDate();
     $this->assignRef('nullDate', $nullDate);
     $ordering = ($this->lists['order'] == 'i.ordering' || $this->lists['order'] == 'category' || $this->filter_featured) && !$this->filter_trash;
     $this->assignRef('ordering', $ordering);
     parent::display($tpl);
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:101,代码来源:view.html.php


示例16: display


//.........这里部分代码省略.........
             $categories[$i]->numOfTrashedItems = $categoryModel->countCategoryItems($categories[$i]->id, 1);
         }
         if (K2_JVERSION == '30') {
             $categories[$i]->canChange = $user->authorise('core.edit.state', 'com_k2.category.' . $categories[$i]->id);
         }
         // Detect the category template
         if (K2_JVERSION != '15') {
             $categoryParams = json_decode($categories[$i]->params);
             $categories[$i]->template = $categoryParams->theme;
             $categories[$i]->language = $categories[$i]->language ? $categories[$i]->language : '*';
             if (isset($langsMapping)) {
                 $categories[$i]->language = $langsMapping[$categories[$i]->language];
             }
         } else {
             if (function_exists('parse_ini_string')) {
                 $categoryParams = parse_ini_string($categories[$i]->params);
                 $categories[$i]->template = $categoryParams['theme'];
             } else {
                 $categoryParams = new JParameter($categories[$i]->params);
                 $categories[$i]->template = $categoryParams->get('theme');
             }
         }
         if (!$categories[$i]->template) {
             $categories[$i]->template = 'default';
         }
     }
     $this->assignRef('rows', $categories);
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $this->assignRef('page', $pageNav);
     $lists = array();
     $lists['search'] = $search;
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $filter_trash_options[] = JHTML::_('select.option', 0, JText::_('K2_CURRENT'));
     $filter_trash_options[] = JHTML::_('select.option', 1, JText::_('K2_TRASHED'));
     $lists['trash'] = JHTML::_('select.genericlist', $filter_trash_options, 'filter_trash', '', 'value', 'text', $filter_trash);
     $filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
     $filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
     $filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
     $lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
     require_once JPATH_ADMINISTRATOR . '/components/com_k2/models/categories.php';
     $categoriesModel = K2Model::getInstance('Categories', 'K2Model');
     $categories_option[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_CATEGORY'));
     $categoriesFilter = $categoriesModel->categoriesTree(NULL, true, false);
     $categories_options = @array_merge($categories_option, $categoriesFilter);
     $lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'filter_category', '', 'value', 'text', $filter_category);
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $languages = JHTML::_('contentlanguage.existing', true, true);
         array_unshift($languages, JHTML::_('select.option', '', JText::_('K2_SELECT_LANGUAGE')));
         $lists['language'] = JHTML::_('select.genericlist', $languages, 'language', '', 'value', 'text', $language);
     }
     $this->assignRef('lists', $lists);
     JToolBarHelper::title(JText::_('K2_CATEGORIES'), 'k2.png');
     if ($filter_trash == 1) {
         JToolBarHelper::custom('restore', 'publish.png', 'publish_f2.png', 'K2_RESTORE', true);
         JToolBarHelper::deleteList('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_CATEGORIES', 'remove', 'K2_DELETE');
     } else {
         JToolBarHelper::publishList();
         JToolBarHelper::unpublishList();
         JToolBarHelper::custom('move', 'move.png', 'move_f2.png', 'K2_MOVE', true);
         JToolBarHelper::custom('copy', 'copy.png', 'copy_f2.png', 'K2_COPY', true);
         JToolBarHelper::editList();
         JToolBarHelper::addNew();
         JToolBarHelper::trash('trash');
     }
     if (K2_JVERSION != '15') {
         JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
     } else {
         $toolbar = JToolBar::getInstance('toolbar');
         $toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
     }
     $this->loadHelper('html');
     K2HelperHTML::subMenu();
     $this->assignRef('filter_trash', $filter_trash);
     $template = $mainframe->getTemplate();
     $this->assignRef('template', $template);
     $ordering = ($this->lists['order'] == 'c.ordering' || $this->lists['order'] == 'c.parent, c.ordering') && !$this->filter_trash;
     $this->assignRef('ordering', $ordering);
     // Joomla! 3.0 drag-n-drop sorting variables
     if (K2_JVERSION == '30') {
         if ($ordering) {
             JHtml::_('sortablelist.sortable', 'k2CategoriesList', 'adminForm', strtolower($this->lists['order_Dir']), 'index.php?option=com_k2&view=categories&task=saveorder&format=raw');
         }
         $document = JFactory::getDocument();
         $document->addScriptDeclaration('
         Joomla.orderTable = function() {
             table = document.getElementById("sortTable");
             direction = document.getElementById("directionTable");
             order = table.options[table.selectedIndex].value;
             if (order != \'' . $this->lists['order'] . '\') {
                 dirn = \'asc\';
         } else {
             dirn = direction.options[direction.selectedIndex].value;
         }
         Joomla.tableOrdering(order, dirn, "");
         }');
     }
     parent::display($tpl);
 }
开发者ID:Roma48,项目名称:abazherka_old,代码行数:101,代码来源:view.html.php


示例17: users

 function users()
 {
     $itemID = JRequest::getInt('itemID');
     JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'tables');
     $item = JTable::getInstance('K2Item', 'Table');
     $item->load($itemID);
     if (!K2HelperPermissions::canAddItem() && !K2HelperPermissions::canEditItem($item->created_by, $item->catid)) {
         JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
     }
     $K2Permissions = K2Permissions::getInstance();
     if (!$K2Permissions->permissions->get('editAll')) {
         JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
     }
     JRequest::setVar('tmpl', 'component');
     $mainframe = JFactory::getApplication();
     $params = JComponentHelper::getParams('com_k2');
     $language = JFactory::getLanguage();
     $language->load('com_k2', JPATH_ADMINISTRATOR);
     $document = JFactory::getDocument();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         JHtml::_('behavior.framework');
     } else {
         JHTML::_('behavior.mootools');
     }
     // CSS
     $document->addStyleSheet(JURI::root(true) . '/media/k2/assets/css/k2.css?v=2.6.8');
     // JS
     K2HelperHTML::loadjQuery(true);
     $document->addScript(JURI::root(true) . '/media/k2/assets/js/k2.js?v=2.6.8&amp;sitepath=' . JURI::root(true) . '/');
     $this->addViewPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'views');
     $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models');
     $view = $this->getView('users', 'html');
     $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'views' . DS . 'users' . DS . 'tmpl');
     $view->setLayout('element');
     $view->display();
 }
开发者ID:educakanchay,项目名称:educa,代码行数:36,代码来源:item.php


示例18: display

 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $user =& JFactory::getUser();
     $option = JRequest::getCmd('option');
     $view = JRequest::getCmd('view');
     $limit = $mainframe->ge 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP K2HelperPermissions类代码示例发布时间:2022-05-23
下一篇:
PHP K类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap