public function __construct() { // Clean any buffer. (From ajax script in admin.community.php) $out = ob_get_contents(); ob_end_clean(); parent::__construct(); }
public function ajaxTogglePublish($id, $type, $eventName = false) { // Send email notification to owner when a group is published. $config = CFactory::getConfig(); $event = JTable::getInstance('Event', 'CTable'); $event->load($id); // Added published = 2 for new created event under moderation. if ($type == 'published' && $event->published == 2) { $lang = JFactory::getLanguage(); $lang->load('com_community', JPATH_ROOT); $my = CFactory::getUser(); // Add notification //CFactory::load('libraries', 'notification'); //CFactory::load('helpers', 'event'); if ($event->type == CEventHelper::GROUP_TYPE && $event->contentid != 0) { $url = 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id . '&groupid=' . $event->contentid; } else { $url = 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id; } //Send notification email to owner $params = new CParameter(''); $params->set('url', 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id); $params->set('event', $event->title); $params->set('event_url', 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id); CNotificationLibrary::add('events_notify_creator', $my->id, $event->creator, JText::_('COM_COMMUNITY_EVENTS_PUBLISHED_MAIL_SUBJECT'), '', 'events.notifycreator', $params); //CFactory::load('libraries', 'events'); // Add activity stream for new created event. $event->published = 1; // by pass published checking. CEvents::addEventStream($event); // send notification email to group's member for new created event. CEvents::addGroupNotification($event); } return parent::ajaxTogglePublish($id, $type, 'events'); }
function __construct() { parent::__construct(); $this->registerTask('publish', 'savePublish'); $this->registerTask('unpublish', 'savePublish'); $this->registerTask('orderup', 'saveOrder'); $this->registerTask('orderdown', 'saveOrder'); }
public function ajaxTogglePublish($id, $type, $viewName = false) { // 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')) { $this->notificationApproval($group); } return parent::ajaxTogglePublish($id, $type, 'groups'); }
protected function messageEvent($postObj) { $event = $postObj->Event; switch ($event) { case 'subscribe': $user = User::model()->findByAttributes(array('udid' => $postObj->FromUserName)); if (!$user) { $user = new User(); $user->udid = $postObj->FromUserName; $user->create_at = $this->getTime(); } else { $user->status = 1; $user->times++; } $user->save(); WX::updateInfo($postObj->FromUserName); $this->returnText('love,love', $postObj); break; case 'unsubscribe': $user = User::model()->findByAttributes(array('udid' => $postObj->FromUserName)); if ($user) { $user->status = 0; $user->update_at = $this->getTime(); $user->save(); } $this->returnText('dont,love,love', $postObj); break; case 'LOCATION': $user = User::model()->findByAttributes(array('udid' => $postObj->FromUserName)); if ($user) { $user->x = floatval($postObj->Latitude); $user->y = floatval($postObj->Longitude); $user->locate = floatval($postObj->Precision); $user->update_at = $this->getTime(); $user->save(); } $this->returnText('get x,y', $postObj); break; case 'CLICK': $keyvalue = $postObj->EventKey; if ($keyvalue == 'TEM_COMMUNITY') { //创建临时的网点 CommunityController::createOrUpdate($postObj->FromUserName); } $this->returnText('创建临时网点成功', $postObj); break; } }
public 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 CParameter(''); $params->set('url', 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id); $params->set('groupName', $group->name); CNotificationLibrary::add('etype_groups_notify_creator', $my->id, $group->ownerid, JText::sprintf('COM_COMMUNITY_GROUPS_PUBLISHED_MAIL_SUBJECT', $group->name), '', 'groups.notifycreator', $params); } return parent::ajaxTogglePublish($id, $type, 'groups'); }
public function ajaxTogglePublish($id, $type, $viewName = false) { return parent::ajaxTogglePublish($id, $type, 'groupcategories'); }
public function ajaxCheckVersion() { $response = new JAXResponse(); $communityController = new CommunityController(); $stableVersion = $communityController->_getCurrentVersionData(); $localVersion = $communityController->_getLocalVersionNumber(); $data = $this->_getCurrentVersionData(); //this is only used to get the links for change log and update instructions ob_start(); if ($stableVersion) { // Test versions if (version_compare($localVersion, $stableVersion->version, '<')) { ?> <h5><?php echo JText::_('COM_COMMUNITY_UPDATE_SUMMARY'); ?> </h5> <div style="color: red"><?php echo JText::_('COM_COMMUNITY_OLDER_VERSION_OF_JOM_SOCIAL'); ?> </div> <div><?php echo JText::sprintf('Version installed: <span style="font-weight:700; color: red">%1$s</span>', $this->_getLocalVersionString()); ?> </div> <div><?php echo JText::sprintf('Latest version available: <span style="font-weight:700;">%1$s</span>', $stableVersion->version); ?> </div> <div><?php echo JText::sprintf('View full changelog at <a href="%1$s" target="_blank">%2$s</a>', $data->changelogURL, $data->changelogURL); ?> </div> <div><?php echo JText::sprintf('View the upgrade instructions at <a href="%1$s" target="_blank">%2$s</a>', $data->instructionURL, $data->instructionURL); ?> </div> <?php } else { ?> <div class="clearfix"> <h5><?php echo JText::_('COM_COMMUNITY_UPDATE_SUMMARY'); ?> </h5> <div><?php echo JText::_('COM_COMMUNITY_LATEST_VERSION_OF_JOM_SOCIAL'); ?> </div> <div><?php echo JText::sprintf('Version installed: <span style="font-weight:700;">%1$s</span>', $this->_getLocalVersionString()); ?> </div> </div> <?php } } else { ?> <div style="color: red"><?php echo JText::_('Please enable "allow_url_fopen" to check version'); ?> </div> <?php } $contents = ob_get_contents(); ob_end_clean(); $response->addAssign('cWindowContent', 'innerHTML', $contents); $action = '<input type="button" class="btn btn-small pull-right" onclick="cWindowHide();" name="' . JText::_('COM_COMMUNITY_CLOSE') . '" value="' . JText::_('COM_COMMUNITY_CLOSE') . '" />'; $response->addScriptCall('cWindowActions', $action); return $response->sendResponse(); }
public function ajaxTogglePublish($id, $type) { return parent::ajaxTogglePublish($id, $type, 'videoscategories'); }
public function ajaxTogglePublish($id, $type, $viewName = false) { $video = JTable::getInstance('Photo', 'CTable'); $video->load($id); return parent::ajaxTogglePublish($id, $type, 'photos'); }
public function ajaxTogglePublish($id, $type) { return parent::ajaxTogglePublish($id, $type, 'events'); }
function ajaxTogglePublish($id, $type) { return parent::ajaxTogglePublish($id, $type, 'groupcategories'); }
<div id="js-cpanel"> <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> <a href="<?php echo JRoute::_('index.php?option=com_community'); ?> " class="brand"> <small><?php echo JText::_('COM_COMMUNITY_CPANEL'); ?> </small> </a><!--/.brand--> <?php $communityController = new CommunityController(); $localVersion = $communityController->_getLocalVersionNumber(); ?> <span id="jomsocial-version" class="badge badge-important"><?php echo $localVersion; ?> </span> <ul class="nav ace-nav pull-right"> <li> <a class="dropdown-toggle" href="#"> <?php echo JText::_('COM_COMMUNITY_CONFIGURATION_NOTIFICATIONS'); ?> <i class="js-icon-bell-alt"></i>
public function ajaxTogglePublish($id, $type, $viewName = false) { CommunityLicenseHelper::_(); return parent::ajaxTogglePublish($id, $type, 'badges'); }
public function __construct() { parent::__construct(); $this->enableAzrulSystem(); }
} // Test if the object really exists in the current context if (!class_exists($class)) { // Throw some errors if the system is unable to locate the object's existance JError::raiseError(500, 'Invalid Controller Object. Class definition does not exists in this context.'); } $controller = new $class(); // Task's are methods of the controller. Perform the Request task $controller->execute($task); // Redirect if set by the controller $controller->redirect(); $out = ob_get_contents(); ob_end_clean(); $document = JFactory::getDocument(); preg_match('/[^-]+$/', $document->getTitle(), $match); $communityController = new CommunityController(); $groups = $communityController->getModel('Groups', 'CommunityAdminModel'); $reports = $communityController->getModel('Reports'); $mailque = $communityController->getModel('MailQueue'); $events = $communityController->getModel('Events'); $users = $communityController->getModel('Users'); /*Optimize query*/ $unsendMail = $mailque->getUnsendMail(); $pendingGroup = $groups->getPendingGroups(); $pendingEvent = $events->getPendingEvents(); $pendingReport = $reports->getPendingCount(); $pendingUser = $users->getPendingMember(); $view = $communityController->getView('community', 'html'); $stableVersion = $communityController->_getCurrentVersionData(); $localVersion = $communityController->_getLocalVersionNumber(); $isLatest = version_compare($localVersion, $stableVersion->version, '<');
public function ajaxTogglePublish($id, $field, $viewName = false) { return parent::ajaxTogglePublish($id, $field, 'userpoints'); }
public function display($cachable = false, $urlparams = array()) { $viewName = JRequest::getCmd('view', 'community'); // Set the default layout and view name $layout = JRequest::getCmd('layout', 'default'); // Get the document object $document = JFactory::getDocument(); // Get the view type $viewType = $document->getType(); $view = $this->getView($viewName, $viewType); $profile = $this->getModel('Profiles'); $view->setModel($profile, false); parent::display(); }
public function __construct() { parent::__construct(); }
public function ajaxTogglePublish($id, $field) { return parent::ajaxTogglePublish($id, $field, 'userpoints'); }