/** * Returns the fully rendered HTML of a post in the JSON output. * * @return string */ public function getHtmlAttribute() { if (!$this->trashed()) { return \View::make('content.board.post', ['board' => $this->board, 'post' => $this, 'user' => user(), 'op' => false, 'reply_to' => $this->reply_to ?: $this->board_id, 'preview' => false])->render(); } return null; }
/** *Renders a single post. * * @return string HTML */ public function toHTML($catalog, $multiboard, $preview) { $rememberTags = ["board.{$this->board->board_uri}", "post_{$this->post_id}", "post_html"]; $rememberTimer = 30; $rememberKey = "board.{$this->board->board_uri}.post_html.{$this->board_id}"; $rememberClosure = function () use($catalog, $multiboard, $preview) { $this->setRelation('attachments', $this->attachments->reverse()); return \View::make('content.board.post', ['board' => $this->board, 'post' => $this, 'user' => user(), 'catalog' => $catalog, 'reply_to' => $this->reply_to ?: false, 'multiboard' => $multiboard, 'preview' => $preview])->render(); }; if (!user()->isAnonymous()) { return $rememberClosure(); } if ($catalog) { $rememberTags[] = "catalog_post"; $rememberTimer += 30; } if ($multiboard) { $rememberTags[] = "multiboard_post"; $rememberTimer -= 20; } if ($preview) { $rememberTags[] = "preview_post"; $rememberTimer -= 20; } switch (env('CACHE_DRIVER')) { case "file": case "database": break; default: return Cache::tags($rememberTags)->remember($rememberKey, $rememberTimer, $rememberClosure); } return $rememberClosure(); }
/** * Returns the fully rendered HTML of a post in the JSON output. * * @return string */ public function getHtmlAttribute() { if (!$this->trashed()) { return \View::make('content.board.thread', ['board' => $this->board, 'thread' => $this, 'op' => false, 'reply_to' => $this->reply_to ?: $this->board_id])->render(); } return null; }
public function makeAssignRoleFeatureForm($rid) { $role = Role::find($rid); $feature_not_in_role = Role::getFeaturesNotAssignedToCurrentRole($rid); return View::make('backend.role.feature_assign')->with('feature_not_in_role', $feature_not_in_role)->with('role', $role)->with('module', $this->module); }
public function proposal_invite($user) { $unsubscribelink = unsubscribe_link($user->id, $user->email, 'job_invite_cron'); $targetlink = Autologin::to($user, $this->plink() . '?utm_source=proposal_invite&utm_medium=email&utm_campaign=Notifications'); $data = array('targetlink' => $targetlink, 'unsubscribelink' => $unsubscribelink, 'job' => $this, 'from' => UPDATE_EMAIL, 'from_name' => SENDER_NAME, 'to' => $user->email, 'fname' => $user->fname, 'subject' => $user->fname . ', you have received a job request from ' . $this->user->fname); $mailer = new Mailer(); $mailer->sender_email = $data['from']; $mailer->sender_name = $data['from_name']; $mailer->receiver_email = $data['to']; $mailer->receiver_name = $data['fname']; $mailer->subject = $data['subject']; $mailer->message = View::make('emails.jobs/proposal_invite', $data)->render(); $mailer->status = '0'; $mailer->priority = '1'; $mailer->save(); return TRUE; }
public function makeCreatePermissionForm($fid) { $feature = Feature::find($fid); if (!isset($feature)) { return Redirect::to('/crm/feature')->withMessage(Generate::message('Invalid', 'Invalid Feature or Feature has been deleted')); } $all_positions = Permission::getAllCurrentPosition(); $icons = SysConfig::getSystemConfig('Icons'); $icon_bgs = SysConfig::getSystemConfig('IconBG'); $all_pages = Permission::getAllCurrentPages(); $all_prompt_types = Permission::getAllCurrentPromptTypes(); return View::make('backend.feature.create_permission')->with('feature', $feature)->with('icons', $icons)->with('icon_bgs', $icon_bgs)->with('all_prompt_types', $all_prompt_types)->with('all_pages', $all_pages)->with('all_positions', $all_positions)->with('module', $this->module); }