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


PHP JParameter::set方法代码示例

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


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

示例1: onBeforeDisplayContent

	function onBeforeDisplayContent( &$article, &$params, $limitstart ){
		//this may fire fron a component other than com_content
		
		if(!file_exists(JPATH_SITE.DS.'plugins'.DS.'system'.DS.'myApiConnectFacebook.php') || ( !array_key_exists('category',$article) && !array_key_exists('showK2Plugins',$params)  )){ return; }
		
		if((@$article->id != '') && (@$_POST['fb_sig_api_key'] == '') && class_exists('plgSystemmyApiOpenGraph')){
			$row = & JTable::getInstance('content');
			$row->load($article->id);
			$attribs = new JParameter($row->attribs);
			if($attribs->get('ogimage','') == ''){
				$attribs->set('ogimage',plgContentmyApiOpenGraphContent::getContentImage($article->text));
				$row->attribs = $attribs->toString();
				$row->bind($row);
				$row->store();
			}
			//Set open graph tags
			if(JRequest::getVar('view','','get') == 'article' || (JRequest::getVar('option','','get') == 'com_k2' && JRequest::getVar('view','','get') == 'item')){
				if(isset($article->slug)){
					require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
					$link = ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid);
				}elseif(method_exists('K2HelperRoute','getItemRoute')){
					$link = K2HelperRoute::getItemRoute($article->id.':'.urlencode($article->alias),$article->catid.':'.urlencode($article->category->alias));
				}else{
					error_log('myApi unable to calculate link for the article id '.$article->id);
					return;
				}
				$u =& JURI::getInstance( JURI::base().$link );
				$port 	= ($u->getPort() == '') ? '' : ":".$u->getPort();
				$articleURL = 'http://'.$u->getHost().$port.$u->getPath().'?'.$u->getQuery();
				$rawText = strip_tags($article->introtext);
				$newTags = array();
				$newTags['og:title'] 		= $article->title;
				$newTags['og:description'] 	= (strlen($rawText) > 247) ? substr($rawText,0,247).'...' : $rawText;
				$newTags['og:type']	= 'article';
				$newTags['og:author']	= (is_object($article->author)) ? $article->author->name : $article->author;
				$newTags['og:url'] 	= $articleURL;
				if($attribs->get('ogimage','0') != '0') $newTags['og:image'] = $attribs->get('ogimage');
				
				plgSystemmyApiOpenGraph::setTags($newTags);
			}
		}
	}
开发者ID:rhumme,项目名称:myApi,代码行数:42,代码来源:myApiOpenGraphContent.php

示例2: render

 public function render()
 {
     $page = $this->getObject('application.pages')->getActive();
     $params = new JParameter($page->params);
     $folders = $this->_getFolders();
     $this->folders = $folders['items'];
     $files = $this->_getFiles();
     $this->files = $files['items'];
     $this->total = $files['total'];
     $folder = $this->getModel()->getRow();
     if ($page->getLink()->query['folder'] !== $folder->path) {
         $path = explode('/', $folder->path);
         $parent = count($path) > 1 ? implode('/', array_slice($path, 0, count($path) - 1)) : '';
         $params->set('page_title', ucfirst(end($path)));
     } else {
         $parent = null;
         $params->set('page_title', $page->title);
     }
     $this->parent = $parent;
     $this->params = $params;
     $this->page = $page;
     $this->thumbnail_size = array('x' => 200, 'y' => 150);
     $this->setPathway();
     return parent::render();
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:25,代码来源:html.php

示例3: generateSitemap

 function generateSitemap()
 {
     jimport('joomla.html.parameter');
     $db =& JFactory::getDBO();
     $doc =& JFactory::getDocument();
     //load the style
     $doc->addStyleSheet(JURI::root(true) . '/components/com_rsseo/style.css');
     //get selected menus
     $db->setQuery("SELECT ConfigValue FROM #__rsseo_config WHERE ConfigName = 'sitemap_menus' ");
     $menus = $db->loadResult();
     //get excluded items
     $db->setQuery("SELECT ConfigValue FROM #__rsseo_config WHERE ConfigName = 'sitemap_excludes' ");
     $excludes = $db->loadResult();
     if (empty($menus)) {
         return '';
     }
     $menus = explode(',', $menus);
     $return = '';
     if (!empty($menus)) {
         foreach ($menus as $menu) {
             $params = new JParameter('');
             $params->set('menutype', $menu);
             $params->set('ignore', $excludes);
             $html = rsseoHelper::render($params, 'rsseoCallback');
             if (empty($html)) {
                 continue;
             }
             $db->setQuery("SELECT title FROM #__menu_types WHERE menutype = '" . $db->getEscaped($menu) . "'");
             $title = $db->loadResult();
             $return .= '<div class="rsseo_title">' . $title . '</div>';
             $return .= $html;
         }
     }
     return $return;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:35,代码来源:helper.php

示例4: array

 static function &geTtoolbarParams($editor, $args = array())
 {
     if (count($args) > 1) {
         $row = $args[1];
     }
     if (is_a($args[0], 'JParameter')) {
         $params = $args[0];
     } else {
         if ($row) {
             $params = new JParameter($row->params);
         } else {
             $row =& JCKHelper::getTable('toolbar');
             // load the row from the db table
             $row->load($args[0]);
             //get toolbar parameter
             $params = new JParameter($row->params);
         }
     }
     $editor_params = new JParameter($editor->params);
     $toolbar = $params->get('toolbar', $row->name);
     $skins = $params->get('skin', $editor_params->def('skin', 'office2003'));
     $width = $params->get('wwidth', $editor_params->def('wwidth', '100%'));
     $editor_params->set('toolbar', $toolbar);
     $editor_params->set('skin', $skins);
     $editor_params->set('wwidth', $width);
     $editor_params->Set('hheight', 300);
     return $editor_params;
 }
开发者ID:,项目名称:,代码行数:28,代码来源:

示例5: run

 function run($form, $actiondata)
 {
     $params = new JParameter($actiondata->params);
     $mainframe =& JFactory::getApplication();
     //save the data to db
     $db_save_details = $actiondata;
     $db_save_details->type = 'db_save';
     //create params
     $db_save_details_params = new JParameter('');
     $db_save_details_params->set('table_name', $mainframe->getCfg('dbprefix') . 'content');
     $db_save_details_params->set('model_id', 'Article');
     $db_save_details->params = $db_save_details_params->toString();
     //set data
     $user =& JFactory::getUser();
     $form->data['created_by'] = $user->id;
     $form->data['created'] = date("Y-m-d H:i:s");
     $form->data['catid'] = $params->get('catid', '');
     $form->data['sectionid'] = $params->get('sectionid', 0);
     $form->data['state'] = $params->get('state', 0);
     $form->data['title'] = $form->data[$params->get('title', '')];
     $form->data['fulltext'] = $form->data[$params->get('fulltext', '')];
     $form->data['introtext'] = isset($form->data[$params->get('introtext', '')]) ? $form->data[$params->get('introtext', '')] : '';
     $form->data['created_by_alias'] = $form->data[$params->get('created_by_alias', '')];
     //alias
     $form->data['alias'] = JFilterOutput::stringURLSafe($form->data['title']);
     $form->data['id'] = null;
     //$form->data['alias'] = null;
     $form->runAction($db_save_details);
 }
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:29,代码来源:submit_article.php

示例6: onGroupJoin

 public function onGroupJoin($group, $userId)
 {
     //@rule: Clear existing invites fromt he invitation table once the user joined the group
     $groupInvite =& JTable::getInstance('GroupInvite', 'CTable');
     if ($groupInvite->load($group->id, $userId)) {
         $groupInvite->delete();
     }
     $member =& JTable::getInstance('GroupMembers', 'CTable');
     $member->load($userId, $group->id);
     $params = $group->getParams();
     //@rule: Send notification when necessary
     if ($params->get('joinrequestnotification') || $params->get('newmembernotification')) {
         $user = CFactory::getUser($userId);
         $subject = JText::sprintf('CC NEW MEMBER JOIN EMAIL SUBJECT', $user->getDisplayName(), $group->name);
         if (!$member->approved) {
             $subject = JText::sprintf('CC NEW MEMBER REQUESTED TO JOIN GROUP EMAIL SUBJECT', $user->getDisplayName(), $group->name);
         }
         // Add notification
         CFactory::load('libraries', 'notification');
         $params = new JParameter('');
         $params->set('url', 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id);
         $params->set('group', $group->name);
         $params->set('user', $user->getDisplayName());
         $params->set('approved', $member->approved);
         CNotificationLibrary::add('groups.member.join', $user->id, $group->ownerid, $subject, '', 'groups.memberjoin', $params);
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:27,代码来源:groups.trigger.php

示例7: saveItemPrices

 function saveItemPrices($d)
 {
     $params = new JParameter();
     $params->set('price_powerseller', JArrayHelper::getValue($d, 'price_powerseller'));
     $params->set('price_verified', JArrayHelper::getValue($d, 'price_verified'));
     $params->set('category_pricing_enabled', JArrayHelper::getValue($d, 'category_pricing_enabled'));
     $p = $params->toString('INI');
     $price = JArrayHelper::getValue($d, 'default_price');
     $currency = JArrayHelper::getValue($d, 'currency');
     $db = $this->getDbo();
     $db->setQuery("update `#__" . APP_PREFIX . "_pricing`\r\n            set `price`='{$price}',`currency`='{$currency}',\r\n            `params`='{$p}'\r\n            where `itemname`='" . $this->name . "'");
     $db->query();
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:13,代码来源:featured.php

示例8: sendCommentNotification

 public static function sendCommentNotification(CTableWall $wall, $message)
 {
     CFactory::load('libraries', 'notification');
     $my = CFactory::getUser();
     $targetUser = CFactory::getUser($wall->post_by);
     $url = 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $wall->contentid;
     $params = $targetUser->getParams();
     $params = new JParameter('');
     $params->set('url', $url);
     $params->set('message', $message);
     CNotificationLibrary::add('events.submit.wall.comment', $my->id, $targetUser->id, JText::sprintf('PLG_WALLS WALL COMMENT EMAIL SUBJECT', $my->getDisplayName()), '', 'events.wallcomment', $params);
     return true;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:13,代码来源:events.php

示例9: edit

 /**
  * Edit a connection
  */
 function edit()
 {
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     $row =& JTable::getInstance('visualization', 'Table');
     if ($this->_task == 'edit') {
         $cid = JRequest::getVar('cid', array(0), 'method', 'array');
         $cid = array((int) $cid[0]);
     } else {
         $cid = array(0);
     }
     $row->load($cid[0]);
     if ($cid) {
         $row->checkout($user->get('id'));
     }
     // get params definitions
     $params = new fabrikParams($row->attribs, JPATH_COMPONENT . DS . 'xml' . DS . 'visualization.xml');
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'visualization.php';
     //build list of visualization plugins
     $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
     $pluginManager->getPlugInGroup('visualization');
     $lists['plugins'] = $pluginManager->getElementTypeDd($row->plugin, 'plugin', 'class="inputbox"');
     //build list of menus
     $lists['menuselect'] = FabrikHelperMenu::MenuSelect();
     if ($row->id != '') {
         //only existing tables can have a menu linked to them
         $and = "\n AND link LIKE 'index.php?option=com_fabrik&view=visualization%'";
         $and .= " AND params LIKE '%visualizationid=" . $row->id . "%'";
         $menus = FabrikHelperMenu::Links2Menu('component', $and);
     } else {
         $menus = null;
     }
     //get table and connection drop downs
     $db->setQuery("SELECT id AS value, label AS text FROM #__fabrik_tables");
     $rows = $db->loadObjectList();
     $default = '';
     $lists['tables'] = JHTML::_('select.genericlist', $rows, 'table[]', "class=\"inputbox\"  size=\"1\" ", 'value', 'text', $default);
     // Create the form
     $form = new JParameter('', JPATH_COMPONENT . DS . 'models' . DS . 'visualization.xml');
     $form->bind($row);
     $form->set('created', JHTML::_('date', $row->created, '%Y-%m-%d %H:%M:%S'));
     $form->set('publish_up', JHTML::_('date', $row->publish_up, '%Y-%m-%d %H:%M:%S'));
     if ($cid[0] == 0 || $form->get('publish_down') == '' || $form->get('publish_down') == $db->getNullDate()) {
         $form->set('publish_down', JText::_('NEVER'));
     } else {
         $form->set('publish_down', JHTML::_('date', $row->publish_down, '%Y-%m-%d %H:%M:%S'));
     }
     FabrikViewVisualization::edit($row, $params, $lists, $menus, $pluginManager, $form);
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:52,代码来源:visualization.php

示例10: up

 /**
  * Up
  **/
 public function up()
 {
     $query = "CREATE TABLE IF NOT EXISTS `jos_announcements` (\n\t\t\t\t\t\t`id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t`scope` varchar(100) DEFAULT NULL,\n\t\t\t\t\t\t`scope_id` int(11) DEFAULT NULL,\n\t\t\t\t\t\t`content` text,\n\t\t\t\t\t\t`priority` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`created_by` int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`state` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`sticky` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
     $this->db->setQuery($query);
     $this->db->query();
     $params = array('plugin_access' => 'members', 'display_tab' => 1);
     $this->addPluginEntry('groups', 'announcements', 1, $params);
     //get citation params
     if ($this->db->tableExists('#__extensions')) {
         $sql = "SELECT `params` FROM `#__extensions` WHERE `type`='plugin' AND `element`='messages' AND `folder` = 'groups'";
     } else {
         $sql = "SELECT `params` FROM `#__plugins` WHERE `element`='messages' AND `folder`='groups'";
     }
     $this->db->setQuery($sql);
     $p = $this->db->loadResult();
     //load params object
     $params = new \JParameter($p);
     //set param to hide messages tab
     $params->set('display_tab', 0);
     //save new params
     if ($this->db->tableExists('#__extensions')) {
         $query = "UPDATE `#__extensions` SET `params`=" . $this->db->quote(json_encode($params->toArray())) . " WHERE `element`='messages' AND `folder`='groups'";
     } else {
         $query = "UPDATE `#__plugins` SET `params`='" . $params->toString() . "' WHERE `element`='messages' AND `folder`='groups'";
     }
     $this->db->setQuery($query);
     $this->db->query();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:Migration20130619181459PlgGroupsAnnouncements.php

示例11: display

 function display($tpl = null)
 {
     global $mainframe;
     $model = $this->getModel('groups');
     $db =& JFactory::getDBO();
     $cmd = JRequest::getVar('task');
     $cid = JRequest::getVar('cid_user');
     $lists = array();
     $group_id = JRequest::getVar('group_id');
     $user_id = intval(JRequest::getVar('user_id'));
     $cid_tmp = $cid[0];
     if ($user_id > 0) {
         $cid_tmp = $user_id;
     }
     $user = JTable::getInstance('users', 'Table');
     $user->load(intval($cid[0]));
     $query = ' SELECT a.*, a.id as user_id, g.name as groupname ' . ' FROM `#__users` AS a' . ' INNER JOIN #__core_acl_aro AS aro ON aro.value = a.id' . ' INNER JOIN #__core_acl_groups_aro_map AS gm ON gm.aro_id = aro.id' . ' INNER JOIN #__core_acl_aro_groups AS g ON g.id = gm.group_id' . ' WHERE a.id=' . intval($cid_tmp);
     $db->setQuery($query);
     $row = $db->loadObject();
     $javascript = 'onchange="document.adminForm.submit();"';
     // get list of Authors for dropdown filter
     $query = 'SELECT u.id as value, u.username as text' . ' FROM #__users AS u';
     $db->setQuery($query);
     $users = $db->loadObjectList();
     $lists['users'] = JHTML::_('select.genericlist', $users, 'user_id', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', $cid_tmp);
     $form = new JParameter('', JPATH_COMPONENT . DS . 'views' . DS . 'groups' . DS . 'tmpl' . DS . 'user.xml');
     $set_start = '';
     $set_end = '';
     if ($cmd == 'edit_user') {
         $query = 'SELECT * FROM #__yos_resources_manager_user_group_xref WHERE user_id=' . intval($cid[0]) . ' AND group_id=' . $group_id;
         $db->setQuery($query);
         $row1 = $db->loadObject();
         $set_start = $row1->start;
         $set_end = $row1->end;
     }
     $form->set('start', JHTML::_('date', $set_start, '%Y-%m-%d %H:%M:%S'));
     $form->set('end', JHTML::_('date', $set_end, '%Y-%m-%d %H:%M:%S'));
     $this->assignRef('form', $form);
     JRequest::setVar('hidemainmenu', 1);
     $this->assignRef('cmd', $cmd);
     $this->assignRef('row', $row);
     $this->assignRef('user', $user);
     $this->assignRef('lists', $lists);
     $this->assignRef('group_id', $group_id);
     parent::display($tpl);
 }
开发者ID:laiello,项目名称:yrm,代码行数:46,代码来源:view.form_user.php

示例12: ajaxEmailPage

 public function ajaxEmailPage($uri, $emails, $message = '')
 {
     $message = stripslashes($message);
     $mainframe =& JFactory::getApplication();
     $bookmarks = CFactory::getBookmarks($uri);
     $mailqModel = CFactory::getModel('mailq');
     $config = CFactory::getConfig();
     $response = new JAXResponse();
     if (empty($emails)) {
         $content = '<div>' . JText::_('CC SHARE INVALID EMAIL') . '</div>';
         $buttons = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('CC BUTTON GO BACK') . '"/>';
     } else {
         $emails = explode(',', $emails);
         $errors = array();
         // Add notification
         CFactory::load('libraries', 'notification');
         foreach ($emails as $email) {
             $email = JString::trim($email);
             if (!empty($email) && preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$/i", $email)) {
                 $params = new JParameter('');
                 $params->set('uri', $uri);
                 $params->set('message', $message);
                 CNotificationLibrary::add('system.bookmarks.email', '', $email, JText::sprintf('CC SHARE EMAIL SUBJECT', $config->get('sitename')), '', 'bookmarks', $params);
             } else {
                 // If there is errors with email, inform the user.
                 $errors[] = $email;
             }
         }
         if ($errors) {
             $content = '<div>' . JText::_('CC EMAILS ARE INVALID') . '</div>';
             foreach ($errors as $error) {
                 $content .= '<div style="font-weight:700;color: red;">' . $error . '</span>';
             }
             $buttons = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('CC BUTTON GO BACK') . '"/>';
         } else {
             $content = '<div>' . JText::_('CC EMAIL SENT TO RECIPIENTS') . '</div>';
             $buttons = '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('CC BUTTON DONE') . '"/>';
         }
     }
     $response->addAssign('cwin_logo', 'innerHTML', JText::_('CC SHARE THIS'));
     $response->addAssign('cWindowContent', 'innerHTML', $content);
     $response->addScriptCall('cWindowActions', $buttons);
     $response->addScriptCall('cWindowResize', 100);
     return $response->sendResponse();
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:45,代码来源:bookmarks.php

示例13: loadAction

    function loadAction($form, $actiondata)
    {
        $params = new JParameter($actiondata->params);
        $output = '';
        $mainframe =& JFactory::getApplication();
        $document =& JFactory::getDocument();
        JHTML::_('behavior.mootools');
        $uri =& JFactory::getURI();
        $CF_PATH = $mainframe->isSite() ? JURI::Base() : $uri->root();
        $document->addScript($CF_PATH . 'administrator/components/com_chronoforms/form_actions/auto_javascript_validation/assets/auto_javascript_validation.js');
        $rules = array('required', 'alpha', 'alphanum', 'digit', 'nodigit', 'number', 'email', 'phone', 'phone_inter', 'url', 'image');
        ob_start();
        ?>
			window.addEvent('domready', function() {
				<?php 
        $object_list = array();
        foreach ($rules as $rule) {
            $fields_list = array();
            if (trim($params->get($rule, ''))) {
                $fields_list = explode(',', trim($params->get($rule, '')));
            }
            foreach ($fields_list as $k => $field) {
                $fields_list[$k] = "'" . $field . "'";
            }
            $n_fields_list = implode(',', $fields_list);
            $object_list[] = "'" . $rule . "': [" . $n_fields_list . "]";
        }
        ?>
				new AutoJavascriptValidation('<?php 
        echo $form->form_name;
        ?>
', <?php 
        echo "{" . implode(",", $object_list) . "}";
        ?>
);
			});
		<?php 
        $script = ob_get_clean();
        if ((bool) $form->form_params->get('dynamic_files', 0) === false) {
            $document->addScriptDeclaration("//<![CDATA[" . "\n" . $script . "\n" . "//]]>");
        } else {
            //load the action class
            $form->loadActionHelper('load_js');
            $CfactionLoadJsHelper = new CfactionLoadJsHelper();
            $JSactiondata = new stdClass();
            $JSactiondata->content1 = $script;
            $JSParams = new JParameter('');
            $JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0));
            $JSactiondata->params = $JSParams->toString();
            $CfactionLoadJsHelper->load($form, $JSactiondata);
        }
        //load validation files
        $form->loadActionHelper('show_html');
        $CfactionShowHtmlHelper = new CfactionShowHtmlHelper();
        $CfactionShowHtmlHelper->_loadValidationScripts($form);
    }
开发者ID:vnishukov,项目名称:fdo,代码行数:56,代码来源:cfaction_auto_javascript_validation.php

示例14: run

 function run($form, $actiondata)
 {
     $params = new JParameter($actiondata->params);
     $mainframe = JFactory::getApplication();
     //set the images path
     $upload_path = $params->get('upload_path', '');
     if (!empty($upload_path)) {
         $upload_path = str_replace(array("/", "\\"), DS, $upload_path);
         if (substr($upload_path, -1) == DS) {
             $upload_path = substr_replace($upload_path, '', -1);
         }
         $upload_path = str_replace("JOOMLA_PATH", JPATH_SITE, $upload_path) . DS;
         $params->set('upload_path', $upload_path);
     } else {
         $upload_path = JPATH_SITE . DS . 'components' . DS . 'com_chronoforms' . DS . 'uploads' . DS . $form->form_details->name . DS;
     }
     $image_file_name = $params->get('photo', '');
     if (strpos($image_file_name, ',') !== false) {
         $image_file_names = explode(',', $image_file_name);
     } else {
         $image_file_names = array($image_file_name);
     }
     foreach ($image_file_names as $image_file_name) {
         //stop if the field name is not set or if the file data doesn't exist
         //if((strlen($image_file_name) == 0) || !isset($form->data[$image_file_name]) || !isset($form->files[$image_file_name]['path'])){
         if (strlen($image_file_name) == 0 || !isset($form->files[$image_file_name])) {
             continue;
         }
         if ($form->files[$image_file_name] === array_values($form->files[$image_file_name])) {
             //array of files
             $reset = false;
         } else {
             $form->files[$image_file_name] = array($form->files[$image_file_name]);
             $reset = true;
         }
         foreach ($form->files[$image_file_name] as $k => $image) {
             // Common parameters
             $photo = $image['name'];
             //$form->data[$image_file_name];
             $filein = $image['path'];
             $file_info = pathinfo($filein);
             $form->debug['Image_Resize'][$actiondata->order]['thumb_big'] = $form->files[$image_file_name][$k]['thumb_big'] = $this->processSize('big', $form, $actiondata, $photo, $filein, $upload_path, $file_info);
             // treatment of the medium image
             $form->debug['Image_Resize'][$actiondata->order]['thumb_med'] = $form->files[$image_file_name][$k]['thumb_med'] = $this->processSize('med', $form, $actiondata, $photo, $filein, $upload_path, $file_info);
             // treatment of the small image
             $form->debug['Image_Resize'][$actiondata->order]['thumb_small'] = $form->files[$image_file_name][$k]['thumb_small'] = $this->processSize('small', $form, $actiondata, $photo, $filein, $upload_path, $file_info);
             if ($params->get('delete_original')) {
                 unlink($filein);
             }
         }
         if ($reset) {
             $form->files[$image_file_name] = $form->files[$image_file_name][0];
         }
     }
 }
开发者ID:affiliatelk,项目名称:ecc,代码行数:55,代码来源:image_resize.php

示例15: ajaxTogglePublish

 function ajaxTogglePublish($id, $type)
 {
     // Send email notification to owner when a group is published.
     $config =& CFactory::getConfig();
     $group =& JTable::getInstance('Group', 'CTable');
     $group->load($id);
     if ($type == 'published' && $group->published == 0 && $config->get('moderategroupcreation')) {
         $lang =& JFactory::getLanguage();
         $lang->load('com_community', JPATH_ROOT);
         $my =& CFactory::getUser();
         // Add notification
         CFactory::load('libraries', 'notification');
         //Send notification email to owner
         $params = new JParameter('');
         $params->set('url', 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id);
         $params->set('groupName', $group->name);
         CNotificationLibrary::add('groups.notify.creator', $my->id, $group->ownerid, JText::sprintf('CC GROUP PUBLISHED MAIL SUBJECT', $group->name), '', 'groups.notifycreator', $params);
     }
     return parent::ajaxTogglePublish($id, $type, 'groups');
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:20,代码来源:groups.php


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