本文整理汇总了PHP中JModuleHelper类的典型用法代码示例。如果您正苦于以下问题:PHP JModuleHelper类的具体用法?PHP JModuleHelper怎么用?PHP JModuleHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JModuleHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_image
function get_image($num)
{
// used variables
$url = false;
$output = '';
// select the proper image function
if ($this->mode == 'com_content') {
// load necessary com_content View class
if (!class_exists('NSP_GK5_com_content_View')) {
require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view');
}
// generate the com_content image URL only
$url = NSP_GK5_com_content_View::image($this->parent->config, $this->parent->content[$num], true, true);
} else {
if ($this->mode == 'com_k2') {
// load necessary k2 View class
if (!class_exists('NSP_GK5_com_k2_View')) {
require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view');
}
// generate the K2 image URL only
$url = NSP_GK5_com_k2_View::image($this->parent->config, $this->parent->content[$num], true, true);
}
}
// check if the URL exists
if ($url === FALSE) {
return false;
} else {
// if URL isn't blank - return it!
if ($url != '') {
return $url;
} else {
return false;
}
}
}
开发者ID:Roma48,项目名称:abazherka_old,代码行数:35,代码来源:controller.php
示例2: site
function site()
{
$db = JFactory::getDBO();
$user = JFactory::getUSER();
//geting usertype from user
$arrMultiGroups[] = $user->usertype;
//get multigrop names if user have it
$sqlGetMultigroups = "SELECT grp.name FROM #__core_acl_aro_groups as grp, #__noixacl_multigroups multigrp WHERE grp.id = multigrp.id_group AND multigrp.id_user = {$user->id}";
$db->setQuery($sqlGetMultigroups);
$multiGroups = $db->loadObjectList();
if (!empty($multiGroups)) {
foreach ($multiGroups as $mgrp) {
$arrMultiGroups[] = $mgrp->name;
}
}
$queryModules = "SELECT axo_section, axo_value FROM #__noixacl_rules WHERE aco_section = 'com_modules' AND aco_value = 'block' AND aro_value IN ('" . implode("','", $arrMultiGroups) . "')";
$db->setQuery($queryModules);
$hideModules = $db->loadObjectList();
if (!empty($hideModules)) {
jimport('joomla.application.module.helper');
foreach ($hideModules as $module) {
$moduleInstance =& JModuleHelper::getModule(str_replace('mod_', '', $module->axo_section), $module->axo_value);
$moduleInstance->position = NULL;
}
}
}
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:26,代码来源:plugin.php
示例3: count
/**
* Get module by id
*
* @param integer $id The id of the module
* @return object The Module object
* @author Sakis Terz
* @since 1.6.0
*/
public static function &getModule($id)
{
$result = null;
$modules =& JModuleHelper::_load();
$total = count($modules);
for ($i = 0; $i < $total; $i++) {
// Match the id of the module
if ($modules[$i]->id == (int) $id) {
// Found it
$result =& $modules[$i];
break;
// Found it
}
}
// If we didn't find it, and the name is mod_something, create a dummy object
if (is_null($result)) {
$result = parent::getModule('mod_cf_filtering');
if (is_null($result)) {
$result = new stdClass();
$result->id = 0;
$result->title = '';
$result->module = 'mod_cf_filtering';
$result->position = '';
$result->content = '';
$result->showtitle = 0;
$result->control = '';
$result->params = '';
$result->user = 0;
}
}
return $result;
}
开发者ID:alesconti,项目名称:FF_2015,代码行数:40,代码来源:cfmoduleHelper.php
示例4: renderModule
function renderModule()
{
$code = JRequest::getVar('code', '', null, 'string');
$config = JFactory::getConfig();
$secret = $config->get('config.secret');
if ($code != $secret) {
exit;
}
$protect = JRequest::getInt('protect');
$time = time();
if (empty($protect) || $time > $protect + 5 || $time < $protect) {
exit;
}
$id = JRequest::getInt('id');
if (empty($id)) {
exit;
}
$db = JFactory::getDBO();
$db->setQuery('SELECT * FROM #__modules WHERE `id`=' . $id . ' LIMIT 1');
$module = $db->loadObject();
if (empty($module)) {
exit;
}
$module->user = substr($module->module, 0, 4) == 'mod_' ? 0 : 1;
$module->name = $module->user ? $module->title : substr($module->module, 4);
$module->style = null;
$module->module = preg_replace('/[^A-Z0-9_\\.-]/i', '', $module->module);
$params = array();
$lang =& JFactory::getLanguage();
$lang->load($module->module);
echo JModuleHelper::renderModule($module, $params);
exit;
}
开发者ID:naka211,项目名称:kkvn,代码行数:33,代码来源:rendermod.php
示例5: loadModule
/**
* KSSystem::loadModule()
*
* @param mixed $name
* @param mixed $params
* @return
*/
public static function loadModule($name, $params = array())
{
$document = JFactory::getDocument();
$module = JModuleHelper::getModule($name);
$renderer = $document->loadRenderer('module');
return $renderer->render($module, $params, null);
}
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:14,代码来源:system.php
示例6: jdocIncludeModules
function jdocIncludeModules($position)
{
$modules = JModuleHelper::getModules($position);
foreach ($modules as $module) {
echo JModuleHelper::renderModule($module);
}
}
开发者ID:xi,项目名称:kub-template,代码行数:7,代码来源:functions.php
示例7: update_mod
/**
* Function used to update
*
* @param INT $called_frm //Mundhe complet this
*
* @return Array
*
* @since 1.0.0
*/
public function update_mod($called_frm = '0')
{
$lang = JFactory::getLanguage();
$lang->load('mod_quick2cart', JPATH_ROOT);
$comquick2cartHelper = new comquick2cartHelper();
jimport('joomla.application.module.helper');
if (JModuleHelper::getModule('mod_quick2cart')) {
$module = JModuleHelper::getModule('mod_quick2cart');
if (JVERSION < '1.6.0') {
$moduleParams = new JParameter($module->params);
$layout = $moduleParams->get('viewtype');
$ckout_text = $moduleParams->get('checkout_text');
} else {
$moduleParams = json_decode($module->params);
if (!empty($moduleParams)) {
$layout = $moduleParams->viewtype;
$ckout_text = $moduleParams->checkout_text;
}
}
}
if (isset($layout) && isset($ckout_text)) {
$data = $comquick2cartHelper->get_module($layout, $ckout_text);
} else {
$data = $comquick2cartHelper->get_module();
}
echo $data;
jexit();
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:37,代码来源:cart.php
示例8: display
function display($tpl = null)
{
jimport('joomla.html.pane');
$pane = JPane::getInstance('Tabs');
$this->assignRef('pane', $pane);
$model = $this->getModel();
$numOfK2Items = $model->countK2Items();
$this->assignRef('numOfK2Items', $numOfK2Items);
$numOfVmProducts = $model->countVmProducts();
$this->assignRef('numOfVmProducts', $numOfVmProducts);
$numOfK2martProducts = $model->countK2martProducts();
$this->assignRef('numOfK2martProducts', $numOfK2martProducts);
$module = JModuleHelper::getModule('mod_k2mart');
$params = new JRegistry();
$params->loadString($module->params);
$params->set('modLogo', "0");
$params->set('modCSSStyling', "1");
$module->params = $params->toString();
$charts = JModuleHelper::renderModule($module);
$this->assignRef('charts', $charts);
$document = JFactory::getDocument();
$document->addCustomTag('<!--[if lte IE 7]><link href="' . JURI::base() . 'components/com_k2mart/css/style_ie7.css" rel="stylesheet" type="text/css" /><![endif]-->');
$this->loadHelper('html');
K2martHTMLHelper::title('K2MART_DASHBOARD');
K2martHTMLHelper::toolbar();
K2martHTMLHelper::subMenu();
parent::display($tpl);
}
开发者ID:Gskflute,项目名称:joomla25,代码行数:28,代码来源:view.html.php
示例9: doExecute
/**
* Entry point for CLI script
*
* @return void
*
* @since 3.0
*/
public function doExecute()
{
$response = new stdClass();
$response->needsOtp = 'false';
$response->form = "";
// Session check
if (JSession::checkToken('POST')) {
$db = JFactory::getDbo();
// Check if TFA is enabled. If not, just return false
$query = $db->getQuery(true)->select('COUNT(*)')->from('#__extensions')->where('enabled=' . $db->q(1))->where('folder=' . $db->q('twofactorauth'));
$db->setQuery($query);
$tfaCount = $db->loadResult();
if ($tfaCount > 0) {
$username = JRequest::getVar('u', '', 'POST', 'username');
$query = $db->getQuery(true)->select('id, password, otpKey')->from('#__users')->where('username=' . $db->q($username));
$db->setQuery($query);
$result = $db->loadObject();
if ($result && $result->otpKey != '') {
//jimport('sourcecoast.utilities');
//SCStringUtilities::loadLanguage('mod_sclogin');
JFactory::getLanguage()->load('mod_sclogin');
//$password = JRequest::getString('p', '', 'POST', JREQUEST_ALLOWRAW);
//if (JUserHelper::verifyPassword($password, $result->password, $result->id))
//{
$response->needsOtp = 'true';
ob_start();
require JModuleHelper::getLayoutPath('mod_sclogin', 'otp');
$response->form = ob_get_clean();
//}
}
}
}
echo json_encode($response);
exit;
}
开发者ID:q0821,项目名称:esportshop,代码行数:42,代码来源:otpcheck.php
示例10: display
function display()
{
$this->stats = $this->getStats();
require JModuleHelper::getLayoutPath('mod_kunenastats');
$this->document = JFactory::getDocument();
$this->document->addStyleSheet(JURI::root() . 'modules/mod_kunenastats/tmpl/css/kunenastats.css');
}
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:7,代码来源:class.php
示例11: parseJdocTags
public static function parseJdocTags($data)
{
$replace = array();
$matches = array();
if (preg_match_all('#<jdoc:include\\ type="([^"]+)" (.*)\\/>#iU', $data, $matches)) {
$matches[0] = array_reverse($matches[0]);
$matches[1] = array_reverse($matches[1]);
$matches[2] = array_reverse($matches[2]);
$count = count($matches[1]);
for ($i = 0; $i < $count; $i++) {
$attribs = JUtility::parseAttributes($matches[2][$i]);
$type = $matches[1][$i];
if ($type != 'modules') {
continue;
}
$name = isset($attribs['name']) ? $attribs['name'] : null;
if (empty($name)) {
continue;
}
unset($attribs['name']);
jimport('joomla.application.module.helper');
$modules = JModuleHelper::getModules($name);
$moduleHtml = null;
if (!empty($modules)) {
foreach ($modules as $module) {
$moduleHtml .= JModuleHelper::renderModule($module, $attribs);
}
}
$data = str_replace($matches[0][$i], $moduleHtml, $data);
}
}
return $data;
}
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:33,代码来源:block.php
示例12: getAjax
public static function getAjax()
{
jimport('joomla.application.module.helper');
$input = JFactory::getApplication()->input;
$module = JModuleHelper::getModule('hoicoi_openmeetings');
$params = new JRegistry();
$params->loadString($module->params);
$values = explode(',', rtrim($params->get('rooms'), ","));
if (self::getVerification($values, $input->get("room_id"), $input->get("password", "", 'STRING'))) {
$options = array("protocol" => $params->get('protocol'), "port" => $params->get('port'), "host" => $params->get('host'), "webappname" => $params->get('webappname'), "adminUser" => $params->get('adminUser'), "adminPass" => $params->get('adminPass'));
$access = new openmeetings_gateway($options);
if (!$access->loginuser()) {
$data = array("error" => 03, "text" => self::getErrorInfo(03));
return $data;
}
$hash = $access->setUserObjectAndGenerateRoomHash($input->get("name"), $input->get("name", "", 'STRING'), "", "", $input->get("email", "", 'STRING'), JSession::getInstance("", "")->getId(), "Joomla", $input->get("room_id"), self::$isAdmin, self::$isRecodring);
if (preg_match('/\\D/', $hash)) {
$url = $access->getUrl() . "/?secureHash=" . $hash;
//Get final URL
$data = array("url" => $url);
return $data;
} else {
$data = array("error" => $hash, "text" => self::getErrorInfo($hash));
return $data;
}
} else {
$data = array("error" => 02, "text" => self::getErrorInfo(02));
return $data;
}
$data = array("error" => 01, "text" => self::getErrorInfo(01));
return $data;
}
开发者ID:jibon57,项目名称:mod_hoicoi_openmeetings,代码行数:32,代码来源:helper.php
示例13: display
function display($dummy1 = false, $dummy2 = false)
{
$moduleId = JRequest::getInt('formid');
if (empty($moduleId)) {
return;
}
if (JRequest::getInt('interval') > 0) {
setcookie('acymailingSubscriptionState', true, time() + JRequest::getInt('interval'), '/');
}
$db = JFactory::getDBO();
$db->setQuery('SELECT * FROM #__modules WHERE id = ' . intval($moduleId) . ' AND `module` LIKE \'%acymailing%\' LIMIT 1');
$module = $db->loadObject();
if (empty($module)) {
echo 'No module found';
exit;
}
$module->user = substr($module->module, 0, 4) == 'mod_' ? 0 : 1;
$module->name = $module->user ? $module->title : substr($module->module, 4);
$module->style = null;
$module->module = preg_replace('/[^A-Z0-9_\\.-]/i', '', $module->module);
$params = array();
if (JRequest::getInt('autofocus', 0)) {
acymailing_loadMootools();
$js = "\n\t\t\t\twindow = addEvent('load', function(){\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tvar moduleInputs = document.getElementsByTagName('input');\n\t\t\t\t\tif(moduleInputs){\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\twhile(moduleInputs[i].disabled == true){\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(moduleInputs[i]) moduleInputs[i].focus();\n\t\t\t\t\t}\n\t\t\t\t});";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
}
echo JModuleHelper::renderModule($module, $params);
}
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:29,代码来源:sub.php
示例14: load
function load($position)
{
// init vars
$modules = JModuleHelper::getModules($position);
// set params, force no style
$params['style'] = 'none';
// get modules content
foreach ($modules as $index => $module) {
// set module params
$module->parameter = new JRegistry($module->params);
// set parameter show all children for accordion menu
if ($module->module == 'mod_menu') {
if (strpos($module->parameter->get('class_sfx', ''), 'accordion') !== false) {
if ($module->parameter->get('showAllChildren') == 0) {
$module->parameter->set('showAllChildren', 1);
$module->showAllChildren = 0;
} else {
$module->showAllChildren = 1;
}
$module->params = $module->parameter->toString();
}
}
$modules[$index]->content = $this->_renderer->render($module, $params);
}
return $modules;
}
开发者ID:smart-one,项目名称:3kita,代码行数:26,代码来源:modules.php
示例15: button
public static function button($button)
{
ob_start();
require JModuleHelper::getLayoutPath('mod_imageshow_quickicon', 'default_button');
$html = ob_get_clean();
return $html;
}
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:7,代码来源:helper.php
示例16: sendMail
/**
* Send email whith user data from form
*
* @param array $params An object containing the module parameters
*
* @access public
*/
public static function sendMail($params)
{
$sender = $params->get('sender');
$recipient = $params->get('recipient');
$subject = $params->get('subject');
// Getting the site name
$sitename = JFactory::getApplication()->get('sitename');
// Getting user form data-------------------------------------------------
$name = JFilterInput::getInstance()->clean(JRequest::getVar('name'));
$phone = JFilterInput::getInstance()->clean(JRequest::getVar('phone'));
$email = JFilterInput::getInstance()->clean(JRequest::getVar('email'));
$message = JFilterInput::getInstance()->clean(JRequest::getVar('message'));
// Set the massage body vars
$nameLabel = JText::_('MOD_JCALLBACK_FORM_NAME_LABEL_VALUE');
$phoneLabel = JText::_('MOD_JCALLBACK_FORM_PHONE_LABEL_VALUE');
$emailLabel = JText::_('MOD_JCALLBACK_FORM_EMAIL_LABEL_VALUE');
$messageLabel = JText::_('MOD_JCALLBACK_FORM_MESSAGE_LABEL_VALUE');
$emailLabel = $email ? "<b>{$emailLabel}:</b> {$email}" : "";
$messageLabel = $message ? "<b>{$messageLabel}:</b> {$message}" : "";
// Get the JMail ogject
$mailer = JFactory::getMailer();
// Set JMail object params------------------------------------------------
$mailer->setSubject($subject);
$params->get('useSiteMailfrom') ? $mailer->setSender(JFactory::getConfig()->get('mailfrom')) : $mailer->setSender($sender);
$mailer->addRecipient($recipient);
// Get the mail message body
require JModuleHelper::getLayoutPath('mod_jcallback', 'default_email_message');
$mailer->isHTML(true);
$mailer->Encoding = 'base64';
$mailer->setBody($body);
$mailer->Send();
// The mail sending errors will be shown in the Joomla Warning Message from JMail object..
}
开发者ID:WhiskeyMan-Tau,项目名称:JCallback,代码行数:40,代码来源:helper.php
示例17: renderItem
function renderItem(&$item, &$params, &$access)
{
global $mainframe;
$user =& JFactory::getUser();
$item->text = $item->introtext;
$item->groups = '';
$item->readmore = trim($item->fulltext) != '';
$item->metadesc = '';
$item->metakey = '';
$item->created = '';
$item->modified = '';
if ($params->get('readmore') || $params->get('link_titles')) {
if ($params->get('intro_only')) {
// Check to see if the user has access to view the full article
if ($item->access <= $user->get('aid', 0)) {
$itemparams = new JParameter($item->attribs);
$readmoretxt = $itemparams->get('readmore', JText::_('Read more text'));
$item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
$item->linkText = $readmoretxt;
} else {
$item->linkOn = JRoute::_('index.php?option=com_user&view=login');
$item->linkText = JText::_('Login To Read More');
}
}
}
if (!$params->get('image')) {
$item->text = preg_replace('/<img[^>]*>/', '', $item->text);
}
$results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1));
$item->afterDisplayTitle = trim(implode("\n", $results));
$results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1));
$item->beforeDisplayContent = trim(implode("\n", $results));
require JModuleHelper::getLayoutPath('mod_newsflash', '_item');
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:34,代码来源:helper.php
示例18: getAuthorizeURL
public static function getAuthorizeURL()
{
$params =& JComponentHelper::getParams('mod_instagallery');
var_dump($params);
exit;
$myvariable = $params->get('client_id');
var_dump($myvariable);
exit;
$app = JFactory::getApplication();
$mycom_params =& $app->getParams('mod_instagallery');
var_dump($mycom_params);
exit;
$module =& JModuleHelper::getModule('instagallery');
$params = new JForm($module->params);
$params->loadString($module->params);
print $clientID = $params->get('client_id');
exit;
$clientSecret = $params->get('client_secret');
$authCode = $params->get('auth_code');
$accessToken = $params->get('access_token');
$redirec_uri = $params->get('redirect_uri');
$config = array('redirectURI' => $redirec_uri);
$instagram = new jInstaClass($clientID, $clientSecret, '', '', $config);
return $instagram->authURL();
}
开发者ID:grisotto,项目名称:mod_instagallery,代码行数:25,代码来源:helper_old.php
示例19: __construct
public function __construct($params)
{
static $cssadded = false;
require_once KUNENA_PATH_LIB . DS . 'kunena.link.class.php';
require_once KUNENA_PATH_LIB . DS . 'kunena.image.class.php';
require_once KUNENA_PATH_LIB . DS . 'kunena.timeformat.class.php';
require_once KUNENA_PATH_FUNCS . DS . 'latestx.php';
require_once JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/html/parser.php';
$this->kunena_config = KunenaFactory::getConfig();
$this->myprofile = KunenaFactory::getUser();
// load Kunena main language file so we can leverage langaueg strings from it
KunenaFactory::loadLanguage();
// Initialize session
$session = KunenaFactory::getSession();
$session->updateAllowedForums();
$this->document = JFactory::getDocument();
$kloadcss = $params->get('kunena_load_css');
if ($cssadded == false && $kloadcss) {
$this->document->addStyleSheet(JURI::root() . 'modules/mod_kunenalatest/tmpl/css/kunenalatest.css');
$cssadded = true;
}
$this->latestdo = null;
if ($params->get('choosemodel') != 'latest') {
$this->latestdo = $params->get('choosemodel');
}
$this->params = $params;
$this->ktemplate = KunenaFactory::getTemplate();
$this->klistpost = modKunenaLatestHelper::getKunenaLatestList($params);
$this->topic_ordering = modKunenaLatestHelper::getTopicsOrdering($this->myprofile, $this->kunena_config);
require JModuleHelper::getLayoutPath('mod_kunenalatest');
}
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:31,代码来源:class.php
示例20: load
public static function load()
{
if (MagebridgeModelConfig::load('preload_all_modules') == 0 && JRequest::getInt('Itemid') != 0) {
static $modules = null;
if (is_array($modules) == false) {
$modules = JModuleHelper::_load();
foreach ($modules as $index => $module) {
if (strstr($module->module, 'mod_magebridge') == false) {
unset($modules[$index]);
}
}
}
return $modules;
}
$application = JFactory::getApplication();
$db = JFactory::getDBO();
$where = array();
$where[] = 'm.published = 1';
$where[] = 'm.module LIKE "mod_magebridge%"';
$where[] = 'm.client_id = ' . (int) $application->getClientId();
$query = 'SELECT m.*' . ' FROM #__modules AS m' . ' LEFT JOIN #__modules_menu AS mm ON mm.moduleid = m.id' . ' WHERE ' . implode(' AND ', $where) . ' ORDER BY m.position, m.ordering';
$db->setQuery($query);
$modules = $db->loadObjectList();
return $modules;
}
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:25,代码来源:module.php
注:本文中的JModuleHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论