public static function getForms($url = '', &$type = '', $grouping = '') { $app = JFactory::getApplication(); $items = array(); if (is_object($url)) { $option = $url->get('option', ''); $view = $url->get('view', ''); } elseif ($url != 'none') { $option = $app->input->get('option', ''); $view = $app->input->get('view', ''); } else { $option = ''; } $in = ''; $where = ''; if ($option) { $where = 'WHERE a.component = "' . $option . '"'; if ($view) { $where .= ' AND ( a.view = "' . $view . '" OR a.view = "" )'; } } $locations = JCckDatabase::loadObjectList('SELECT a.name, a.vars FROM #__cck_core_objects AS a ' . $where); if (count($locations)) { $state = true; foreach ($locations as $location) { if ($location->vars) { $state = JCckDevHelper::matchUrlVars($location->vars, $url); } if ($state !== false) { $in .= '"' . $location->name . '",'; } } } if ($in) { $type = substr($in, 1, -2); $in .= '""'; if ($grouping == 'folder') { $call = 'loadObjectListArray'; $index = 'folder_id'; $order_by = ' ORDER BY folder ASC, title ASC'; } else { $call = 'loadObjectList'; $index = NULL; $order_by = ' ORDER BY title'; } $items = JCckDatabase::$call('SELECT a.id, a.title, a.name, a.description, b.id as folder_id, b.title as folder, b.app as folder_app, b.icon_path as folder_icon' . ' FROM #__cck_core_types AS a' . ' LEFT JOIN #__cck_core_folders AS b ON b.id = a.folder' . ' WHERE a.published = 1 AND a.location != "none" AND a.location != "site"' . ' AND a.storage_location IN (' . $in . ')' . $order_by, $index); } return $items; }
/** * @version SEBLOD 3.x Core ~ $Id: mod_cck_list.php sebastienheraud $ * @package SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder) * @url http://www.seblod.com * @editor Octopoos - www.octopoos.com * @copyright Copyright (C) 2013 SEBLOD. All Rights Reserved. * @license GNU General Public License version 2 or later; see _LICENSE.php **/ defined('_JEXEC') or die; $show = $params->get('url_show', ''); $hide = $params->get('url_hide', ''); if ($show && JCckDevHelper::matchUrlVars($show) === false) { return; } if ($hide && JCckDevHelper::matchUrlVars($hide) !== false) { return; } $app = JFactory::getApplication(); $uniqId = 'm' . $module->id; $formId = 'seblod_form_' . $uniqId; if (!defined('JPATH_LIBRARIES_CCK')) { define('JPATH_LIBRARIES_CCK', JPATH_SITE . '/libraries/cck'); } if (!defined('JROOT_MEDIA_CCK')) { define('JROOT_MEDIA_CCK', JURI::root(true) . '/media/cck'); } JCck::loadjQuery(); JFactory::getLanguage()->load('com_cck_default', JPATH_SITE); require_once JPATH_SITE . '/components/com_cck/helpers/helper_include.php'; $preconfig = array();