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

PHP CAppPlugins类代码示例

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

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



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

示例1: add

 function add($actor, $target, $title, $content, $appname = '', $cid = 0, $params = '', $points = 1, $access = 0)
 {
     jimport('joomla.utilities.date');
     $db =& $this->getDBO();
     $today =& JFactory::getDate();
     $obj = new StdClass();
     $obj->actor = $actor;
     $obj->target = $target;
     $obj->title = $title;
     $obj->content = $content;
     $obj->app = $appname;
     $obj->cid = $cid;
     $obj->params = $params;
     $obj->created = $today->toMySQL();
     $obj->points = $points;
     $obj->access = $access;
     // Trigger for onBeforeStreamCreate event.
     CFactory::load('libraries', 'apps');
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $params = array();
     $params[] =& $obj;
     $result = $appsLib->triggerEvent('onBeforeStreamCreate', $params);
     if (in_array(true, $result) || empty($result)) {
         return $db->insertObject('#__community_activities', $obj);
     }
     return false;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:28,代码来源:activities.php


示例2: update

 /**
  * Update the user status
  * 
  * @param	int		user id
  * @param	string	the message. Should be < 140 char (controller check)	 	 	 
  */
 function update($id, $status)
 {
     $db =& $this->getDBO();
     $my = CFactory::getUser();
     // @todo: posted_on should be constructed to make sure we take into account
     // of Joomla server offset
     // Current user and update id should always be the same
     CError::assert($my->id, $id, 'eq', __FILE__, __LINE__);
     // Trigger onStatusUpdate
     require_once COMMUNITY_COM_PATH . DS . 'libraries' . DS . 'apps.php';
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $args = array();
     $args[] = $my->id;
     // userid
     $args[] = $my->getStatus();
     // old status
     $args[] = $status;
     // new status
     $appsLib->triggerEvent('onProfileStatusUpdate', $args);
     $today =& JFactory::getDate();
     $data = new stdClass();
     $data->userid = $id;
     $data->status = $status;
     $data->posted_on = $today->toMySQL();
     $db->updateObject('#__community_users', $data, 'userid');
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:36,代码来源:status.php


示例3: add

 /**
  * Add new notification
  * @return  true
  */
 public function add($from, $to, $content, $cmd = '', $type = '', $params = '')
 {
     jimport('joomla.utilities.date');
     $db = $this->getDBO();
     $date = JFactory::getDate();
     $config = CFactory::getConfig();
     $notification = JTable::getInstance('notification', 'CTable');
     //respect notification setting
     //filter result by cmd_type
     $validate = true;
     $user = CFactory::getUser($to);
     $user_params = $user->getParams();
     if (!empty($cmd)) {
         $validate = $user_params->get($cmd, $config->get($cmd)) == 1 ? true : false;
     }
     if ($validate) {
         $notification->actor = $from;
         $notification->target = $to;
         $notification->content = $content;
         $notification->created = $date->toSql();
         $notification->params = is_object($params) && method_exists($params, 'toString') ? $params->toString() : '';
         $notification->cmd_type = $cmd;
         $notification->type = $type;
         $notification->store();
     }
     $appsLib = CAppPlugins::getInstance();
     $appsLib->triggerEvent('onNotificationAdd', array($notification));
     //delete the oldest notification
     $this->deleteOldest($to);
     return true;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:35,代码来源:notification.php


示例4: register

 public function register($data = null)
 {
     //require_once (JPATH_COMPONENT.'/libraries/profile.php');
     $mainframe = JFactory::getApplication();
     $my = CFactory::getUser();
     $config = CFactory::getConfig();
     /**
      * Opengraph
      */
     CHeadHelper::setType('website', JText::_('COM_COMMUNITY_REGISTER_NEW'));
     // Hide this form for logged in user
     if ($my->id) {
         $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_REGISTER_ALREADY_USER'), 'warning');
         return;
     }
     // If user registration is not allowed, show 403 not authorized.
     $usersConfig = JComponentHelper::getParams('com_users');
     if ($usersConfig->get('allowUserRegistration') == '0') {
         //show warning message
         $this->addWarning(JText::_('COM_COMMUNITY_REGISTRATION_DISABLED'));
         return;
     }
     $fields = array();
     $post = JRequest::get('post');
     $isUseFirstLastName = CUserHelper::isUseFirstLastName();
     $data = array();
     $data['fields'] = $fields;
     $data['html_field']['jsname'] = empty($post['jsname']) ? '' : $post['jsname'];
     $data['html_field']['jsusername'] = empty($post['jsusername']) ? '' : $post['jsusername'];
     $data['html_field']['jsemail'] = empty($post['jsemail']) ? '' : $post['jsemail'];
     $data['html_field']['jsfirstname'] = empty($post['jsfirstname']) ? '' : $post['jsfirstname'];
     $data['html_field']['jslastname'] = empty($post['jslastname']) ? '' : $post['jslastname'];
     // $js = 'assets/validate-1.5.min.js';
     // CFactory::attach($js, 'js');
     $recaptcha = new CRecaptchaHelper();
     $recaptchaHTML = $recaptcha->html();
     $fbHtml = '';
     if ($config->get('fbconnectkey') && $config->get('fbconnectsecret') && !$config->get('usejfbc')) {
         //CFactory::load( 'libraries' , 'facebook' );
         $facebook = new CFacebook();
         $fbHtml = $facebook->getLoginHTML();
     }
     if ($config->get('usejfbc')) {
         if (class_exists('JFBCFactory')) {
             $providers = JFBCFactory::getAllProviders();
             foreach ($providers as $p) {
                 $fbHtml .= $p->loginButton();
             }
         }
     }
     $tmpl = new CTemplate();
     $content = $tmpl->set('data', $data)->set('recaptchaHTML', $recaptchaHTML)->set('config', $config)->set('isUseFirstLastName', $isUseFirstLastName)->set('fbHtml', $fbHtml)->fetch('register/base');
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $args = array(&$content);
     $appsLib->triggerEvent('onUserRegisterFormDisplay', $args);
     echo $this->_getProgressBar(1);
     echo $content;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:59,代码来源:view.html.php


示例5: register

 public function register($data = null)
 {
     require_once JPATH_COMPONENT . DS . 'libraries' . DS . 'profile.php';
     $mainframe =& JFactory::getApplication();
     $my = CFactory::getUser();
     $config = CFactory::getConfig();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_COMMUNITY_REGISTER_NEW'));
     // Hide this form for logged in user
     if ($my->id) {
         $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_REGISTER_ALREADY_USER'), 'warning');
         return;
     }
     // If user registration is not allowed, show 403 not authorized.
     $usersConfig =& JComponentHelper::getParams('com_users');
     if ($usersConfig->get('allowUserRegistration') == '0') {
         //show warning message
         $this->addWarning(JText::_('COM_COMMUNITY_REGISTRATION_DISABLED'));
         return;
     }
     $fields = array();
     $empty_html = array();
     $post = JRequest::get('post');
     CFactory::load('helpers', 'user');
     $isUseFirstLastName = CUserHelper::isUseFirstLastName();
     $data = array();
     $data['fields'] = $fields;
     $data['html_field']['jsname'] = empty($post['jsname']) ? '' : $post['jsname'];
     $data['html_field']['jsusername'] = empty($post['jsusername']) ? '' : $post['jsusername'];
     $data['html_field']['jsemail'] = empty($post['jsemail']) ? '' : $post['jsemail'];
     $data['html_field']['jsfirstname'] = empty($post['jsfirstname']) ? '' : $post['jsfirstname'];
     $data['html_field']['jslastname'] = empty($post['jslastname']) ? '' : $post['jslastname'];
     $js = 'assets/validate-1.5';
     $js .= $config->getBool('usepackedjavascript') ? '.pack.js' : '.js';
     CAssets::attach($js, 'js');
     // @rule: Load recaptcha if required.
     CFactory::load('helpers', 'recaptcha');
     $recaptchaHTML = getRecaptchaHTMLData();
     $fbHtml = '';
     if ($config->get('fbconnectkey') && $config->get('fbconnectsecret')) {
         CFactory::load('libraries', 'facebook');
         $facebook = new CFacebook();
         $fbHtml = $facebook->getLoginHTML();
     }
     $tmpl = new CTemplate();
     $content = $tmpl->set('data', $data)->set('recaptchaHTML', $recaptchaHTML)->set('config', $config)->set('isUseFirstLastName', $isUseFirstLastName)->set('fbHtml', $fbHtml)->fetch('register.index');
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $args = array(&$content);
     $appsLib->triggerEvent('onUserRegisterFormDisplay', $args);
     echo $this->_getProgressBar(1);
     echo $content;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:53,代码来源:view.html.php


示例6: assignPoint

 /**
  * add points to user based on the action.
  * @param $action
  * @param null $userId
  */
 public static function assignPoint($action, $userId = null)
 {
     //get the rule points
     //must use the JFactory::getUser to get the aid
     $juser = JFactory::getUser($userId);
     //since 4.0, check if this action is published, else return false (boolean)
     $userPointModel = CFactory::getModel('Userpoints');
     $point = $userPointModel->getPointData($action);
     if (!isset($point->published) || !$point->published) {
         return false;
     }
     if ($juser->id != 0) {
         if (!method_exists($juser, 'getAuthorisedViewLevels')) {
             $aid = $juser->aid;
             // if the aid is null, means this is not the current logged-in user.
             // so we need to manually get this aid for this user.
             if (is_null($aid)) {
                 $aid = 0;
                 //defautl to 0
                 // Get an ACL object
                 $acl = JFactory::getACL();
                 $grp = $acl->getAroGroup($juser->id);
                 $group = 'USERS';
                 if ($acl->is_group_child_of($grp->name, $group)) {
                     $aid = 1;
                     // Fudge Authors, Editors, Publishers and Super Administrators into the special access group
                     if ($acl->is_group_child_of($grp->name, 'Registered') || $acl->is_group_child_of($grp->name, 'Public Backend')) {
                         $aid = 2;
                     }
                 }
             }
         } else {
             //joomla 1.6
             $aid = $juser->getAuthorisedViewLevels();
         }
         $points = CUserPoints::_getActionPoint($action, $aid);
         $user = CFactory::getUser($userId);
         $points += $user->getKarmaPoint();
         $user->_points = $points;
         $profile = JTable::getInstance('Profile', 'CTable');
         $profile->load($user->id);
         $user->_thumb = $profile->thumb;
         $user->_avatar = $profile->avatar;
         $user->save();
         //Event trigger
         $appsLib = CAppPlugins::getInstance();
         $appsLib->loadApplications();
         $params = array('action' => $action, 'points' => $points, 'userId' => $user->id);
         $appsLib->triggerEvent('onAfterAssignPoint', $params);
         return true;
     }
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:57,代码来源:userpoints.php


示例7: ajaxShowBookmarks

 public function ajaxShowBookmarks($uri)
 {
     $filter = JFilterInput::getInstance();
     $uri = $filter->clean($uri, 'string');
     $config = CFactory::getConfig();
     $shareviaemail = $config->get('shareviaemail');
     //CFactory::load( 'libraries' , 'bookmarks' );
     $bookmarks = new CBookmarks($uri);
     //CFactory::load( 'libraries' , 'apps' );
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     // @onLoadBookmarks deprecated.
     // since 1.5
     $appsLib->triggerEvent('onLoadBookmarks', array($bookmarks));
     $tmpl = new CTemplate();
     $tmpl->set('config', $config)->set('bookmarks', $bookmarks->getBookmarks());
     $json = array('title' => JText::_('COM_COMMUNITY_SHARE_THIS'), 'html' => $tmpl->fetch('bookmarks.list'), 'btnShare' => JText::_('COM_COMMUNITY_SHARE_BUTTON'), 'btnCancel' => JText::_('COM_COMMUNITY_CANCEL_BUTTON'), 'viaEmail' => $shareviaemail ? true : false);
     die(json_encode($json));
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:19,代码来源:bookmarks.php


示例8: run

 function run()
 {
     jimport('joomla.filesystem.file');
     set_time_limit(120);
     $this->_sendEmails();
     $this->_convertVideos();
     $this->_sendSiteDetails();
     $this->_archiveActivities();
     $this->_cleanRSZFiles();
     $this->_processPhotoStorage();
     $this->_updatePhotoFileSize();
     $this->_updateVideoFileSize();
     $this->_removeDeletedPhotos();
     $this->_processVideoStorage();
     $this->_processUserAvatarStorage();
     // Include CAppPlugins library
     require_once JPATH_COMPONENT . DS . 'libraries' . DS . 'apps.php';
     // Trigger system event onCronRun
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $args = array();
     $appsLib->triggerEvent('onCronRun', $args);
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:23,代码来源:cron.php


示例9: add

 /**
  * Add new activity into stream
  * @param array|object $data
  * @return CActivity|boolean
  */
 public static function add($data)
 {
     $activity = new CActivity($data);
     /**
      * @todo We'll move all event trigger into this class not in table class or anywhere
      * @todo Anything else we want to include when posting please put here
      */
     /* Event trigger */
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $params = array();
     $params[] =& $activity;
     /* We do raise event here that will allow user change $activity properties before save it */
     $appsLib->triggerEvent('onBeforeActivitySave', $params);
     if ($activity->get('cmd')) {
         /* Userpoints */
         $userPointModel = CFactory::getModel('Userpoints');
         $point = $userPointModel->getPointData($activity->get('cmd'));
         if ($point) {
             /**
              * @todo Need clearly about this !
              * for every unpublished user points the stream will be disabled for that item
              * but not sure if this for 3rd party API, this feature should be available or not?
              */
             if (!$point->published) {
                 //return;
             }
         }
     }
     if ($activity->save()) {
         $params = array();
         $params[] =& $activity;
         $appsLib->triggerEvent('onAfterActivitySave', $params);
         return $activity;
     }
     return false;
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:42,代码来源:activities.php


示例10: ajaxShowBookmarks

 public function ajaxShowBookmarks($uri)
 {
     $filter = JFilterInput::getInstance();
     $uri = $filter->clean($uri, 'string');
     CFactory::load('libraries', 'bookmarks');
     $bookmarks = new CBookmarks($uri);
     CFactory::load('libraries', 'apps');
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     // @onLoadBookmarks deprecated.
     // since 1.5
     $appsLib->triggerEvent('onLoadBookmarks', array($bookmarks));
     $response = new JAXResponse();
     $tmpl = new CTemplate();
     $tmpl->set('bookmarks', $bookmarks->getBookmarks());
     $html = $tmpl->fetch('bookmarks.list');
     $total = $bookmarks->getTotalBookmarks();
     $height = $total * 10;
     $actions = '<input type="button" class="button" onclick="joms.bookmarks.email(\'' . $uri . '\');" value="' . JText::_('COM_COMMUNITY_SHARE_BUTTON') . '"/>';
     $actions .= '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('COM_COMMUNITY_CANCEL_BUTTON') . '"/>';
     $response->addAssign('cwin_logo', 'innerHTML', JText::_('COM_COMMUNITY_SHARE_THIS'));
     $response->addScriptCall('cWindowAddContent', $html, $actions);
     return $response->sendResponse();
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:24,代码来源:bookmarks.php


示例11: registerUpdateProfile

 /**
  * Step 4
  * Update the users profile.
  */
 public function registerUpdateProfile()
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $model = $this->getModel('register');
     // Check for request forgeries
     $mySess = JFactory::getSession();
     $ipAddress = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
     $token = $mySess->get('JS_REG_TOKEN', '');
     $formToken = $jinput->request->get('authkey', '', 'STRING');
     //JRequest::getVar( 'authkey', '', 'REQUEST');
     //$authKey   = $model->getAssignedAuthKey($token, $ipAddress);
     if (!$token) {
         //(empty($formToken) || empty($authKey) || ($formToken != $authKey))
         echo '<div class="error-box">' . JText::_('COM_COMMUNITY_INVALID_SESSION') . '</div>';
         return;
     }
     //intercept validation process in custom profile
     $post = JRequest::get('post');
     /*
      * Rules:
      * First we let 3rd party plugin to intercept the validation.
      * if there is not error return, we then proceed with our validation.
      */
     $errMsg = array();
     $errTrigger = null;
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $params = array();
     $params[] = $post;
     $errTrigger = $appsLib->triggerEvent('onRegisterProfileValidate', $params);
     if (!is_null($errTrigger)) {
         if (!empty($errTrigger[0]) && count($errTrigger[0]) > 0) {
             //error found.
             foreach ($errTrigger[0] as $err) {
                 $mainframe->enqueueMessage($err, 'error');
             }
             $this->registerProfile();
             return;
         }
     }
     // get required obj for registration
     $pModel = $this->getModel('profile');
     $values = array();
     $filter = array('published' => '1', 'registration' => '1');
     $profileType = JRequest::getInt('profileType', 0, 'POST');
     $profiles = $pModel->getAllFields($filter, $profileType);
     foreach ($profiles as $key => $groups) {
         foreach ($groups->fields as $data) {
             $fieldValue = new stdClass();
             // Get value from posted data and map it to the field.
             // Here we need to prepend the 'field' before the id because in the form, the 'field' is prepended to the id.
             $postData = $jinput->post->get('field' . $data->id, '', 'NONE');
             //JRequest::getVar('field'.$data->id, '', 'POST');
             // Retrieve the privacy data for this particular field.
             $fieldValue->access = JRequest::getInt('privacy' . $data->id, 0, 'POST');
             $fieldValue->value = CProfileLibrary::formatData($data->type, $postData);
             if (get_magic_quotes_gpc()) {
                 $fieldValue->value = stripslashes($fieldValue->value);
             }
             $values[$data->id] = $fieldValue;
             // @rule: Validate custom profile if necessary
             if (!CProfileLibrary::validateField($data->id, $data->type, $values[$data->id]->value, $data->required)) {
                 // If there are errors on the form, display to the user.
                 $message = JText::sprintf('COM_COMMUNITY_FIELD_CONTAIN_IMPROPER_VALUES', $data->name);
                 $mainframe->enqueueMessage($message, 'error');
                 $this->registerProfile();
                 return;
             }
         }
     }
     $profileType = $jinput->post->get('profileType', 0, 'NONE');
     //JRequest::getVar('profileType', 0, 'POST');
     $multiprofile = JTable::getInstance('MultiProfile', 'CTable');
     $multiprofile->load($profileType);
     $tmpUser = $model->getTempUser($token);
     $user = $this->_createUser($tmpUser, $multiprofile->approvals, $multiprofile->id);
     //update the first/last name if it exist in the profile configuration
     $this->_updateFirstLastName($user);
     $pModel->saveProfile($user->id, $values);
     // Update user location data
     $pModel->updateLocationData($user->id);
     $this->sendEmail('registration_complete', $user, null, $multiprofile->approvals);
     // now we need to set it for later avatar upload page
     // do the clear up job for tmp user.
     $mySess->set('tmpUser', $user);
     $model->removeTempUser($token);
     $model->removeAuthKey($token);
     //redirect to avatar upload page.
     $mainframe->redirect(CRoute::_('index.php?option=com_community&view=register&task=registerAvatar&profileType=' . $profileType, false));
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:95,代码来源:register.php


示例12: uploadAvatar

 function uploadAvatar()
 {
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('CC UPLOAD EVENT AVATAR'));
     $eventid = JRequest::getVar('eventid', '0');
     $this->_addEventInPathway($eventid);
     $this->addPathway(JText::_('CC UPLOAD EVENT AVATAR'));
     $this->showSubmenu();
     $event =& JTable::getInstance('Event', 'CTable');
     $event->load($eventid);
     CFactory::load('helpers', 'event');
     $handler = CEventHelper::getHandler($event);
     if (!$handler->manageable()) {
         $this->noAccess();
         return;
     }
     $config = CFactory::getConfig();
     $uploadLimit = (double) $config->get('maxuploadsize');
     $uploadLimit .= 'MB';
     CFactory::load('models', 'events');
     $event =& JTable::getInstance('Event', 'CTable');
     $event->load($eventid);
     CFactory::load('libraries', 'apps');
     $app =& CAppPlugins::getInstance();
     $appFields = $app->triggerEvent('onFormDisplay', array('jsform-events-uploadavatar'));
     $beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
     $afterFormDisplay = CFormElement::renderElements($appFields, 'after');
     $tmpl = new CTemplate();
     $tmpl->set('beforeFormDisplay', $beforeFormDisplay);
     $tmpl->set('afterFormDisplay', $afterFormDisplay);
     $tmpl->set('eventId', $eventid);
     $tmpl->set('avatar', $event->getAvatar('avatar'));
     $tmpl->set('thumbnail', $event->getAvatar());
     $tmpl->set('uploadLimit', $uploadLimit);
     echo $tmpl->fetch('events.uploadavatar');
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:36,代码来源:view.html.php


示例13: execute

 /**
  * Execute a request
  */
 public function execute($task = '')
 {
     global $mainframe;
     $document =& JFactory::getDocument();
     $my =& JFactory::getUser();
     $pathway =& $mainframe->getPathway();
     $menus =& JSite::getMenu();
     $menuitem =& $menus->getActive();
     $userId = JRequest::getInt('userid', '', 'GET');
     $tmpl = JRequest::getVar('tmpl', '', 'REQUEST');
     $format = JRequest::getVar('format', '', 'REQUEST');
     $nohtml = JRequest::getVar('no_html', '', 'REQUEST');
     if ($tmpl != 'component' && $format != 'feed' && $format != 'ical' && $nohtml != 1 && $format != 'raw') {
         // This is to fix MSIE that has incorrect user agent because jquery doesn't detect correctly.
         $ieFix = "<!--[if IE 6]><script type=\"text/javascript\">var jomsIE6 = true;</script><![endif]-->";
         $document->addCustomTag($ieFix);
     }
     // Add custom css for the specific view if needed.
     $config = CFactory::getConfig();
     $viewName = JString::strtolower(JRequest::getVar('view', '', 'REQUEST'));
     jimport('joomla.filesystem.file');
     if ($config->get('enablecustomviewcss')) {
         CTemplate::addStylesheet($viewName);
     }
     $env = CTemplate::getTemplateEnvironment();
     $html = '<div id="community-wrap" class="on-' . $env->joomlaTemplate . ' ' . $document->direction . '">';
     // Build the component menu module
     ob_start();
     CTemplate::renderModules('js_top');
     $moduleHTML = ob_get_contents();
     ob_end_clean();
     $html .= $moduleHTML;
     // Build the content HTML
     CFactory::load('helpers', 'azrul');
     $inbox =& $this->getModel('inbox');
     $unread = $inbox->countUnRead(array('user_id' => $my->id));
     $param = array('inbox' => $unread);
     if (!empty($task) && method_exists($this, $task)) {
         ob_start();
         if (method_exists($this, '_viewEnabled') && !$this->_viewEnabled()) {
             echo property_exists($this, '_disabledMessage') ? $this->_disabledMessage : JText::_('Function is disabled');
         } else {
             $this->{$task}();
         }
         $output = ob_get_contents();
         ob_end_clean();
     } else {
         ob_start();
         $this->display();
         $output = ob_get_contents();
         ob_end_clean();
     }
     // Build toolbar HTML
     ob_start();
     $view =& $this->getView(JRequest::getCmd('view', 'frontpage'));
     $view->showToolbar($param);
     // Header title will use view->title. If not specified, we will
     // use current page title
     $headerTitle = !empty($view->title) ? $view->title : $document->getTitle();
     $view->showHeader($headerTitle, $this->_icon);
     $header = ob_get_contents();
     ob_end_clean();
     $html .= $header;
     // @rule: Super admin should always be allowed regardless of their block status
     // block member to access profile owner details
     CFactory::load('helpers', 'owner');
     CFactory::load('libraries', 'block');
     $getBlockStatus = new blockUser();
     $blocked = $getBlockStatus->isUserBlocked($userId, $viewName);
     if ($blocked) {
         if (COwnerHelper::isCommunityAdmin()) {
             $mainframe =& JFactory::getApplication();
             $mainframe->enqueueMessage(JText::_('CC YOU ARE BLOCKED BY USER', 'error'));
         } else {
             $tmpl = new CTemplate();
             $output .= $tmpl->fetch('block.denied');
         }
     }
     // Build the component bottom module
     ob_start();
     CTemplate::renderModules('js_bottom');
     $moduleHTML = ob_get_contents();
     ob_end_clean();
     $html .= $output . $moduleHTML . '</div>';
     CFactory::load('helpers', 'string');
     $html = CStringHelper::replaceThumbnails($html);
     $html = JString::str_ireplace(array('{error}', '{warning}', '{info}'), '', $html);
     // Trigger onModuleDisplay()
     CFactory::load('libraries', 'apps');
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $moduleHTML = $appsLib->triggerEvent('onModuleRender');
     $mods = array();
     foreach ($moduleHTML as $modules) {
         foreach ($modules as $position => $content) {
             if (empty($mods[$position])) {
                 $mods[$position] = '';
//.........这里部分代码省略.........
开发者ID:bizanto,项目名称:Hooked,代码行数:101,代码来源:controller.php


示例14: triggerWallComments

 /**
  * Formats the comment in the rows
  * 
  * @param Array	An array of wall objects	 	 
  **/
 function triggerWallComments(&$rows)
 {
     CError::assert($rows, 'array', 'istype', __FILE__, __LINE__);
     require_once COMMUNITY_COM_PATH . DS . 'libraries' . DS . 'apps.php';
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     for ($i = 0; $i < count($rows); $i++) {
         $args = array();
         $args[] =& $rows[$i];
         $appsLib->triggerEvent('onWallDisplay', $args);
     }
     return true;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:18,代码来源:wall.php


示例15: ajaxRefreshLayout

 public function ajaxRefreshLayout($id, $position)
 {
     $objResponse = new JAXResponse();
     $filter = JFilterInput::getInstance();
     $id = $filter->clean($id, 'string');
     $position = $filter->clean($position, 'string');
     $my = CFactory::getUser();
     $appsModel = CFactory::getModel('apps');
     $element = $appsModel->getAppName($id);
     $pluginId = $appsModel->getPluginId($element);
     $params =& JPluginHelper::getPlugin('community', JString::strtolower($element));
     $dispatcher =& JDispatcher::getInstance();
     $pluginClass = 'plgCommunity' . $element;
     //$plugin = new $pluginClass($dispatcher, (array)($params));
     $plugin = JTable::getInstance('App', 'CTable');
     $plugin->loadUserApp($my->id, $element);
     switch ($position) {
         case "apps-sortable-side-top":
             $position = "sidebar-top";
             break;
         case "apps-sortable-side-bottom":
             $position = "sidebar-bottom";
             break;
         case "apps-sortable":
         default:
             $position = "content";
             break;
     }
     $appInfo = $appsModel->getAppInfo($element);
     //$plugin->setNewLayout($position);
     $plugin->postion = $position;
     $appsLib =& CAppPlugins::getInstance();
     $app = $appsLib->triggerPlugin('onProfileDisplay', $appInfo->name, $my->id);
     $tmpl = new CTemplate();
     $tmpl->set('app', $app);
     $tmpl->set('isOwner', $appsModel->isOwned($my->id, $id));
     switch ($position) {
         case 'sidebar-top':
         case 'sidebar-bottom':
             $wrapper = $tmpl->fetch('application.widget');
             break;
         default:
             $wrapper = $tmpl->fetch('application.box');
     }
     $wrapper = str_replace("\r\n", "", $wrapper);
     $wrapper = str_replace("\n", "", $wrapper);
     $wrapper = addslashes($wrapper);
     $objResponse->addScriptCall("jQuery('#jsapp-" . $id . "').before('{$wrapper}').remove();");
     //$objResponse->addScriptCall('joms.plugin.'.$element.'.refresh()');
     //$refreshActions = $plugin->getRefreshAction();
     return $objResponse->sendResponse();
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:52,代码来源:apps.php


示例16: deletePost

 /**
  *	Deletes a wall entry
  *	
  * @param	id int Specific id for the wall
  * 	 
  */
 public function deletePost($id)
 {
     CError::assert($id, '', '!empty', __FILE__, __LINE__);
     $db = JFactory::getDBO();
     //@todo check content id belong valid user b4 delete
     $query = 'DELETE FROM ' . $db->nameQuote('#__community_wall') . ' ' . 'WHERE ' . $db->nameQuote('id') . '=' . $db->Quote($id);
     $db->setQuery($query);
     $db->query();
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
     }
     // Post an event trigger
     $args = array();
     $args[] = $id;
     CFactory::load('libraries', 'apps');
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $appsLib->triggerEvent('onAfterWallDelete', $args);
     return true;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:26,代码来源:wall.php


示例17: defined

<?php

/**
 * @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
 * @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author iJoomla.com <[email protected]>
 * @url https://www.jomsocial.com/license-agreement
 * The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
 * More info at https://www.jomsocial.com/license-agreement
 */
defined('_JEXEC') or die;
if (!isset($isSingleActivity)) {
    $isSingleActivity = false;
}
$appLib = CAppPlugins::getInstance();
$filter = JFactory::getApplication()->input->get('filter', $filter);
$filterValue = JFactory::getApplication()->input->get('value');
$actId = JFactory::getApplication()->input->get('actid');
$date = JFactory::getDate();
if ($config->get('activitydateformat') == "lapse") {
    $createdTime = CTimeHelper::timeLapse($date);
} else {
    $createdTime = $date->format($config->get('profileDateFormat'));
}
// 2. welcome message for new installation
if (isset($freshInstallMsg)) {
    ?>
    <div class="cAlert" style="margin-top: 10px">
        <?php 
    echo $freshInstallMsg;
    ?>
开发者ID:Jougito,项目名称:DynWeb,代码行数:31,代码来源:base.php


示例18: triggerWallComments

 /**
  * Formats the comment in the rows
  *
  * @param Array    An array of wall objects
  * */
 public static function triggerWallComments(&$rows, $newlineReplace = true)
 {
     CError::assert($rows, 'array', 'istype', __FILE__, __LINE__);
     require_once COMMUNITY_COM_PATH . '/libraries/apps.php';
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     for ($i = 0; $i < count($rows); $i++) {
         if (isset($rows[$i]->comment) && !empty($rows[$i]->comment)) {
             $args = array();
             if (!$newlineReplace) {
                 // if newline replace is false, pass the information to the comment to leave out the newline
                 // replace in wall.trigger
                 $rows[$i]->newlineReplace = false;
             }
             $args[] = $rows[$i];
             $appsLib->triggerEvent('onWallDisplay', $args);
         }
     }
     return true;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:25,代码来源:wall.php


示例19: getInfo

 /**
 	get field value of $userId accordimg to $fieldCode
 */
 public function getInfo($userId, $fieldCode)
 {
     // Run Query to return 1 value
     $db = JFactory::getDBO();
     $query = 'SELECT b.* FROM ' . $db->nameQuote('#__community_fields') . ' AS a ' . 'INNER JOIN ' . $db->nameQuote('#__community_fields_values') . ' AS b ' . 'ON b.' . $db->nameQuote('field_id') . '=a.' . $db->nameQuote('id') . ' ' . 'AND b.' . $db->nameQuote('user_id') . '=' . $db->Quote($userId) . ' ' . 'INNER JOIN ' . $db->nameQuote('#__community_users') . ' AS c ' . 'ON c.' . $db->nameQuote('userid') . '= b.' . $db->nameQuote('user_id') . 'WHERE a.' . $db->nameQuote('fieldcode') . ' =' . $db->Quote($fieldCode);
     $db->setQuery($query);
     $result = $db->loadObject();
     $field = JTable::getInstance('FieldValue', 'CTable');
     $field->bind($result);
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
     }
     $config = CFactory::getConfig();
     // @rule: Only trigger 3rd party apps whenever they override extendeduserinfo configs
     if ($config->getBool('extendeduserinfo')) {
         CFactory::load('libraries', 'apps');
         $apps = CAppPlugins::getInstance();
         $apps->loadApplications();
         $params = array();
         $params[] = $fieldCode;
         $params[] =& $field->value;
         $apps->triggerEvent('onGetUserInfo', $params);
     }
     // Respect privacy settings.
     if (!XIPT_JOOMLA_15) {
         $my = CFactory::getUser();
         CFactory::load('libraries', 'privacy');
         if (!CPrivacy::isAccessAllowed($my->id, $userId, 'custom', $field->access)) {
             return false;
         }
     }
     return $field->value;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:36,代码来源:utils.php


示例20:

$jaxFuncNames[] = 'files,ajaxFileDownload';
$jaxFuncNames[] = 'files,ajaxgetFileList';
$jaxFuncNames[] = 'files,ajaxviewMore';
/**
 * @since 3.2
 */
$jaxFuncNames[] = 'location,ajaxGetCoordsByIp';
$jaxFuncNames[] = 'location,ajaxGetAddressFromCoords';
$jaxFuncNames[] = 'location,ajaxGetCoordsByAddress';
/**
 * @since 3.3
 */
$jaxFuncNames[] = 'search,ajaxSearch';
$jaxFuncNames[] = 'system,ajaxGetAdagency';
$jaxFuncNames[] = 'system,ajaxAdagencyGetImpression';
$jaxFuncNames[] = 'profile,ajaxFetchCard';
$jaxFuncNames[] = 'videos,ajaxConfirmRemoveVideo';
$jaxFuncNames[] = 'videos,ajaxGetInfo';
$jaxFuncNames[] = 'profile,ajaxRotateAvatar';
$jaxFuncNames[] = 'videos,ajaxSaveDescription';
$jaxFuncNames[] = 'system,ajaxModuleCall';
$jaxFuncNames[] = 'register,ajaxCheckPass';
$jaxFuncNames[] = 'system,ajaxGetLoginFormToken';
$jaxFuncNames[] = 'files,ajaxUpdateHit';
// Dont process other plugin ajax definitions for back end
if (!JString::stristr(JPATH_COMPONENT, 'administrator/components/com_community') && !JString::stristr(JPATH_COMPONENT, 'administrator\\components\\com_community')) {
    // Include CAppPlugins library
    require_once JPATH_ROOT . '/components/com_community/libraries/apps.php';
    // Load Ajax plugins jax file.
    CAppPlugins::loadAjaxPlugins();
}
开发者ID:Jougito,项目名称:DynWeb,代码行数:31,代码来源:jax.community.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP CAppUI类代码示例发布时间:2022-05-23
下一篇:
PHP CApp类代码示例发布时间: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