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


PHP FRoute::controller方法代码示例

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


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

示例1: notifyAdminsModeration

 /**
  * Notify site admins that a group is created and it is pending moderation.
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function notifyAdminsModeration(SocialGroup $group)
 {
     // Push arguments to template variables so users can use these arguments
     $params = array('title' => $group->getName(), 'creatorName' => $group->getCreator()->getName(), 'categoryTitle' => $group->getCategory()->get('title'), 'avatar' => $group->getAvatar(SOCIAL_AVATAR_LARGE), 'permalink' => JURI::root() . 'administrator/index.php?option=com_easysocial&view=groups&layout=pending', 'reject' => FRoute::controller('groups', array('external' => true, 'task' => 'rejectGroup', 'id' => $group->id, 'key' => $group->key)), 'approve' => FRoute::controller('groups', array('external' => true, 'task' => 'approveGroup', 'id' => $group->id, 'key' => $group->key)), 'alerts' => false);
     // Set the e-mail title
     $title = JText::sprintf('COM_EASYSOCIAL_EMAILS_GROUP_CREATED_MODERATOR_EMAIL_TITLE', $group->getName());
     // Get a list of super admins on the site.
     $usersModel = FD::model('Users');
     $admins = $usersModel->getSiteAdmins();
     foreach ($admins as $admin) {
         // Ensure that the user is a site admin or the Receive System email is turned off
         if (!$admin->isSiteAdmin() || !$admin->sendEmail) {
             continue;
         }
         // Immediately send out emails
         $mailer = FD::mailer();
         // Set the admin's name.
         $params['adminName'] = $admin->getName();
         // Get the email template.
         $mailTemplate = $mailer->getTemplate();
         // Set recipient
         $mailTemplate->setRecipient($admin->getName(), $admin->email);
         // Set title
         $mailTemplate->setTitle($title);
         // Set the template
         $mailTemplate->setTemplate('site/group/moderate', $params);
         // Set the priority. We need it to be sent out immediately since this is user registrations.
         $mailTemplate->setPriority(SOCIAL_MAILER_PRIORITY_IMMEDIATE);
         // Try to send out email to the admin now.
         $state = $mailer->create($mailTemplate);
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:41,代码来源:groups.php

示例2: notifyGroupAdmins

 /**
  * Notify admins of the group
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function notifyGroupAdmins($action, $data = array())
 {
     $model = FD::model('Groups');
     $targets = $model->getMembers($this->id, array('admin' => true));
     if ($action == 'request') {
         $actor = FD::user($data['userId']);
         $params = new stdClass();
         $params->userName = $actor->getName();
         $params->userLink = $actor->getPermalink(false, true);
         $params->userAvatar = $actor->getAvatar(SOCIAL_AVATAR_LARGE);
         $params->groupName = $this->getName();
         $params->groupAvatar = $this->getAvatar();
         $params->groupLink = $this->getPermalink(false, true);
         $params->approve = FRoute::controller('groups', array('external' => true, 'task' => 'approve', 'userId' => $actor->id, 'id' => $this->id, 'key' => $this->key));
         $params->reject = FRoute::controller('groups', array('external' => true, 'task' => 'reject', 'userId' => $actor->id, 'id' => $this->id, 'key' => $this->key));
         $params->group = $this->getName();
         // Send notification e-mail to the target
         $options = new stdClass();
         $options->title = 'COM_EASYSOCIAL_EMAILS_USER_REQUESTED_TO_JOIN_GROUP_SUBJECT';
         $options->template = 'site/group/moderate.member';
         $options->params = $params;
         // Set the system alerts
         $system = new stdClass();
         $system->uid = $this->id;
         $system->actor_id = $actor->id;
         $system->target_id = $this->id;
         $system->context_type = 'groups';
         $system->type = SOCIAL_TYPE_GROUP;
         $system->url = $this->getPermalink(false, true, 'item', false);
         FD::notify('groups.requested', $targets, $options, $system);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:40,代码来源:group.php

示例3: notifyAdmins

 /**
  * Notify users and administrator when they create an account on the site.
  *
  * @since	1.0
  * @access	public
  * @param	SocialUser			The user object.
  * @param	SocialTableProfile	The profile type.
  * @return	bool				True if success, false otherwise.
  * @author	Mark Lee <mark@stackideas.com>
  */
 public function notifyAdmins($data, SocialUser $user, SocialTableProfile $profile, $oauth = false)
 {
     // Get the application data.
     $jConfig = FD::jConfig();
     // Generate a key for the admin's actions.
     $key = md5($user->password . $user->email . $user->name . $user->username);
     $config = FD::config();
     if ($config->get('registrations.emailasusername')) {
         $data['username'] = $user->email;
     }
     // Push arguments to template variables so users can use these arguments
     $params = array('site' => $jConfig->getValue('sitename'), 'username' => $data['username'], 'password' => $data['password'], 'firstName' => !empty($data['first_name']) ? $data['first_name'] : '', 'middleName' => !empty($data['middle_name']) ? $data['middle_name'] : '', 'lastName' => !empty($data['last_name']) ? $data['last_name'] : '', 'name' => $user->getName(), 'avatar' => $user->getAvatar(SOCIAL_AVATAR_LARGE), 'profileLink' => $user->getPermalink(true, true), 'email' => $user->email, 'activation' => FRoute::controller('registration', array('external' => true, 'task' => 'activate', 'activation' => $user->activation)), 'reject' => FRoute::controller('registration', array('external' => true, 'task' => 'rejectUser', 'id' => $user->id, 'key' => $key)), 'approve' => FRoute::controller('registration', array('external' => true, 'task' => 'approveUser', 'id' => $user->id, 'key' => $key)), 'manageAlerts' => false, 'profileType' => $profile->get('title'));
     // Get the email title.
     $title = $profile->getModeratorEmailTitle($user->username);
     // Get the email format.
     $format = $profile->getEmailFormat();
     // Get a list of super admins on the site.
     $usersModel = FD::model('Users');
     $admins = $usersModel->getSiteAdmins();
     foreach ($admins as $admin) {
         if (!$admin->sendEmail) {
             continue;
         }
         // Immediately send out emails
         $mailer = FD::mailer();
         // Set the admin's name.
         $params['adminName'] = $admin->getName();
         // Get the email template.
         $mailTemplate = $mailer->getTemplate();
         // Set recipient
         $mailTemplate->setRecipient($admin->getName(), $admin->email);
         // Set title
         $mailTemplate->setTitle($title);
         // Set the template
         $template = $profile->getModeratorEmailTemplate('', $oauth);
         $mailTemplate->setTemplate($template, $params, $format);
         // Set the priority. We need it to be sent out immediately since this is user registrations.
         $mailTemplate->setPriority(SOCIAL_MAILER_PRIORITY_IMMEDIATE);
         // Try to send out email to the admin now.
         $state = $mailer->create($mailTemplate);
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:53,代码来源:registration.php

示例4: notifyAdmins

 /**
  * Notifies administrator when a new event is created.
  *
  * @since   1.3
  * @access  public
  * @param   string
  * @return
  */
 public function notifyAdmins($event)
 {
     $params = array('title' => $event->getName(), 'creatorName' => $event->getCreator()->getName(), 'creatorLink' => $event->getCreator()->getPermalink(false, true), 'categoryTitle' => $event->getCategory()->get('title'), 'avatar' => $event->getAvatar(SOCIAL_AVATAR_LARGE), 'permalink' => $event->getPermalink(true, true), 'alerts' => false);
     $title = JText::sprintf('COM_EASYSOCIAL_EMAILS_MODERATE_EVENT_CREATED_TITLE', $event->getName());
     $template = 'site/event/created';
     if ($event->state === SOCIAL_CLUSTER_PENDING) {
         $params['reject'] = FRoute::controller('events', array('external' => true, 'task' => 'rejectEvent', 'id' => $event->id, 'key' => $event->key));
         $params['approve'] = FRoute::controller('events', array('external' => true, 'task' => 'approveEvent', 'id' => $event->id, 'key' => $event->key));
         $template = 'site/event/moderate';
     }
     $admins = FD::model('Users')->getSiteAdmins();
     foreach ($admins as $admin) {
         if (!$admin->sendEmail) {
             continue;
         }
         $mailer = FD::mailer();
         $params['adminName'] = $admin->getName();
         // Get the email template.
         $mailTemplate = $mailer->getTemplate();
         // Set recipient
         $mailTemplate->setRecipient($admin->getName(), $admin->email);
         // Set title
         $mailTemplate->setTitle($title);
         // Set the template
         $mailTemplate->setTemplate($template, $params);
         // Set the priority. We need it to be sent out immediately since this is user registrations.
         $mailTemplate->setPriority(SOCIAL_MAILER_PRIORITY_IMMEDIATE);
         // Try to send out email to the admin now.
         $state = $mailer->create($mailTemplate);
     }
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:39,代码来源:events.php


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