本文整理汇总了PHP中NextendElementList类的典型用法代码示例。如果您正苦于以下问题:PHP NextendElementList类的具体用法?PHP NextendElementList怎么用?PHP NextendElementList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NextendElementList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchElement
function fetchElement()
{
$db = JFactory::getDBO();
$lang = JFactory::getLanguage()->getTag();
$query = "SELECT m.category_id AS id, `name_{$lang}` AS title, `name_{$lang}` AS name, m.category_parent_id AS parent_id, m.category_parent_id as parent\r\n FROM #__jshopping_categories AS m\r\n LEFT JOIN #__jshopping_products_to_categories AS f\r\n ON m.category_id = f.category_id\r\n WHERE m.category_publish = 1\r\n ORDER BY ordering";
$db->setQuery($query);
$menuItems = $db->loadObjectList();
$children = array();
if ($menuItems) {
foreach ($menuItems as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
$this->_xml->addChild('option', 'Root')->addAttribute('value', 0);
$optgroup = $this->_xml->addChild('optgroup', '');
$optgroup->addAttribute('label', 'Categories');
if (count($options)) {
foreach ($options as $option) {
$optgroup->addChild('option', htmlspecialchars($option->treename))->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例2: fetchElement
function fetchElement()
{
$this->_xml->addChild('option', 'Please choose')->addAttribute('value', 0);
ob_start();
$api = getNextendFacebook();
$list = array();
if ($api) {
try {
$result = $api->api('/me/albums');
if (count($result['data'])) {
foreach ($result['data'] as $album) {
$list[$album['id']] = $album['name'];
}
}
} catch (Exception $e) {
$list = null;
}
}
if ($list) {
ob_end_clean();
if (count($list)) {
foreach ($list as $id => $name) {
$this->_xml->addChild('option', htmlentities($name))->addAttribute('value', $id);
}
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
if (!$list) {
$html .= ob_get_clean();
}
return $html;
}
示例3: fetchElement
function fetchElement()
{
$db = JFactory::getDBO();
$query = 'SELECT
m.id,
m.title AS name,
m.title,
m.parent_id AS parent,
m.parent_id
FROM #__categories m
WHERE m.published = 1 AND (m.extension = "com_content" OR m.extension = "system")
ORDER BY m.lft';
$db->setQuery($query);
$menuItems = $db->loadObjectList();
$children = array();
if ($menuItems) {
foreach ($menuItems as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
if (count($options)) {
foreach ($options as $option) {
$this->_xml->addChild('option', $option->treename)->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例4: fetchElement
function fetchElement()
{
$v = (array) NextendParse::parse($this->parent->_value);
$_REQUEST['fbpage'] = $v[0];
$this->_xml->addChild('option', 'Please choose')->addAttribute('value', 0);
$js = NextendJavascript::getInstance();
$js->addLibraryJsAssetsFile('dojo', 'element.js');
$js->addLibraryJsFile('dojo', dirname(__FILE__) . '/facebookalbumsbypage.js');
$js->addLibraryJs('dojo', '
new NextendElementFacebookAlbumsbyPage({
val: "' . $v[0] . '",
hidden: "' . $this->parent->_id . '",
listhidden: "' . $this->_id . '",
group: "nextendslidergenerator",
method: "onNextendFacebookPageAlbums"
});
');
ob_start();
$list = null;
NextendPlugin::callPlugin('nextendslidergenerator', 'onNextendFacebookPageAlbums', array(&$list));
if ($list) {
ob_end_clean();
if (count($list)) {
foreach ($list as $id => $name) {
$this->_xml->addChild('option', htmlentities($name))->addAttribute('value', $id);
}
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
if (!$list) {
$html .= ob_get_clean();
}
return $html;
}
示例5: fetchElement
function fetchElement()
{
$css = NextendCss::getInstance();
$css->addCssLibraryFile('element/subform.css');
$html = "<div class='nextend-subform " . NextendXmlGetAttribute($this->_xml, 'class') . "' style='" . NextendXmlGetAttribute($this->_xml, 'style') . "'>";
$this->_value = $this->_form->get($this->_name, $this->_default);
$options = $this->getOptions();
$this->_form->set($this->_name, $this->_value);
if (count($options) === 0) {
return 'No sub form exists...';
}
if (!in_array($this->_form->get($this->_name), $options)) {
$this->_form->set($this->_name, $options[0]);
$this->_value = $this->_form->get($this->_name, $this->_default);
}
$this->setOptions($options);
$html .= parent::fetchElement();
$name = $this->_name;
$js = NextendJavascript::getInstance();
$js->addLibraryJsAssetsFile('dojo', 'element.js');
$js->addLibraryJsAssetsFile('dojo', 'element/subform.js');
$html .= $this->decorateBefore();
$html .= $this->decorateAfter();
$html .= '</div>';
return $html;
}
示例6: fetchElement
function fetchElement()
{
$db = JFactory::getDBO();
$query = 'SELECT m.category_id AS id, m.category_name AS name, m.category_name as title, m.category_parent_id AS parent, m.category_parent_id as parent_id
FROM #__hikashop_category m
WHERE (m.category_published =1 AND m.category_type="product") OR (m.category_type="root" AND m.category_published =0)
ORDER BY m.category_ordering';
$db->setQuery($query);
$menuItems = $db->loadObjectList();
$children = array();
if ($menuItems) {
foreach ($menuItems as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
if (count($options)) {
foreach ($options as $option) {
$this->_xml->addChild('option', htmlspecialchars($option->treename))->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例7: fetchElement
function fetchElement()
{
$db = JFactory::getDBO();
$query = 'SELECT m.* FROM #__easyblog_category m WHERE published = 1 ORDER BY parent_id, ordering';
$db->setQuery($query);
$menuItems = $db->loadObjectList();
$children = array();
if ($menuItems) {
foreach ($menuItems as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
if (count($options)) {
foreach ($options as $option) {
$this->_xml->addChild('option', $option->treename)->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例8: fetchElement
function fetchElement()
{
$menu = explode('|*|', $this->parent->_value);
$currentsection = $this->parent->sections[$menu[0]];
$query = "SELECT DISTINCT \r\n id, \r\n title,\r\n title AS name,\r\n parent_id,\r\n parent_id AS parent\r\n FROM #__js_res_categories\r\n WHERE section_id = " . intval($currentsection->id) . " AND published = 1\r\n ORDER BY name ASC\r\n ";
$db = JFactory::getDBO();
$db->setQuery($query);
$this->_categories = $db->loadObjectList();
$children = array();
if ($this->_categories) {
foreach ($this->_categories as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 1, '', array(), $children, 9999, 0, 0);
$this->_xml->addChild('option', 'Root')->addAttribute('value', 0);
if (count($options)) {
foreach ($options as $option) {
$this->_xml->addChild('option', htmlspecialchars($option->treename))->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例9: fetchElement
function fetchElement()
{
$this->_xml->addChild('option', 'Please choose')->addAttribute('value', 0);
ob_start();
$api = getNextendYoutube();
$list = array();
if ($api) {
$google = $api[0];
$youtube = $api[1];
try {
$playlists = $youtube->playlists->listPlaylists('id,snippet', array('mine' => true));
foreach ($playlists['items'] as $k => $item) {
$list[$item['id']] = $item['snippet']['title'];
}
} catch (Google_ServiceException $e) {
echo sprintf('<p>A service error occurred: <code>%s</code></p>', htmlspecialchars($e->getMessage()));
} catch (Google_Exception $e) {
echo sprintf('<p>An client error occurred: <code>%s</code></p>', htmlspecialchars($e->getMessage()));
}
}
if ($list) {
ob_end_clean();
if (count($list)) {
foreach ($list as $id => $name) {
$this->_xml->addChild('option', htmlentities($name))->addAttribute('value', $id);
}
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
if (!$list) {
$html .= ob_get_clean();
}
return $html;
}
示例10: fetchElement
function fetchElement()
{
$db = JFactory::getDBO();
$query = '';
require JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'config.php';
VmConfig::loadConfig();
$query = 'SELECT a.virtuemart_category_id AS id, b.category_parent_id AS parent_id, b.category_parent_id AS parent, c. category_name AS title ' . 'FROM #__virtuemart_categories AS a ' . 'LEFT JOIN #__virtuemart_category_categories AS b ON a.virtuemart_category_id = b.category_child_id ' . 'LEFT JOIN #__virtuemart_categories_' . VMLANG . ' AS c ON a.virtuemart_category_id = c.virtuemart_category_id ' . 'WHERE a.published = 1 ' . 'ORDER BY a.ordering';
$db->setQuery($query);
$menuItems = $db->loadObjectList();
$children = array();
if ($menuItems) {
foreach ($menuItems as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
$this->_xml->addChild('option', 'Root')->addAttribute('value', 0);
if (count($options)) {
foreach ($options as $option) {
$this->_xml->addChild('option', htmlspecialchars(' - ' . $option->treename))->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
return parent::fetchElement();
}
示例11: fetchElement
function fetchElement()
{
$easings = array("linear" => "Linear", "easeInQuad" => "Quad In", "easeOutQuad" => "Quad Out", "easeInOutQuad" => "Quad In Out", "easeInCubic" => "Cubic In", "easeOutCubic" => "Cubic Out", "easeInOutCubic" => "Cubic In Out", "easeInQuart" => "Quart In", "easeOutQuart" => "Quart Out", "easeInOutQuart" => "Quart In Out", "easeInQuint" => "Quint In", "easeOutQuint" => "Quint Out", "easeInOutQuint" => "Quint In Out", "easeInSine" => "Sine In", "easeOutSine" => "Sine Out", "easeInOutSine" => "Sine In Out", "easeInExpo" => "Expo In", "easeOutExpo" => "Expo Out", "easeInOutExpo" => "Expo In Out", "easeInCirc" => "Circ In", "easeOutCirc" => "Circ Out", "easeInOutCirc" => "Circ In Out", "easeInElastic" => "Elastic In", "easeOutElastic" => "Elastic Out", "easeInOutElastic" => "Elastic In Out", "easeInBack" => "Back In", "easeOutBack" => "Back Out", "easeInOutBack" => "Back In Out", "easeInBounce" => "Bounce In", "easeOutBounce" => "Bounce Out", "easeInOutBounce" => "Bounce In Out");
foreach ($easings as $k => $easing) {
$this->_xml->addChild('option', ucfirst($easing))->addAttribute('value', $k);
}
return parent::fetchElement();
}
示例12: fetchElement
function fetchElement()
{
$easings = array("dojo.fx.easing.linear" => "Linear", "dojo.fx.easing.quadIn" => "Quad_In", "dojo.fx.easing.quadOut" => "Quad_Out", "dojo.fx.easing.quadInOut" => "Quad_In_Out", "dojo.fx.easing.cubicIn" => "Cubic_In", "dojo.fx.easing.cubicOut" => "Cubic_Out", "dojo.fx.easing.cubicInOut" => "Cubic_In_Out", "dojo.fx.easing.quartIn" => "Quart_In", "dojo.fx.easing.quartOut" => "Quart_Out", "dojo.fx.easing.quartInOut" => "Quart_In_Out", "dojo.fx.easing.quintIn" => "Quint_In", "dojo.fx.easing.quintOut" => "Quint_Out", "dojo.fx.easing.quintInOut" => "Quint_In_Out", "dojo.fx.easing.sineIn" => "Sine_In", "dojo.fx.easing.sineOut" => "Sine_Out", "dojo.fx.easing.sineInOut" => "Sine_In_Out", "dojo.fx.easing.expoIn" => "Expo_In", "dojo.fx.easing.expoOut" => "Expo_Out", "dojo.fx.easing.expoInOut" => "Expo_In_Out", "dojo.fx.easing.circIn" => "Circ_In", "dojo.fx.easing.circOut" => "Circ_Out", "dojo.fx.easing.circInOut" => "Circ_In_Out", "dojo.fx.easing.backIn" => "Back_In", "dojo.fx.easing.backOut" => "Back_Out", "dojo.fx.easing.backInOut" => "Back_In_Out", "dojo.fx.easing.bounceIn" => "Bounce_In", "dojo.fx.easing.bounceOut" => "Bounce_Out", "dojo.fx.easing.bounceInOut" => "Bounce_In_Out");
foreach ($easings as $k => $easing) {
$this->_xml->addChild('option', NextendText::_($easing))->addAttribute('value', $k);
}
return parent::fetchElement();
}
示例13: fetchElement
function fetchElement()
{
foreach ($this->parent->sections as $section) {
$this->_xml->addChild('option', htmlspecialchars(ucfirst($section->name)))->addAttribute('value', $section->id);
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例14: fetchElement
function fetchElement()
{
$vmversion = 0;
if (!class_exists('VmConfig') && file_exists(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'config.php')) {
$vmversion = 2;
} else {
if (file_exists(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'compat.joomla1.5.php')) {
$vmversion = 1;
}
}
$db = JFactory::getDBO();
$query = '';
if ($vmversion == 1) {
require_once JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'virtuemart_parser.php';
$query = 'SELECT
a. category_id AS id,
b.category_parent_id AS parent_id,
b.category_parent_id AS parent,
a.category_name AS title,
a.category_name AS name
FROM #__vm_category AS a
LEFT JOIN #__vm_category_xref AS b ON a.category_id = b.category_child_id
WHERE a.category_publish LIKE "Y"
ORDER BY a.list_order';
} else {
if ($vmversion == 2) {
require JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'config.php';
VmConfig::loadConfig();
$query = 'SELECT a.virtuemart_category_id AS id, b.category_parent_id AS parent_id, b.category_parent_id AS parent, c. category_name AS title ' . 'FROM #__virtuemart_categories AS a ' . 'LEFT JOIN #__virtuemart_category_categories AS b ON a.virtuemart_category_id = b.category_child_id ' . 'LEFT JOIN #__virtuemart_categories_' . VMLANG . ' AS c ON a.virtuemart_category_id = c.virtuemart_category_id ' . 'WHERE a.published = 1 ' . 'ORDER BY a.ordering';
} else {
return "Virtuemart not found!";
}
}
$db->setQuery($query);
$menuItems = $db->loadObjectList();
$children = array();
if ($menuItems) {
foreach ($menuItems as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
$this->_xml->addChild('option', 'Root')->addAttribute('value', 0);
if (count($options)) {
foreach ($options as $option) {
$this->_xml->addChild('option', htmlspecialchars($option->treename))->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例15: fetchElement
function fetchElement()
{
$this->_xml->addChild('option', 'Choose a slider')->addAttribute('value', 0);
$options = $this->getOptions();
for ($i = 0; $i < count($options); $i++) {
$this->_xml->addChild('option', htmlspecialchars($options[$i]['title']))->addAttribute('value', $options[$i]['id']);
}
$this->_value = $this->_form->get($this->_name, $this->_default);
return parent::fetchElement();
}