コード例 #1
3
 private function printRelatorioHTMLPDF($html)
 {
     $this->getContext()->getConfiguration()->loadHelpers('Partial');
     $mpdf = new mPDF('', 'A4', '', '', 5, 5, 37, 37, 3, 3);
     $mpdf->useOnlyCoreFonts = true;
     // false is default
     $mpdf->SetWatermarkText("PÉROLA NEGRA");
     $mpdf->showWatermarkText = true;
     $mpdf->watermark_font = 'DejaVuSansCondensed';
     $mpdf->watermarkTextAlpha = 0.1;
     $mpdf->SetDisplayMode('fullpage');
     $stylesheet = file_get_contents('css/relatorios.css');
     $mpdf->WriteHTML($stylesheet, 1);
     $mpdf->SetHTMLHeader(utf8_encode(get_partial('header')));
     $mpdf->SetHTMLFooter(utf8_encode(get_partial('footer')));
     $mpdf->SetMargins(0, 0, 65);
     $mpdf->WriteHTML(utf8_encode($html));
     $mpdf->Output();
 }
コード例 #2
0
 public function render($options)
 {
     $options = $this->getOptions($options);
     $renderers = sfConfig::get('app_sympal_gallery_gallery_renderers');
     $partial = $renderers[$options['renderer'] ? $options['renderer'] : 'simple'];
     return get_partial($partial, array('gallery' => $this, 'options' => $options));
 }
コード例 #3
0
    public function sendSlotReachedMail() {
        $sf_i18n = sfContext::getInstance()->getI18N();
        $sf_i18n->setCulture($this->userSettings->userSettings['language']);
        $content['workflow'] = sfContext::getInstance()->getI18N()->__('Workflow' ,null,'slotreachedemail') . ' ' . $this->workflowTemplateSettings['name'];
        $content['currentslot'][0] = sfContext::getInstance()->getI18N()->__('The Slot' ,null,'slotreachedemail');
        $content['currentslot'][1] = $this->currentSlot['name'];
        $content['currentslot'][2] = sfContext::getInstance()->getI18N()->__('has been completed' ,null,'slotreachedemail');

        $content['nextSlot'][0] = sfContext::getInstance()->getI18N()->__('The new Slot' ,null,'slotreachedemail');
        $content['nextSlot'][1] = $this->nextSlot['name'];
        $content['nextSlot'][2] = sfContext::getInstance()->getI18N()->__('has been reached' ,null,'slotreachedemail');
        $subject = sfContext::getInstance()->getI18N()->__('CuteFlow: slot' ,null,'slotreachedemail') . ' ' . $this->nextSlot['name'] . ' ' . sfContext::getInstance()->getI18N()->__('reached' ,null,'slotreachedemail');
        $linkTo = sfContext::getInstance()->getI18N()->__('Direct link to workflow' ,null,'slotreachedemail');
        $this->setSender($this->userSettings->userSettings['systemreplyaddress']);
        $this->setReceiver(array ($this->userSettings->userData['email'] => $this->userSettings->userData['firstname'] . ' ' . $this->userSettings->userData['lastname']));
        $this->setSubject($subject);
        $this->setContentType('text/' . $this->userSettings->userSettings['emailformat']);
        $bodyData = array('text' => $content,
                          'userid' => $this->userSettings->userData['user_id'],
                          'workflowverion' => $this->workflowVersionId,
                          'workflow' => $this->workflowTemplateSettings['id'],
                          'linkto'  => $linkTo
                  );
        $this->setBody(get_partial('workflowdetail/' . $this->userSettings->userSettings['emailformat'] . 'SendSlotReached', $bodyData));
        $this->sendEmail();
    }
コード例 #4
0
    /**
     * Send mail, plain or html only values
     */
    public function sendEmailToStation() {
        $sf_i18n = $this->data->context->getI18N();
        $sf_i18n->setCulture($this->data->userSettings->userSettings['language']);
        
        $subject = $this->data->context->getI18N()->__('CuteFlow: values to' ,null,'sendstationmail') . ' ' . $this->data->workflowDetailsData['workflow'];
        $linkTo = $this->data->context->getI18N()->__('Direct link to workflow' ,null,'sendstationmail');
        
        $content['workflow'][0] = $this->data->context->getI18N()->__('You have received values for the workflow' ,null,'sendstationmail');
        $content['workflow'][1] = $this->data->workflowDetailsData['workflow'];
        $content['workflow'][2] = $this->data->context->getI18N()->__('Slot' ,null,'sendstationmail');
        $content['workflow'][3] = $this->data->context->getI18N()->__('Yes' ,null,'sendstationmail');
        $content['workflow'][4] = $this->data->context->getI18N()->__('No' ,null,'sendstationmail');
        $content['workflow'][5] = $this->data->context->getI18N()->__('Field' ,null,'sendstationmail');
        $content['workflow'][6] = $this->data->context->getI18N()->__('Value' ,null,'sendstationmail');



        $this->setSender($this->data->userSettings->userSettings['systemreplyaddress']);
        $this->setReceiver(array ($this->data->userSettings->userData['email'] => $this->data->userSettings->userData['firstname'] . ' ' . $this->data->userSettings->userData['lastname']));
        $this->setSubject($subject);
        $this->setContentType('text/' . $this->data->userSettings->userSettings['emailformat']);
        $bodyData = array('text' => $content,
                          'userid' => $this->data->userSettings->userData['user_id'],
                          'workflowverion' => $this->data->versionId,
                          'workflow' => $this->data->templateId,
                          'slots' => $this->data->slots,
                          'serverPath' => $this->data->serverUrl,
                          'linkto'  => $linkTo
                  );
        
        
        $this->setBody(get_partial('sendreminderemail/' . $this->data->userSettings->userSettings['emailformat'] . 'SendValuesToStation', $bodyData));
        $this->setAttachments($this->data->attachments);
        $this->sendEmail();
    }
コード例 #5
0
 public function authenticateUserRequest()
 {
     $authResult = $this->authenticateKey($this->request->getParameter('_key'));
     switch ($authResult) {
         case self::AUTH_FAIL_KEY:
             $this->response->setStatusCode(401);
             sfLoader::loadHelpers('Partial');
             $partial = get_partial('global/401');
             $this->response->setContent($partial);
             $this->response->setHttpHeader('WWW-Authenticate', 'Your request must include a query parameter named "_key" with a valid API key value. To obtain an API key, visit http://api.littlesis.org/register');
             $this->response->sendHttpHeaders();
             $this->response->sendContent();
             throw new sfStopException();
             break;
         case self::AUTH_FAIL_LIMIT:
             $this->response = sfContext::getInstance()->getResponse();
             $this->response->setStatusCode(403);
             $user = Doctrine::getTable('ApiUser')->findOneByApiKey($this->request->getParameter('_key'));
             sfLoader::loadHelpers('Partial');
             $partial = get_partial('global/403', array('request_limit' => $user->request_limit));
             $this->response->setContent($partial);
             $this->response->sendHttpHeaders();
             $this->response->sendContent();
             throw new sfStopException();
             break;
         case self::AUTH_SUCCESS:
             break;
         default:
             throw new Exception("Invalid return value from LsApi::autheticate()");
     }
 }
コード例 #6
0
 public function updateTimeline($request)
 {
     $newObject = new ActivityData();
     $newObject->setMemberId($this->getUser()->getMemberId());
     $this->form = new TimelineDataForm($newObject);
     $params = $request->getParameter('activity_data');
     $this->form->bind($params);
     if ($this->form->isValid()) {
         $this->form->save();
         if ($request->isXmlHttpRequest()) {
             $this->getContext()->getConfiguration()->loadHelpers('Partial');
             return $this->renderText(get_partial('default/activityRecord', array('activity' => $this->form->getObject())));
         } else {
             $this->redirect($params['next_uri']);
         }
     } else {
         if ($request->isXmlHttpRequest()) {
             $this->getResponse()->setStatusCode(500);
         } else {
             $this->getUser()->setFlash('error', 'Failed to post %activity%.');
             if (isset($params['next_uri'])) {
                 $this->redirect($params['next_uri']);
             }
             $this->redirect('@homepage');
         }
     }
 }
コード例 #7
0
 protected function execute($arguments = array(), $options = array())
 {
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $connection = $databaseManager->getDatabase($options['connection'])->getConnection();
     $users = UserTable::getInstance()->findAllUnlocked();
     foreach ($users as $user) {
         if (false == TimeLogItemTable::getInstance()->updateMissedBookings(time(), $user)) {
             if ($user->Setting->reminder == true && $this->isWorkingDay(date('N'), $user)) {
                 $mailer = $this->getMailer();
                 $mailserver = sfConfig::get('app_system_email');
                 $context = sfContext::createInstance($this->configuration);
                 $this->configuration->loadHelpers('Partial');
                 $i18n = $this->getI18N($user->Setting->culture);
                 $subject = 'TimeHive - ' . $i18n->__('Missing Booking');
                 $body = get_partial('global/missingBookings', array('user' => $user, 'i18n' => $i18n));
                 $message = $mailer->compose($mailserver['from'], $user->email, $subject);
                 $message->setBody($body, 'text/html');
                 try {
                     $mailer->send($message);
                 } catch (Exception $e) {
                     $this->log($e->getMessage());
                 }
             }
         }
     }
 }
コード例 #8
0
ファイル: actions.class.php プロジェクト: rayku/rayku
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $this->user = $this->getUser();
     //$user_id = $_SESSION['symfony/user/sfUser/attributes']['symfony/user/sfUser/attributes']['user_id'];
     $user = $this->getUser()->getRaykuUser();
     if ($user) {
         $user_id = $user->getId();
     }
     if (!$user_id) {
         $this->forward('/dashboard');
     }
     $this->setVar('user_id', $user_id);
     //Form submitted
     if (sfWebRequest::POST == $this->getRequest()->getMethod()) {
         $emails = $this->getRequestParameter('emails');
         $ref = $this->getRequestParameter('ref');
         if (!$emails) {
             echo "Invalid emails";
             return false;
         }
         $mail = Mailman::createMailer();
         $mail->setContentType('text/html');
         $mail->addAddress($emails);
         $mail->setSubject('Invitation');
         sfProjectConfiguration::getActive()->loadHelpers(array('Asset', 'Url', 'Partial'));
         $mail->setBody(get_partial('invitationEmailHtml', array('ref' => $ref, 'user' => $user)));
         $mail->send();
         //$this->forward('referrals', 'invitesSent');
     }
 }
コード例 #9
0
 public function render($name, $value = null, $attributes = array(), $errors = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Partial'));
     $default_parameters = array('form' => $this->getOption('form'), 'value' => $value, 'name' => $name);
     $parameters = array_merge($this->getOption('parameters'), $default_parameters);
     return get_partial($this->getOption('module') . '/' . $this->getOption('partial'), $parameters);
 }
コード例 #10
0
ファイル: PaymentMailer.php プロジェクト: sensorsix/app
 public static function sendInvoice($booking, $sendto)
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
     $mailer = sfContext::getInstance()->getMailer();
     $message = $mailer->compose(array('*****@*****.**' => 'lkm.ee'), $sendto, 'Invoice');
     $message->setBody(get_partial('Payment/invoice_email', array('booking' => $booking)), 'text/html');
     $mailer->send($message);
 }
 /**
  * @param string $help
  *
  * @return string
  */
 public function formatHelp($help)
 {
     if (!$help) {
         return '';
     }
     use_helper('Partial');
     return get_partial('help/link-modal', array('name' => 'jenkins/addBuild/parameter-description', 'title' => "Parameter", 'params' => array('help' => $help)));
 }
コード例 #12
0
 /**
  * Method for building display of an item on pagination lists.
  * Currently just calles symfony template after building up some
  * parameters to pass along.  Might not be most effecient method.
  * I think building an html string would be better on resources,
  * but a pain to construct, even as a HEREDOC.
  * @param Array $part, passed by reference for updating/appending
  * @param Array $specs_preview_fields, the fields most relevant for the current part category
  */
 public function buildDisplay(&$part, $specs_preview_fields)
 {
     // load 'Partial' helper from symfony library
     sfProjectConfiguration::getActive()->loadHelpers('Partial');
     //$cat_singular = LWS::getCategoryName($part['cat_slug'], true);
     $part['anchor_text'] = "{$part['part_no']}";
     // might want to change it for seo reasons, etc.
     $part['layout'] = get_partial('toolkit/basicListDisplay', array('part' => $part, 'display' => $part['display'], 'specs_preview_fields' => $specs_preview_fields));
 }
コード例 #13
0
ファイル: CommentsHelper.php プロジェクト: slemoigne/sympal
function get_sympal_comments($content)
{
    $approvedComments = array();
    foreach ($content->getComments() as $comment) {
        if ($comment->isApproved()) {
            $approvedComments[] = $comment;
        }
    }
    return get_partial('sympal_comments/for_content', array('content' => $content, 'comments' => $approvedComments, 'form' => get_sympal_new_comment_form($content)));
}
コード例 #14
0
 public function configure()
 {
     $target = $this->getOption('target');
     $options = array('file_src' => '', 'is_image' => true, 'with_delete' => false, 'label' => sfInflector::humanize($target));
     sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
     $options['template'] = get_partial('opSkinClassicPlugin/formEditImage', array('target' => $target));
     $this->setWidget('image', new sfWidgetFormInputFileEditable($options, array('size' => 10)));
     $this->setValidator('image', new opValidatorImageFile(array('required' => true)));
     $this->widgetSchema->setNameFormat('image[' . $target . '][%s]');
 }
コード例 #15
0
 public function returnJSON($data)
 {
     $json = json_encode($data);
     if (sfConfig::get('sf_debug') && !$this->getRequest()->isXmlHttpRequest()) {
         $this->getContext()->getConfiguration()->loadHelpers('Partial');
         $this->renderText(get_partial('sfVkontakteFetch/jsonDebug', array('data' => $data, 'json' => $json)));
     } else {
         $this->getResponse()->setHttpHeader('Content-type', 'application/json');
         $this->renderText($json);
     }
     return sfView::NONE;
 }
コード例 #16
0
 public function executeCompute(sfWebRequest $request)
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
     //       $heroId = $request->getParameter('heroId');
     $heroLevel = $request->getParameter('heroLevel');
     //       $itemIds = $request->getParameter('itemIds');
     $heroId = 1;
     $itemIds = array(1, 2);
     echo json_encode(array('html' => get_partial('main/stats', array('data' => DotaResourceData::getInstance()->getData($heroId, $heroLevel, $itemIds)))));
     $this->getResponse()->setContentType('text/json');
     exit;
 }
コード例 #17
0
 /**
  * Renders the widget.
  *
  * @param  string $name        The element name
  * @param  string $value       The value displayed in this widget
  * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
  * @param  array  $errors      An array of errors for the field
  *
  * @return string An HTML tag string
  *
  * @see sfWidgetForm
  */
 public function render($name, $value = null, $attributes = array(), $errors = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Partial'));
     $fields = $this->getParent()->getFields();
     $options = is_array($this->getOption('params')) ? $this->getOption('params') : array($this->getOption('params'));
     $partial = get_partial($this->getOption('partial'), array_merge(compact('value', 'name', 'attributes', 'errors'), $options));
     if (false !== $this->getOption('has_hidden')) {
         $hiddenInput = new sfWidgetFormInputHidden();
         return $partial . $hiddenInput->render($name, $value, $attributes, $errors);
     }
     return $partial;
 }
コード例 #18
0
 public function setPhoto()
 {
     $options = array('file_src' => '', 'is_image' => true, 'with_delete' => false, 'label' => 'CoverImage', 'edit_mode' => !$this->isNew());
     if (!$this->isNew() && $this->getObject()->getFileId()) {
         sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
         $options['template'] = get_partial('album/formEditImage', array('image' => $this->getObject()));
         $options['with_delete'] = true;
         $this->setValidator('file_id_delete', new sfValidatorBoolean(array('required' => false)));
     }
     $this->setWidget('file_id', new sfWidgetFormInputFileEditable($options, array('size' => 40)));
     $this->setValidator('file_id', new opValidatorImageFile(array('required' => false)));
 }
コード例 #19
0
 /**
  * Render the image browser widget
  *
  * @param string $name
  * @param mixed $value
  * @param array $attributes
  * @param array $errors
  * @return string Widget HTML
  */
 public function render($name, $value = null, $attributes = array(), $errors = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Partial'));
     $object = $this->getOption('object');
     $per_page = sfConfig::get('app_sf_image_pool_chooser_per_page', 24);
     $tag = $object->getTagRestriction();
     if ($tag) {
         $tag = implode(',', $tag);
     }
     // Because we use this for image upload
     $vars = array('pager' => sfImagePoolImageTable::getInstance()->getPager($per_page, 1, $object), 'name' => $name, 'object' => $object, 'per_page' => $per_page, 'images' => $object->getPoolImages(), 'multiple' => (bool) $object->allowSelectMultiple(), 'tag' => $tag);
     return get_partial('sfImagePoolAdmin/widget', $vars);
 }
コード例 #20
0
ファイル: actions.class.php プロジェクト: rayku/rayku
 private function sendConfirmationEmail(User $user, $question)
 {
     $mail = Mailman::createMailer();
     $mail->setContentType('text/html');
     $mail->addAddress($user->getEmail());
     $mail->setSubject('Activate your new account');
     sfProjectConfiguration::getActive()->loadHelpers(array('Asset', 'Url', 'Partial'));
     $confirmationCode = array('code' => $user->getConfirmationCode(), 'question' => $question);
     $confirmationCode = base64_encode(serialize($confirmationCode));
     $mail->setBody(get_partial('activationEmail', array('confirmationCode' => $confirmationCode, 'user' => $user)));
     $mail->setAltBody(get_partial('activationEmailHtml', array('confirmationCode' => url_for('@register_confirm?code=' . $confirmationCode, true), 'user' => $user)));
     $mail->send();
 }
コード例 #21
0
 public function setup()
 {
     parent::setup();
     $this->useFields();
     $options = array('file_src' => '', 'is_image' => true, 'with_delete' => true, 'delete_label' => sfContext::getInstance()->getI18N()->__('remove the current photo'), 'label' => false, 'edit_mode' => !$this->isNew());
     $key = 'photo';
     if (!$this->isNew()) {
         sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
         $options['template'] = get_partial('communityTopic/formEditImage', array('image' => $this->getObject()));
         $this->setValidator($key . '_delete', new sfValidatorBoolean(array('required' => false)));
     }
     $this->setWidget($key, new sfWidgetFormInputFileEditable($options, array('size' => 40)));
     $this->setValidator($key, new opValidatorImageFile(array('required' => false)));
 }
コード例 #22
0
    /**
     * Should the User be shown a notification
     */
    public function displayNotification()
    {
        if ($this->notifyUser()) {
            $detail = $this->_thresholds[$this->_loginCount];

            $this->_notification->setUserId(\CPFCMembers\Auth::getUser()->getId())
                ->setDetail($detail)
                ->setStatus('incomplete');

            $this->_notification->save(true);

            get_partial('partials/notification_banner', array('detail' => $detail));
        }
    }
コード例 #23
0
 public function setup()
 {
     parent::setup();
     unset($this['message_id']);
     unset($this['file_id']);
     unset($this['created_at'], $this['updated_at']);
     $key = 'image';
     $options = array('file_src' => '', 'is_image' => true, 'with_delete' => true, 'delete_label' => 'remove the current image', 'label' => false, 'edit_mode' => !$this->isNew());
     if (!$this->isNew()) {
         sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
         $options['template'] = get_partial('message/formEditImage', array('image' => $this->getObject()));
         $this->setValidator($key . '_delete', new sfValidatorBoolean(array('required' => false)));
     }
     $this->setWidget($key, new sfWidgetFormInputFileEditable($options, array('size' => 40)));
     $this->setValidator($key, new opValidatorImageFile(array('required' => false)));
 }
コード例 #24
0
ファイル: actions.class.php プロジェクト: auphau/joyreactor
 public function executeMainPageTrigger(sfWebRequest $request)
 {
     sfApplicationConfiguration::getActive()->loadHelpers(array('Partial'));
     $this->filename = 'error';
     $post = Doctrine::getTable('Post')->find(array($this->getRequestParameter('post_id')));
     $admin = sfGuardUser::getAdminUser();
     if ($admin && $admin->getProfile()->getUsecrossposting() && urldecode($this->getRequestParameter('login')) == $admin->getProfile()->getLjlogin() && urldecode($this->getRequestParameter('pass')) == $admin->getProfile()->getLjpassword() && $post != null) {
         if (!$post->getLj() && $post->getRating() >= sfConfig::get('app_post_mainpage_threshold')) {
             func::crossposting($admin->getProfile()->getLjlogin(), $admin->getProfile()->getLjpassword(), get_partial('post/post_lj', array('post' => $post, 'showUsername' => 1)), $post->getMoodNameI18N(), $post->getMoodSmile());
             $post->setLj(1);
             $post->save();
             $this->filename = 'ok';
         }
     }
     return $this->renderPartial('upload', array('filename' => $this->filename));
 }
コード例 #25
0
 public function configure()
 {
     $this->setCommunity($this->getOption('community'));
     $options = array('file_src' => '', 'is_image' => true, 'with_delete' => true, 'delete_label' => sfContext::getInstance()->getI18N()->__('Remove the current photo'));
     if (!$this->community->isNew() && $this->community->getFileId()) {
         sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
         $options['edit_mode'] = true;
         $options['template'] = get_partial('default/formEditImage', array('image' => $this->community));
         $this->setValidator('file_delete', new sfValidatorBoolean(array('required' => false)));
     } else {
         $options['edit_mode'] = false;
     }
     $this->setWidget('file', new sfWidgetFormInputFileEditable($options, array('size' => 40)));
     $this->setValidator('file', new opValidatorImageFile(array('required' => false)));
     $this->widgetSchema->setLabel('file', 'Photo');
     $this->widgetSchema->setNameFormat('community_file[%s]');
 }
 protected function execute($arguments = array(), $options = array())
 {
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $connection = $databaseManager->getDatabase($options['connection'])->getConnection();
     // load the partial helper
     $context = sfContext::createInstance($this->configuration);
     $context->getConfiguration()->loadHelpers(array('Partial'));
     $userQuery = Doctrine_Query::create()->from('sfGuardUserPassword sgup')->innerJoin('sgup.User u')->orderBy('sgup.created_at DESC');
     $results = $userQuery->execute();
     foreach ($results as $result) {
         if ($this->hasEmailedUser($result->getUserId())) {
             continue;
         }
         $this->getMailer()->composeAndSend(sfConfig::get('app_sf_guard_extra_plugin_password_expiration_email_from'), $result->getUser()->getEmailAddress(), 'Password Expired', get_partial('sfGuardAuthExtra/expiredPasswordEmail'));
         $this->userEmailed($result->getUserId());
     }
 }
コード例 #27
0
    /**
     * Send Email
     * @param  mixed $to           String or array of recipient(s)
     * @param  string $subject     Email Subject
     * @param  string $message     Message Content
     * @param  mixed $headers      Headers (array or string)
     * @param  mixed $attachments  Files to attach: a single filename, an array of filenames, or a newline-delimited string list of multiple
     * @return NULL
     */
    public function send($to, $subject, $headers = null, $attachments = null) {
        $message = get_partial($this->_templatePath, $this->_data, true);

        if (!defined('SITE_MODE_EMAIL') || SITE_MODE_EMAIL != 'live') {
            $message .= " (Test Email, Original Recipient: {$to})";
            $to = '*****@*****.**';
            if (defined('DEVELOPER_EMAIL')) {
                $to = DEVELOPER_EMAIL;
            }
        }

        // Add "From" Name and Address
        $headers .= 'From: ' . get_field('emails_from_name', 'option') . ' <' . get_field('emails_from_email_address', 'option') . '>' . "\r\n";

        add_filter( 'wp_mail_content_type', array($this, 'setHtmlContentType'));
        wp_mail($to, $subject, $message, $headers, $attachments);
        remove_filter( 'wp_mail_content_type', array($this, 'setHtmlContentType'));
    }
コード例 #28
0
 public function __construct($shipto_zip, $pkg_qty, $pkg_weight = 1, $params = array())
 {
     sfProjectConfiguration::getActive()->loadHelpers('Partial');
     // load default parameters
     $this->_p = array('access_key' => 'BC645952EAC4DB68', 'user_id' => 'morganney', 'password' => 'lw@235!', 'shipper_zip' => '94080', 'shipto_zip' => $shipto_zip, 'ups_account_no' => '05RR19', 'pkg_qty' => 1, 'pkg_weight' => 1, 'request_option' => 'Shop', 'service_code' => '03');
     // override defaults with user supplied values
     foreach ($params as $key => $value) {
         if (array_key_exists($key, $this->_p)) {
             $this->_p[$key] = $value;
         }
     }
     $this->_request = get_partial('toolkit/upsRateRequest', array('p' => $this->_p));
     // ups services that livewire offers customers
     $this->_service_code_map = array('03' => 'Ground', '12' => '3 Day Select', '02' => '2nd Day Air', '13' => 'Next Day Air Saver', '14' => 'Next Dair Air Early A.M.');
     $this->_markup = 1.2;
     $this->_rates = NULL;
     $this->_error_msg = NULL;
 }
コード例 #29
0
function get_sympal_content_slot_editor(sfSympalContent $content, sfSympalContentSlot $slot, $options = array())
{
    $content->setEditableSlotsExistOnPage(true);
    $slot->setContentRenderedFor($content);
    $name = $slot->getName();
    $isColumn = $slot->getIsColumn();
    $form = $slot->getEditForm();
    $renderedValue = $slot->render();
    if (!$renderedValue && sfSympalContext::getInstance()->shouldLoadFrontendEditor()) {
        $renderedValue = __('[Double click to enable inline edit mode.]');
    }
    return '
<span title="' . __('[Double click to enable inline edit mode.]') . '" id="sympal_content_slot_' . $slot->getId() . '" class="sympal_content_slot">
  <input type="hidden" class="content_slot_id" value="' . $slot->getId() . '" />
  <input type="hidden" class="content_id" value="' . $slot->getContentRenderedFor()->getId() . '" />
  <span class="editor">' . get_partial('sympal_edit_slot/slot_editor', array('form' => $form, 'contentSlot' => $slot)) . '</span>
  <span class="value toggle_edit_mode">' . $renderedValue . '</span>
</span>';
}
コード例 #30
0
ファイル: actions.class.php プロジェクト: rayku/rayku
 public function executeIndex()
 {
     $search = $this->getSearch();
     $sCriteria = $this->getRequestParameter('criteria');
     if (trim($sCriteria) == '') {
         return sfView::ERROR;
     }
     $findfrom = $this->getRequestParameter('findfrom', 'ALL');
     switch ($findfrom) {
         case "ALL":
             $search->withinUsers($this->getUser());
             $search->withinPosts();
             //          $search->withinGroups();
             break;
         case "people":
             $search->withinUsers($this->getUser());
             break;
         case "posts":
             $search->withinPosts();
             break;
             //			case "groups": $search->withinGroups(); break;
     }
     if ($search->nrOfObjects() == 0) {
         return sfView::ERROR;
     }
     //Setup the pager and grab the appropriate resultset
     $pager = new SearchPager('Search', 4);
     $pager->setSearch($search);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $raykuPager = new RaykuPagerRenderer($pager);
     $raykuPager->setBaseUrl('search/index' . ($sCriteria != '' ? '?criteria=' . $sCriteria : '') . '&findfrom=' . $findfrom);
     $raykuPager->setLinkToRemoteElementId('tcontent');
     if ($this->getRequest()->isXmlHttpRequest()) {
         sfProjectConfiguration::getActive()->loadHelpers('Partial');
         return $this->renderText(get_partial('allList', array('raykuPager' => $raykuPager, 'search' => $search)));
     }
     $this->raykuPager = $raykuPager;
     $this->search = $search;
 }