public function update_settings_cache()
 {
     $settings = t_paths::js_cache($this->owner->apikey);
     if (file_exists($settings)) {
         unlink($settings);
     }
     return;
 }
Example #2
0
function load_testimonials_env()
{
    $js_cache = t_paths::js_cache($_GET['apikey']);
    if (!file_exists($js_cache) or !file_exists(t_paths::init_cache())) {
        return;
    }
    readfile($js_cache);
    readfile(t_paths::init_cache());
    die('/*=D*/');
}
Example #3
0
 public function save_css()
 {
     if (empty($_POST['css'])) {
         die;
     }
     $stylesheet = t_paths::css($this->owner->apikey) . '/' . $this->owner->tconfig->theme . '.css';
     file_put_contents($stylesheet, $_POST['css']);
     $this->rsp->status = 'success';
     $this->rsp->msg = 'CSS Saved!';
     $this->rsp->send();
 }
Example #4
0
 private function make_form()
 {
     $testimonial = $this->get_testimonial();
     # get form questions
     $questions = ORM::factory('question')->where('owner_id', $this->owner->id)->find_all();
     $form = new View('testimonials/edit');
     $form->questions = $questions;
     $form->locked = 1 == $testimonial->lock ? true : false;
     $form->tags = ORM::factory('tag')->where('owner_id', $this->owner->id)->find_all();
     $form->info = json_decode($testimonial->body_edit, TRUE);
     $form->testimonial = $testimonial;
     $form->image_url = t_paths::image($this->owner->apikey, 'url');
     $form->url = $this->form_url;
     return $form;
 }
Example #5
0
 public function index()
 {
     $content = new View('admin/testimonials/install');
     $content->embed_code = t_build::embed_code($this->owner->apikey, 'fake');
     $content->embed_code_lite = t_build::embed_code($this->owner->apikey, 'fake', FALSE);
     $tstmls = new Testimonials_Controller($this->owner);
     $content->html = $tstmls->export_html();
     $stylesheet = t_paths::css($this->owner->apikey) . '/' . $this->owner->tconfig->theme . '.css';
     $content->css = file_exists($stylesheet) ? file_get_contents($stylesheet) : '/* no custom file */';
     if (request::is_ajax()) {
         die($content);
     }
     $this->shell->content = $content;
     $this->shell->child_nav = array(array('main', '/admin/testimonials/install', 'Main Panel', ''));
     $this->shell->grandchild_nav = array(array('main', '/admin/testimonials/install', 'Main Panel', ''), array('help', '#help-page', '(help)', 'fb-help'));
     die($this->shell);
 }
Example #6
0
    but you have priorities indeed.
    
    <br/><br/>
    PlusPanda <u>trivializes</u> this one simple marketing strategy so you can
    concentrate on implementing other strategies.
    You <u>know</u> you have better things to do! 
    <br/>So let us handle it, we are good at it. Thanks!
  </div>
</div>

<div style="clear:both; padding-top:30px;text-align:center">
  <a href="/start" id="signup"></a>
</div>


<script type="text/javascript">
 $('div.demo-switcher ul a:first').addClass('active');
  $('div.demo-switcher ul a').click(function(){
    var url = '<?php 
echo t_paths::css(Kohana::config('core.apikey'), 'url');
?>
/';
    var theme = $(this).attr('href').substring(1);
    $('div.demo-switcher ul a').removeClass('active');
    $(this).addClass('active');
    $('head link#pandaTheme').attr('href', url + theme + '.css');
    $('#panda-select-tags ul a:first').click();
  });
</script>

Example #7
0
 public function save_crop($apikey, $params)
 {
     if (!isset($params[1])) {
         return 'Invalid Parameters';
     }
     $img_path = t_paths::image($apikey) . "/full_{$this->image}";
     $image = new Image($img_path);
     $width = $image->__get('width');
     $height = $image->__get('height');
     # Make thumbnail from supplied post params.
     $size = 125;
     $thumb_path = t_paths::image($apikey) . "/{$this->image}";
     $image->crop($params[0], $params[1], $params[2], $params[3])->resize($size, $size)->save($thumb_path);
     return 'Image saved!';
 }
Example #8
0
 public function edit()
 {
     $testimonial = $this->get_testimonial();
     # get questions
     $questions = ORM::factory('question')->where('owner_id', $this->owner->id)->find_all();
     $view = new View('admin/testimonials/edit');
     $view->testimonial = $testimonial;
     $view->info = json_decode($testimonial->body_edit, TRUE);
     $view->questions = $questions;
     $view->tags = $this->tags;
     $view->image_url = t_paths::image($this->owner->apikey, 'url');
     die($view);
 }
Example #9
0
 /**
  * Overload delete to include assets
  * when the object is deleted.
  */
 public function delete($id = NULL)
 {
     if ($id === NULL and $this->loaded) {
         # delete testimonial survey questions
         ORM::factory('question')->where(array('owner_id' => $id))->delete_all();
         echo 'survey questions deleted<br/>';
         # delete testimonial tags/categories
         ORM::factory('tag')->where(array('owner_id' => $id))->delete_all();
         echo 'testimonial tags deleted<br/>';
         # delete tconfigs
         ORM::factory('tconfig')->where(array('owner_id' => $id))->delete_all();
         echo 'tconfig settings deleted<br/>';
         # delete all testimonials
         ORM::factory('testimonial')->where(array('owner_id' => $id))->delete_all();
         echo 'testimonials deleted<br/>';
         # delete owner data folder.
         $folder = t_paths::data($this->apikey);
         if (dir::remove($folder)) {
             echo "data directory {$folder} deleted<br/>";
         }
     }
     return parent::delete($id);
 }
Example #10
0
 public static function crop_view($apikey, $action_url = NULL)
 {
     if (empty($_GET['image'])) {
         return 'image not available';
     }
     $filename = $_GET['image'];
     $image_dir = t_paths::image($apikey);
     if (!file_exists("{$image_dir}/full_{$filename}")) {
         return 'image not available';
     }
     #hack
     $id = explode('.', $filename);
     $view = new View('admin/testimonials/crop');
     $view->img_src = t_paths::image($apikey, 'url') . "/full_{$filename}?r=" . text::random('alnum', 6);
     $view->thmb_src = t_paths::image($apikey, 'url') . "/{$filename}?r=" . text::random('alnum', 6);
     $view->action_url = empty($action_url) ? '/admin/testimonials/manage/crop?id=' . $id[0] : $action_url;
     return $view;
 }
Example #11
0
 private static function cache_init()
 {
     file_put_contents(t_paths::init_cache(), View::factory('testimonials/widget_init')->render() . "\n//" . date('m.d.y g:ia'));
     return;
 }