<?php
-class wsServices extends cubeFlashGateway {
+class wsServices extends cubeFlashGateway
+{
const CNAME = __CLASS__;
- public static function in($args) {
+ public static function in($args)
+ {
global $core;
$args = cubePage::getArgs($args);
$n = self::CNAME;
$gateway = new $n($core->con, $args);
}
- public function sendEmail() {
+ public function sendEmail()
+ {
global $core;
if (!$this->_checkHash()) {
return;
$this->xml->addChild('ok', $mail->send() ? '1' : '0');
}
- protected function _checkHash() {
+ protected function _checkHash()
+ {
// Check protection hash
$hash = md5(substr($this->args['fromemail'], 2, 6) . substr($this->args['email'], 3, 5) . 'SFGHF566!S' . $this->args['id']);
if ($hash != $this->args['hash']) {
return true;
}
- public function sendBookmarks() {
+ public function sendBookmarks()
+ {
if (!$this->_checkHash()) {
return;
}
}
}
- protected function shortenURL($url, $id) {
+ protected function shortenURL($url, $id)
+ {
$bitLyUser = 'fluidbook';
$bitLyKey = 'R_3858dd1c9884d5c6a5fe386d7e95cf1d';
// Recherche dans le cache
*
* @return
*/
- public function facebook_thumbnail() {
+ public function facebook_thumbnail()
+ {
$this->outputXML = false;
$dao = new wsDAOBook($this->con);
exit;
}
- public function facebookShare() {
+ public function facebookShare()
+ {
http::redirect('http://www.facebook.com/sharer/sharer.php?u=' . urlencode($this->args['url']));
exit;
}
- public function googleplusShare() {
+ public function googleplusShare()
+ {
http::redirect('https://plus.google.com/share?url=' . urlencode($this->args['url']) . "&sgp=1");
exit;
}
- public function linkedinShare() {
+ public function linkedinShare()
+ {
http::redirect('https://www.linkedin.com/cws/share?url=' . urlencode($this->args['url']) . '&isFramed=true&_ts=' . microtime(true));
}
- public function viadeoShare() {
+ public function viadeoShare()
+ {
http::redirect('http://www.viadeo.com/shareit/share/?url=' . urlencode($this->args['url']));
}
- public function twitterShare() {
+ public function twitterShare()
+ {
$url = $this->shortenURL($this->args['url'], $this->args['id']);
$post = str_replace('%short%', $url, $this->args['post']);
exit;
}
- public function searchHints() {
+ public function searchHints()
+ {
$index = Zend_Search_Lucene::open(WS_BOOKS . '/search/' . $this->args['id']);
$charsLimit = 2;
$this->xml->addChild('hints', json_encode($res));
}
- public function searchResults() {
+ public function searchResults()
+ {
$index = Zend_Search_Lucene::open(WS_BOOKS . '/search/' . $this->args['id']);
$terms = $this->getTerms($this->args['term']);
$this->xml->addChild('terms', implode(',', $terms));
}
- protected function getTerms($term) {
+ protected function getTerms($term)
+ {
$term = trim($term, '*? ');
$term = mb_strtolower($term);
$term = cubeText::removeAccents($term);
return $terms;
}
- public function printpdf() {
+ public function printpdf()
+ {
$this->outputXML = false;
$this->exportpdf(true);
}
- public function getPDFComplex($book = null, $range = null) {
+ public function getPDFComplex($book = null, $range = null)
+ {
global $core;
if (is_null($book)) {
return array('url' => $destURL, 'file' => $destFile);
}
- public function getPDFComplexBaseDocument($book) {
+ public function getPDFComplexBaseDocument($book)
+ {
global $core;
return $res;
}
- public function e() {
+ public function e()
+ {
$this->args['cid'] = $this->callArgs[0];
$this->args['range'] = $this->callArgs[1];
return $this->exportpdf();
}
- public function p() {
+ public function p()
+ {
$this->args['cid'] = $this->callArgs[0];
$this->args['range'] = $this->callArgs[1];
return $this->exportpdf(true);
}
- public function exportpdf($print = false) {
+ public function exportpdf($print = false)
+ {
global $core;
set_time_limit(0);
}
}
- public function bulle() {
+ public function bulle()
+ {
global $core;
$e = explode('-', $this->args['catalogue'], 2);
if (count($e) == 2) {
$c->insert();
}
- public function getBulleList() {
+ public function getBulleList()
+ {
$user = 'bulle';
$pass = '23bu1l300';
$this->outputXML = false;
}
}
- public function grdfValidForm() {
+ public function grdfValidForm()
+ {
$notempty = array('civilite', 'prenom', 'nom', 'adresse', 'codepostal', 'ville', 'telephone', 'optin', 'connu', 'energie');
if ($this->args['id'] >= 12779) {
$notempty = array_merge($notempty, array('logement', 'echeance', 'optin_partenaires'));
$this->xml->addChild('errors', implode(',', $errors));
}
- public function grdfSendForm() {
+ public function grdfSendForm()
+ {
global $core;
if ($this->args['id'] == 11222) {
}
$fields = array('Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom',
- 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville',
- 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie',
- 'Type de logement' => 'logement', 'Echéance travaux' => 'echeance',
- 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires', 'Coupons sélectionnés' => 'reflist');
+ 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville',
+ 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie',
+ 'Type de logement' => 'logement', 'Echéance travaux' => 'echeance',
+ 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires', 'Coupons sélectionnés' => 'reflist');
$mail = new cubeMail();
$mail->charset = 'UTF-8';
$mail->send();
}
- public function grdfCoupon2015() {
+ public function grdfCoupon2015()
+ {
$id = $this->args['id'];
$this->outputXML = false;
exit;
}
- public function grdfCoupon() {
+ public function grdfCoupon()
+ {
$id = $this->args['id'];
$pdf->Output('coupon.pdf', 'I');
}
- public function grdfExcel12568() {
+ public function grdfExcel12568()
+ {
global $core;
$this->outputXML = false;
$xml = simplexml_load_file($couponsRoot . 'references.xml');
$cols = array('Date' => 'date', 'Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom',
- 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville',
- 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', 'Type de logement' => 'logement',
- 'Echéance travaux' => 'echeance',
- 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires');
+ 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville',
+ 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Energie' => 'energie', 'Type de logement' => 'logement',
+ 'Echéance travaux' => 'echeance',
+ 'Optin' => 'optin', 'Optin partenaires' => 'optin_partenaires');
$refs = array();
foreach ($xml->xpath('//item') as $i) {
$refs[(string)$i['reference']] = $i['name'];
exit;
}
- public function proxy() {
+ public function proxy()
+ {
ob_end_clean();
fb(netHttp::quickGet($_GET['u'], 'php://output'));
$this->outputXML = false;
}
- public function wescoRef() {
+ public function wescoRef()
+ {
global $core;
$this->args['ref'] = str_replace(' ', '', $this->args['ref']);
header('Location: http://www.wesco-eshop.fr');
}
- public function pierronRef() {
+ public function pierronRef()
+ {
global $core;
$ref = $this->args['ref'];
header('Location: http://www.pierron.fr/');
}
- public function flfRef() {
+ public function flfRef()
+ {
global $core;
$r = $core->con->select('SELECT url FROM flfref WHERE ref="' . $core->con->escape($this->args['ref']) . '"');
exit;
}
- public function collection() {
+ public function collection()
+ {
global $core;
$id = $this->callArgs[0];
$os = $this->callArgs[1];
exit;
}
- protected function _getManifest($publications, $dir, $books, $resolution) {
+ protected function _getManifest($publications, $dir, $books, $resolution)
+ {
global $core;
$res = array();
$res['manifest'] = array('assetRoot' => 'https://workshop.fluidbook.com' . $dir . '/', 'autoDownload' => false);
return $res;
}
- protected function _getRegExpManifest($r, $book, $theme, $resolution) {
+ protected function _getRegExpManifest($r, $book, $theme, $resolution)
+ {
$reg = array();
$reg['loading'] = array('^' . $r . 'style/(.*).css$', '^' . $r . 'index.html$', '^' . $r . 'data/style/(.*)$', '^' . $r . 'data/(.*).js$', '^' . $r . 'data/images/' . $theme->parametres->logoLoader . '$', '^' . $r . 'style/fonts/(.*).ttf$', '^' . $r . 'data/images/interface-down.svg$', '^' . $r . 'plugins/(.*)$');
$reg['extras'] = array('^' . $r . 'data/links/(.*).mp4$', '^' . $r . 'data/links/(.*).ogv$', '^' . $r . 'data/links/(.*).webm$', '^' . $r . 'data/(.*).pdf$', '^' . $r . 'cover.jpg$');
return array('reg' => $reg, 'exclude' => $exclude);
}
- protected function _inFirstManifest($p, $orders, $reg) {
+ protected function _inFirstManifest($p, $orders, $reg)
+ {
foreach ($orders as $list) {
foreach ($reg[$list] as $v) {
if (preg_match('|' . $v . '|', $p)) {
return $list;
}
- protected function _getBundles($book) {
+ protected function _getBundles($book)
+ {
$res = array(0 => 'loading', 20001 => 'extras', 20000 => 'thumbnails', 1 => 'urgents');
for ($i = 1; $i <= $book->parametres->pages; $i++) {
$k = 2 + $i;
return $res;
}
- public function collectionPushRegister() {
+ public function collectionPushRegister()
+ {
global $core;
$c = $core->con->openCursor('book_collection_push');
}
}
- public function getFluidbookPage($id, $page) {
+ public function getFluidbookPage($id, $page)
+ {
global $core;
$id = $this->callArgs[0];
echo file_get_contents($file);
die;
}
+
+ public function orderRemarkable()
+ {
+ try {
+ $mail = new cubeMail();
+ $mail->type = "html";
+ $mail->from = 'test@cubedesigners.com';
+ $mail->bcc = 'test@cubedesigners.com';
+ $mail->subject = '[Remarkable] Votre commande';
+ $mail->body = print_r($_POST, true);
+ $mail->send();
+ } catch (Exception $e) {
+
+ }
+ }
}