/** * Helper main function * @param $actionsHtml String HTML code showing the action buttons * @param $content String The content of this element * @param $dbId Int DB id of the object * @param $order Int order of this item in the DB * @param $params Array parameters (if any) * @return String HTML to be inserted in the view */ public function contentViewembeder($actionsHtml = '', $content = '', $dbId = 0, $order = 0, $params = array(), $pagstructureId = 0) { if (!empty($content)) { switch (Sydney_Tools_Sydneyglobals::getConf('helpers')->content->viewembedder->method) { case 'ajax': return Sydney_View_Embedder_Content::ajaxContents($content); break; case 'filegetcontents': return file_get_contents(Sydney_Tools::getRootUrl() . '/' . $content . '/sydneylayout/no/'); break; case 'curlgetcontents': return Sydney_View_Embedder_Content::curlGetContents(Sydney_Tools::getRootUrl() . $content . '/sydneylayout/no/'); break; case 'action': default: $i = 0; $module = null; $controller = null; $action = null; $oldv = null; $params2 = array(); foreach (preg_split("/\\//", $content) as $v) { if ($i == 1) { $module = $v; } elseif ($i == 2) { $controller = $v; } elseif ($i == 3) { $action = $v; } elseif ($i > 3) { if ($i % 2 == 0) { $params2[$v] = null; $oldv = $v; } if ($i % 2 == 1) { $params2[$oldv] = $v; $oldv = null; } } $i++; } return $this->view->action($action, $controller, $module, array_merge($params2, $params)); break; } } // END - if content return ''; }
public function __construct($id = 0) { $this->_schema = Sydney_Tools_Sydneyglobals::getConf()->db->params->dbname; parent::__construct($id); }
/** * @since 19/02/2014 */ public function getcleanurlpagebyidnodeAction() { $id = (int) $this->_getParam('id', null); $page = new Pagstructure(); $data = $page->get($id); $label = Sydney_Tools_Sydneyglobals::getConf('general')->url->newFormat && !empty($data['url']) ? $data['url'] : Sydney_Tools_Friendlyurls::getUrlLabel($data['label']); $this->view->resultSet = array('url' => Sydney_Tools_Friendlyurls::getFriendlyUrl($id, $label, 'page', new Zend_View_Helper_Url())); }
/** * Send the email * * @param string $emails List of recepients separated by a space * @param $dbRow * @return Zend_Mail | false */ protected function _sendEmailForms($emails = '', $dbRow) { $mail = new Zend_Mail(); // define the recipients $eValidator = new Zend_Validate_EmailAddress(); $sendTheMail = false; if (trim($emails) == '') { $email = Sydney_Tools_Sydneyglobals::getConf('general')->siteEmail; if ($eValidator->isValid($email)) { $mail->addTo($email, Sydney_Tools_Sydneyglobals::getConf('general')->siteTitle . ' website'); $sendTheMail = true; } } else { foreach (preg_split('/,/', $emails) as $email) { if ($eValidator->isValid(trim($email))) { $mail->addTo($email, Sydney_Tools_Sydneyglobals::getConf('general')->siteTitle . ' website'); $sendTheMail = true; } } } if ($sendTheMail) { $mail->setBodyText('This email is in HTML format'); $msg = '<br/><br/>You have received an email from the "email form" available on ' . Sydney_Tools_Sydneyglobals::getConf('general')->siteTitle . ' :<br/><br/><br/>'; if ($dbRow->fname != '') { $msg .= '<b>First Name</b> : ' . $dbRow->fname . '<br/>'; } if ($dbRow->lname != '') { $msg .= '<b>Last Name</b> : ' . $dbRow->lname . '<br/>'; } if ($dbRow->fullname != '') { $msg .= '<b>Full name</b> : ' . $dbRow->fullname . '<br/>'; } if ($dbRow->email != '') { $msg .= '<b>Email</b> : ' . $dbRow->email . '<br/>'; } if ($dbRow->phonenr != '') { $msg .= '<b>Phone Number</b> : ' . $dbRow->phonenr . '<br/>'; } if ($dbRow->subject != '') { $msg .= '<b>Subject</b> : ' . $dbRow->subject . '<br/>'; } if ($dbRow->message != '') { $msg .= '<b>Message</b> :<br/> ' . nl2br($dbRow->message) . '<br/>'; } $msg .= '<br/><br/>'; $mail->setBodyHtml($msg); $mail->setFrom($dbRow->email, $dbRow->fname . ' ' . $dbRow->lname . ' ' . $dbRow->fullname); $mail->setSubject('Email form - ' . $dbRow->subject); return $mail->send(); } else { return false; } }