public function onAction() { parent::onAction(); // TODO proper email sending $target = $this->plugin->getData('target'); $actionResp = getApi()->invoke("/action/{$target['id']}/view.json", EpiRoute::httpGet); if ($actionResp['code'] !== 200) { return; } $action = $actionResp['result']; $email = getConfig()->get('user')->email; $subject = 'You got a new comment on your photo'; if ($action['type'] == 'comment') { $body = <<<BODY {$action['email']} left a comment on your photo. ==== {$action['value']} ==== See the comment here: {$action['permalink']} BODY; } else { $body = <<<BODY {$action['email']} favorited a photo of yours. See the favorite here: {$action['permalink']} BODY; } $headers = "From: Trovebox Robot <*****@*****.**>\r\n" . "Reply-To: no-reply@trovebox.com\r\n" . 'X-Mailer: Trovebox'; mail($email, $subject, $body, $headers); }
public function __get($name) { $value = parent::__get($name); if (!$value && isset($this->info[$name])) { return $this->info[$name]; } }
public function renderFooter() { parent::renderFooter(); $conf = $this->getConf(); return <<<MKP <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '{$conf->id}', // App ID status : true, // check login status cookie : true, // enable cookies to allow the server to access the session oauth : true, // enable OAuth 2.0 xfbml : false // parse XFBML }); // Additional initialization code here }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={$conf->id}"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> MKP; }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('afterSurveyComplete'); $this->subscribe('beforeSurveySettings'); $this->subscribe('newDirectRequest'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); /** * Here you should handle subscribing to the events your plugin will handle */ $this->subscribe('afterSurveyComplete', 'showTheResponse'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('beforeActivate'); $this->subscribe('listExportPlugins'); $this->subscribe('listExportOptions'); $this->subscribe('newExport'); }
public function __get($name) { $value = parent::__get($name); if (!$value && $this->plugin->{$name} !== NULL) { return $this->plugin->{$name}; } else { return $value; } }
public function renderHead() { parent::renderHead(); $conf = $this->getConf(); return <<<MKP <!-- start Mixpanel --><script type="text/javascript">var mpq=[];mpq.push(["init","{$conf->id}"]);(function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a);e=function(f){return function(){mpq.push([f].concat(Array.prototype.slice.call(arguments,0)))}};d=["init","track","track_links","track_forms","register","register_once","identify","name_tag","set_config"];for(c=0;c<d.length;c++){mpq[d[c]]=e(d[c])}})(); </script><!-- end Mixpanel --> MKP; }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('beforeSurveySettings'); $this->subscribe('newSurveySettings'); //Can call plugin $this->subscribe('newDirectRequest'); // Add js and css $this->subscribe('beforeSurveyPage'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); // Register Event-Listeners Plug-in needs $this->subscribe('beforeActivate'); $this->subscribe('afterAdminMenuLoad'); $this->subscribe('newDirectRequest'); $this->subscribe('beforeSurveySettings'); $this->subscribe('newSurveySettings'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); /** * Here you should handle subscribing to the events your plugin will handle */ $this->subscribe('listExportPlugins'); $this->subscribe('listExportOptions'); $this->subscribe('newExport'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); /** * Subscribes to plugin settings event for each survey (beforeSurveySettings, newSurveySettings) * Subscribes to afterSurveyComplete event in order to send email notification */ $this->subscribe('afterSurveyComplete', 'afterSurveyComplete'); $this->subscribe('beforeSurveySettings', 'beforeSurveySettings'); $this->subscribe('newSurveySettings'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); /** * Here you should handle subscribing to the events your plugin will handle */ $this->subscribe('afterPluginLoad', 'helloWorld'); $this->subscribe('afterAdminMenuLoaded'); $this->subscribe('beforeSurveySettings'); $this->subscribe('newSurveySettings'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('beforeSurveySettings'); $this->subscribe('newSurveySettings'); $this->subscribe('beforeActivate'); $this->subscribe('beforeUserSave'); $this->subscribe('beforeUserDelete'); $this->subscribe('beforePermissionSetSave'); $this->subscribe('beforeParticipantSave'); $this->subscribe('beforeParticipantDelete'); }
public function routeHandler($route) { parent::routeHandler($route); switch ($route) { case '/update.json': getAuthentication()->requireAuthentication(); $user = new User(); $user->setAttribute($_POST['section'], $_POST['key']); return array('message' => sprintf('Updated tutorial for %s', $_POST['section']), 'code' => 200, 'result' => true); break; } }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); // Provides survey specific settings. $this->subscribe('beforeSurveySettings'); // Saves survey specific settings. $this->subscribe('newSurveySettings'); // Encrypt data on survey completion. $this->subscribe('afterSurveyComplete'); // Create table for encrypted data. $this->subscribe('beforeActivate'); $this->subscribe('newDirectRequest'); }
public function renderPhotoDetail() { parent::renderPhotoDetail(); $photo = $this->plugin->getData('photo'); if ($this->plugin->getData('page') !== 'photo-detail') { return; } if (!isset($photo['permission']) || $photo['permission'] == 0) { return; } return <<<MKP <div class="fb-like"></div> MKP; }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('beforeSurveySettings'); $this->subscribe('newSurveySettings'); $this->subscribe('beforeActivate'); $this->subscribe('beforeUserSave'); $this->subscribe('beforeUserDelete'); $this->subscribe('beforePermissionSetSave'); $this->subscribe('beforeParticipantSave'); $this->subscribe('beforeParticipantDelete'); $this->subscribe('beforeLogout'); $this->subscribe('afterSuccessfulLogin'); $this->subscribe('afterFailedLoginAttempt'); }
public function renderFooter() { parent::renderFooter(); return <<<MKP <!-- Piwik modal code --> <script type="text/javascript"> OP.Util.on("photo:viewed", function(params){ // Get URL and title that were changed by modal _paq.push(['setCustomUrl', window.location]); _paq.push(['setDocumentTitle', document.title]); // Track page view and enable link tracking _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); }); </script> <!-- End modal Piwik Code --> MKP; }
public function renderHead() { parent::renderHead(); $conf = $this->getConf(); return <<<MKP <script type="text/javascript"> var _gauges = _gauges || []; (function() { var t = document.createElement('script'); t.type = 'text/javascript'; t.async = true; t.id = 'gauges-tracker'; t.setAttribute('data-site-id', '{$conf->id}'); t.src = '//secure.gaug.es/track.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(t, s); })(); </script> MKP; }
public function renderHead() { parent::renderHead(); $conf = $this->getConf(); return <<<MKP <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '{$conf->id}']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> MKP; }
public function renderHead() { parent::renderHead(); $utility = new Utility(); $page = $this->plugin->getData('page'); $username = $utility->getEmailHandle($this->config->user->email, false); switch ($page) { case 'photo-detail': $photo = $this->plugin->getData('photo'); $prefix = ''; if ($photo['title'] != '') { $prefix = sprintf('%s - ', $photo['title']); } elseif ($photo['filenameOriginal'] != '') { $prefix = sprintf('%s - ', $photo['filenameOriginal']); } return <<<MKP <title>{$prefix}{$username}'s photos - The OpenPhoto Project</title> MKP; break; case 'photos': return <<<MKP <title>{$username}'s photos - The OpenPhoto Project</title> MKP; break; case 'tags': return <<<MKP <title>{$username}'s tags - The OpenPhoto Project</title> MKP; break; default: return <<<MKP <title>{$username}'s OpenPhoto site - The OpenPhoto Project</title> MKP; break; } }
public function renderHead() { parent::renderHead(); $user = new User(); $page = $this->plugin->getData('page'); $username = $user->getNameFromEmail($this->config->user->email); switch ($page) { case 'photo-detail': $photo = $this->plugin->getData('photo'); $prefix = ''; if ($photo['title'] != '') { $prefix = sprintf('%s - ', $photo['title']); } elseif ($photo['filenameOriginal'] != '') { $prefix = sprintf('%s - ', $photo['filenameOriginal']); } return <<<MKP <title>{$prefix}{$username}'s photos - Trovebox</title> MKP; break; case 'photos': return <<<MKP <title>{$username}'s photos - Trovebox</title> MKP; break; case 'tags': return <<<MKP <title>{$username}'s tags - Trovebox</title> MKP; break; default: return <<<MKP <title>{$username}'s Photo site - Trovebox</title> MKP; break; } }
public function __construct() { parent::__construct(); }
public function onPhotoUploaded() { parent::onPhotoUploaded(); $photo = $this->plugin->getData('photo'); $this->createPost($photo); }
function __destruct() { parent::__destruct(); //Destruct }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('beforeActivate'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('afterPluginLoad', 'oldUrlCompat'); }
public function __construct(PluginManager $manager, $id) { parent::__construct($manager, $id); $this->subscribe('beforeSurveyPage'); $this->subscribe('beforeSurveySettings'); $this->subscribe('newSurveySettings'); }
public function getPluginSettings($getValues = true) { $assetUrl = Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets'); Yii::app()->clientScript->registerCssFile($assetUrl . '/settingsfix.css'); return parent::getPluginSettings($getValues); }