ui = $ui; $this->t = $t; $this->post = $hooks->wrap( $post ); $this->settings = $hooks->wrap( $settings ); $this->sms = $hooks->wrap( $sms ); $this->notificationsTemplate = $hooks->wrap( $notificationsTemplate ); $this->uri = $uri; $this->layout = $layout; $this->request = $request; $this->self = $hooks->wrap( $this ); } public function breadcrumbs() { $ret = array(); $ret['admin'] = array( 'admin', '__Administration__' ); $ret['admin/reminders'] = array( 'admin/reminders', '__Reminders__' ); return $ret; } public function header() { $ret = '__Edit Templates__'; return $ret; } public function pnames() { $ret = [ 'reminders_template_subject_daily', 'reminders_template_subject_weekly', 'reminders_template_subject_monthly' ]; $smsEnabled = $this->sms->isEnabled(); if( $smsEnabled ){ $ret[] = 'reminders_template_subject_dailysms'; $ret[] = 'reminders_template_body_dailysms'; } return $ret; } public function post() { $pnames = $this->self->pnames(); foreach( $pnames as $pname ){ $this->settings->set( $pname, $this->post->get($pname) ); } $to = 'admin/reminders/templates'; $msg = '__Settings Updated__'; $ret = array( $to, $msg ); return $ret; } public function postReset() { $pnames = $this->self->pnames(); foreach( $pnames as $pname ){ $this->settings->reset( $pname ); } $to = 'admin/reminders/templates'; $msg = '__Settings Updated__'; $ret = array( $to, $msg ); return $ret; } public function render() { $pnames = $this->self->pnames(); $v = array(); foreach( $pnames as $pname ){ $v[ $pname ] = $this->settings->get( $pname ); } // post to $slug = $this->request->getSlug(); $to = $this->uri->makeUrl( $slug ); $toReset = $this->uri->makeUrl( $slug . '/reset' ); $smsEnabled = $this->sms->isEnabled(); // $tags = $this->notificationsTemplate->getTags( $calendar ); // $tags = $this->notificationsTemplate->getTags( ); ob_start(); ?>
layout ->setContent( $ret ) ->setHeader( $this->self->header() ) ->setBreadcrumb( $this->self->breadcrumbs() ) ; $ret = $this->layout->render(); return $ret; } }