public function setupDisplay($disp)
 {
     $disp->setValue('message', 'Enter Package Name');
     $form = Form::load('murphy.views.home.PackageTest');
     $disp->addForm($form);
     $disp->addView('page_content', 'murphy.views.home.Home');
 }
        protected function addBlogCommentForm()
        {
	    $form = Form::load('logbook.views.AddBlogComment');
            $form->setInputValue('author_id',Application::param('author_id'));
            $form->setInputValue('entry_id',Application::param('entry_id'));
            return $form;
        }
 protected function addBlogEntryForm()
 {
     $form = Form::load('logbook.views.AddBlogEntry');
     $form->setInputValue('author_id',Logbook::current()->authorId());
     $form->setOptions('access_id',PilotSetup::allAccess());
     return $form;
 }
 public function display()
 {
     $disp = Display::current();
     if ($this->map) {
         $disp->setValue('map', $this->map);
     } else {
         $form = Form::load('sys.views.rsml_test.RsmlMapForm');
         $disp->addForm($form);
     }
     $disp->addView('page_content', 'sys.views.rsml_test.RsmlMap');
     $disp->view('site_template');
 }
        public function display()
        {
            $disp = Display::current();
			$disp->setValue('tree_menu', $disp->treeMenu());

            $disp->addView('page_content', 'frost.views.cms.part.text.TextAdd');
            $form = Form::load('frost.views.cms.part.text.TextAdd');
            $form->setInputValue('module_id', Application::param('module_id'));
            $form->setInputValue('media_type', Application::param('media_type'));
            $form->setInputValue('label', 'Plain text item');
            $form->setInputValue('weight', '1000');

            $disp->setValue('module_id', Application::param('module_id'));
            $disp->setValue('login_error', $this->login_error);

            $disp->setValue('current_handler', Application::current()->handler()->getClass());
            $disp->addForm($form);
            $disp->displaySiteTemplate();
        }
Example #6
0
 public function performHandlerTasks()
 {
     if (Application::formPosted()) {
         $form = Form::load('seeingsystem.views.Login');
         if ($form->validate()) {
             try {
                 PilotApplication::login(Application::param('user_email'), Application::param('user_password'));
             } catch (UserNotFoundException $exc) {
                 $this->login_error = 'No user with that email is registered';
             } catch (InvalidPasswordException $exc) {
                 $this->login_error = 'The password was incorrect';
             }
         }
     } else {
         if (Application::param('logout')) {
             PIlotApplication::logout();
         }
     }
 }
 public function manageGroupAccessForm()
 {
     $form = Form::load('logbook.views.ManageGroupAccess');
     $group_access_options = array(new FormOption(LogbookAccess::VIEW, 'View'), new FormOption(LogbookAccess::EDIT, 'Edit'), new FormOption(LogbookAccess::DELETE, 'Delete'), new FormOption(LogbookAccess::MANAGE_ACCESS, 'Manage Access'));
     $form->setOptions('group_access_options', $group_access_options);
     if (is_object($this->group_to_manage_for) && is_object($this->entry_to_manage_for)) {
         $form->setInputValue('author_id', $this->entry_to_manage_for->get('author_id'));
         $form->setInputValue('entry_id', $this->entry_to_manage_for->id());
         $form->setInputValue('group_id', $this->group_to_manage_for->id());
         $ega = new EntryGroupAccess();
         $ega->clause('author_id', $this->entry_to_manage_for->get('author_id'));
         $ega->clause('entry_id', $this->entry_to_manage_for->id());
         $ega->clause('group_id', $this->group_to_manage_for->id());
         if ($ega->id()) {
             $option_values = array();
             if ($ega->get(LogbookAccess::VIEW)) {
                 $option_values[] = new FormOption(LogbookAccess::VIEW, $ega->get(LogbookAccess::VIEW));
             }
             if ($ega->get(LogbookAccess::EDIT)) {
                 $option_values[] = new FormOption(LogbookAccess::EDIT, $ega->get(LogbookAccess::EDIT));
             }
             if ($ega->get(LogbookAccess::DELETE)) {
                 $option_values[] = new FormOption(LogbookAccess::DELETE, $ega->get(LogbookAccess::DELETE));
             }
             if ($ega->get(LogbookAccess::MANAGE_ACCESS)) {
                 $option_values[] = new FormOption(LogbookAccess::MANAGE_ACCESS, $ega->get(LogbookAccess::MANAGE_ACCESS));
             }
             if (count($option_values)) {
                 $form->setInputValue('group_access_options', $option_values);
             }
         }
     }
     return $form;
 }
 function siteFunctionForm($sf = '')
 {
     //SITE FUNCTION MANAGEMENT
     $sf_form = Form::load('pilot.views.SiteFunctionMain');
     $sf_form->setOptions('access_id', $this->allAccess());
     $sf_form->setOptions('parent_id', $this->allSiteFunctions());
     $sf_form->setOptions('select_site_function_id', $this->allSiteFunctions());
     if (is_object($sf)) {
         $sf_form->setInputValues($sf);
     }
     return $sf_form;
 }
 public function display()
 {
     //echo "<br />DEBUG: HERE<br />";
     header('Content-type: application/x-javascript');
     readfile("http://" . $_SERVER['HTTP_HOST'] . "/packages/seeingsystem/views/js/ss_prototype.js");
     readfile("http://" . $_SERVER['HTTP_HOST'] . "/packages/seeingsystem/views/js/ss_effects.js");
     $disp = Display::current();
     if (Application::current()->user()->authorise('SeeingsystemSetup')) {
         $disp->setValue('logged_in', true);
     } else {
         $disp->setValue('login_error', $this->login_error);
         $login_form = Form::load('seeingsystem.views.Login');
         $disp->addForm($login_form);
     }
     // Write to the log
     $fh = fopen('access_logs/access.log', 'a') or die("can't open file");
     $stringData = time() . "," . $_SERVER['HTTP_REFERER'] . "\n";
     fwrite($fh, $stringData);
     fclose($fh);
     $params = $this->getParams();
     if ($params['user_id']) {
         $disp->setValue('user_tags', $this->getFlickrTags($params['api_key'], $params['user_id']));
     } else {
         $disp->setValue('user_tags', '');
     }
     $disp->setValue('timeout_interval', $params['timeout_interval']);
     $disp->setValue('fade_speed', $params['fade_speed']);
     $disp->setValue('domain', $_SERVER['HTTP_HOST']);
     $disp->setValue('ss_key', $params['key']);
     $disp->setValue('slide_div_width', $params['width']);
     $disp->setValue('slide_div_height', $params['height']);
     $disp->setValue('api_key', $params['api_key']);
     // Change the method if there is no user and no tags
     if (!$params['user_id'] && !$params['tags']) {
         $disp->setValue('method', 'flickr.photos.getrecent');
     } else {
         $disp->setValue('method', $params['method']);
     }
     // user_id (Optional) - The NSID of the user who's photo to search.
     // If this parameter isn't passed then everybody's public photos will be searched.
     // A value of "me" will search against the calling user's photos for authenticated calls.
     $disp->setValue('user_id', $params['user_id']);
     //photoset_id (Optional) - The id of the photoset
     $disp->setValue('photoset_id', $params['photoset_id']);
     //tags (Optional) - A comma-delimited list of tags. Photos with one or more of the tags listed will be returned.
     $disp->setValue('tags', $params['tags']);
     // tag_mode (Optional) - Either 'any' for an OR combination of tags, or 'all' for an AND combination.
     // Defaults to 'any' if not specified.
     $disp->setValue('tag_mode', $params['tag_mode']);
     //sort (Optional) - The order in which to sort returned photos. Deafults to date-posted-desc.
     // The possible values are: date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc,
     // interestingness-desc, interestingness-asc, and relevance.
     $disp->setValue('sort', $params['sort']);
     //extras (Optional) - A comma-delimited list of extra information to fetch for each returned record.
     // Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format,
     // last_update, geo, tags, machine_tags.
     $disp->setValue('extras', $params['extras']);
     //content_type (Optional) - Content Type setting: 1 for photos only. 2 for screenshots only.
     // 3 for 'other' only. 4 for all types.
     $disp->setValue('content_type', '1');
     //per_page (Optional) - Number of photos to return per page. If this argument is omitted, it defaults to 100.
     // The maximum allowed value is 500.
     $disp->setValue('per_page', $params['per_page']);
     //page (Optional) - The page of results to return. If this argument is omitted, it defaults to 1.
     $disp->setValue('page', 1);
     $disp->setValue('format', $params['format']);
     //header('Content-type: application/x-javascript');
     $disp->displayPage('packages/seeingsystem/views/flickr_json_slideshow01.php');
     // Load the view that is specific to the 'display' parameter in the databse configuration. The 'default'
     // display is just a call to the init() function of the generic object.
     $disp->displayPage('packages/seeingsystem/views/flickr_json_slideshow01_' . $params['display'] . '.php');
 }
Example #10
0
 public function run()
 {
     $action = 'act_' . $this->action;
     if (method_exists($this, $action)) {
         $this->MainInit();
         $this->Init();
         $formid = isset($_POST['formid']) ? $_POST['formid'] : null;
         $formtoken = isset($_POST['token']) ? $_POST['token'] : null;
         $formtime = isset($_POST['time']) ? $_POST['time'] : null;
         if (isset($formid)) {
             $this->form = Form::load($formid, $_POST, $this);
         }
         $_SESSION["forms_token"] = null;
         call_user_func_array(array($this, $action), $this->params);
     } else {
         $this->noaction($this->action, $this->params);
     }
 }
 protected function editBlogEntryForm()
 {
     $form = Form::load('logbook.views.EditBlogEntry');
     $form->setOptions('access_id',PilotSetup::allAccess());
     $form->setInputValues($this->entryToEdit());
     $form->setInputValue('entry_tags',$this->entryToEdit()->csvTagString());
     return $form;
 }
 protected function editBlogAuthorDetailsForm()
 {
     $form = Form::load('logbook.views.EditBlogAuthorDetails');
     $form->setInputValues($this->authorAbout());
     return $form;
 }
 public function display()
 {
     $disp = Display::current();
     if (Application::current()->user()->authorise('SeeingsystemSetup')) {
         $disp->setValue('logged_in', true);
     } else {
         $disp->setValue('login_error', $this->login_error);
         $login_form = Form::load('seeingsystem.views.Login');
         $disp->addForm($login_form);
     }
     if (Application::param('tags')) {
         $tags = Application::param('tags');
     } else {
         $tags = 'seeingsystem';
     }
     $page = 0;
     if (Application::param('static') && Application::param('page')) {
         $page = Application::param('page');
         #
         # build the API URL to call
         #
         $params = array('api_key' => '1cd28ef9270b9dad6d02734d6a8d88a9', 'method' => 'flickr.photos.search', 'user_id' => '77411642@N00', 'tags' => $tags, 'tag_mode' => 'all', 'sort' => 'date-posted-desc', 'extras' => 'original_format', 'content_type' => '1', 'per_page' => '1', 'page' => $page, 'format' => 'php_serial');
         $rsp_obj = $this->getFlickrPhotos($params);
         #
         # display the photo title (or an error if it failed)
         #
         if ($rsp_obj['stat'] == 'ok') {
             /*
             Photo Source URLs
             -----------------
                 
             You can construct the source URL to a photo once you know its ID, server ID, farm ID and secret, as returned by many API methods.
                 
             The URL takes the following format:
                 
             http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg
             http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstb].jpg
                                http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{o-secret}_o.(jpg|gif|png) 
                 
             Size Suffixes:
                 
             The letter suffixes are as follows:
             s	small square 75x75
             t	thumbnail, 100 on longest side
             m	small, 240 on longest side
             -	medium, 500 on longest side
             b	large, 1024 on longest side (only exists for very large original images)
             o	original image, either a jpg, gif or png, depending on source format
                 
             Note: Original photos behave a little differently. They have their own secret (called originalsecret in responses) and a variable file extension (called originalformat in responses). These values are returned via the API only when the caller has permission to view the original size (based on a user preference and various other criteria). The values are returned by the flickr.photos.getInfo method and by any method that returns a list of photos and allows an extras parameter (with a value of original_format), such as flickr.photos.search. The flickr.photos.getSizes method, as always, will return the full original URL where permissions allow.
                 
             Example:
                 
             http://farm1.static.flickr.com/2/1418878_1e92283336_m.jpg
                 
             farm-id: 1
             server-id: 2
             photo-id: 1418878
             secret: 1e92283336
             size: m
             */
             //print_r($rsp_obj['photos']['photo'][0]);
             //Using - http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstb].jpg
             $photo_id = $rsp_obj['photos']['photo'][0]['id'];
             $farm_id = $rsp_obj['photos']['photo'][0]['farm'];
             $server_id = $rsp_obj['photos']['photo'][0]['server'];
             $secret = $rsp_obj['photos']['photo'][0]['secret'];
             //$file_name = $rsp_obj['photos']['photo'][0]['title'];
             $photo_url = "http://farm{$farm_id}.static.flickr.com/{$server_id}/{$photo_id}_{$secret}.jpg";
             $size = getimagesize($photo_url);
             $width = $size[0];
             $height = $size[1];
             $top_border = (704 - $height) / 2;
             $bottom_border = (704 - $height) / 2 - 1;
             $left_border = (704 - $width) / 2;
             $right_border = (704 - $width) / 2 - 1;
             $style = "width:{$width}px;height:{$height}px;border-top:{$top_border}px solid black;border-bottom:{$bottom_border}px solid black;border-left:{$left_border}px solid black;border-right:{$right_border}px solid black;";
         } else {
             echo "Call failed!";
         }
         $disp->setValue('photo_url', $photo_url);
         $disp->setValue('style', $style);
     } else {
         $disp->setValue('photo_url', "/assets/start.jpg");
         //$disp->setValue('photo_url', "");
     }
     $disp->setTitle('Seeing System - Slideshow');
     $disp->setValue('page', ++$page);
     $disp->setValue('tags', $tags);
     $disp->addView('page_content', 'seeingsystem.views.Seeingsystem');
     $disp->displaySiteTemplate();
 }