コード例 #1
0
ファイル: Twitter.obj.php プロジェクト: jrgns/backend-php
 public function html_tweet($result)
 {
     if ($result) {
         Backend::addSuccess('Tweeted!');
         Backend::addContent(var_export($result, true));
     }
 }
コード例 #2
0
ファイル: Document.obj.php プロジェクト: jrgns/backend-php
 public function html_list($document)
 {
     Backend::add('Sub Title', $document->getMeta('name'));
     Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
     Backend::add('Object', $document);
     Backend::addContent(Render::renderFile('document_list.tpl.php'));
 }
コード例 #3
0
 public function html_display($content)
 {
     Backend::add('Sub Title', 'Revisions for ' . $content->array['name']);
     Backend::add('content', $content);
     Backend::add('revisions', $content->object->revisions);
     Backend::addContent(Render::renderFile('content_revision.display.tpl.php'));
     return true;
 }
コード例 #4
0
ファイル: Image.obj.php プロジェクト: jrgns/backend-php
 public function html_list($result)
 {
     Backend::add('Sub Title', $result->getMeta('name'));
     Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
     Backend::addScript(SITE_LINK . '/js/jquery.js');
     Backend::addScript(SITE_LINK . '/js/image_list.js');
     Backend::addStyle(SITE_LINK . '/css/image_list.css');
     Backend::addContent(Render::renderFile('image.list.tpl.php', array('db_object' => $result)));
 }
コード例 #5
0
 public function html_display($result)
 {
     $result = parent::html_display($result);
     if (Value::get(get_class($this) . '_commented', true) && Component::isActive('Comment')) {
         if ($result instanceof DBObject) {
             $comments = Comment::getComments($result->getMeta('table'), $result->getMeta('id'));
             Backend::addContent(Render::renderFile('comments.tpl.php', array('comment_list' => $comments)));
             if (Permission::check('create', 'comment')) {
                 $values = array('foreign_table' => $result->getMeta('table'), 'foreign_id' => $result->getMeta('id'));
                 Backend::addContent(Render::renderFile('comment.add.tpl.php', $values));
             }
         }
     }
     return $result;
 }
コード例 #6
0
ファイル: Assignment.obj.php プロジェクト: jrgns/backend-php
 function get_list($start, $count, array $options = array())
 {
     $Assignments = new AssignmentObj();
     if ($start === 'all') {
         $limit = 'all';
     } else {
         $limit = "{$start}, {$count}";
     }
     $conditions = array('`assignments`.`active` = 1');
     $joins = array(array('type' => 'LEFT', 'table' => '`roles`', 'conditions' => array('`roles`.`id` = `assignments`.`role_id`', '`roles`.`active` = 1')));
     $fields = array('`assignments`.*', '`roles`.`name` AS `role`');
     list($query, $params) = $Assignments->getSelectSQL(array('conditions' => $conditions, 'joins' => $joins, 'fields' => $fields, 'limit' => $limit));
     $Assignments->read(array('query' => $query, 'parameters' => $params));
     Backend::add('Assignments', $Assignments);
     Backend::addContent(Render::renderFile('assignment_list.tpl.php'));
 }
コード例 #7
0
ファイル: Wurfl.obj.php プロジェクト: jrgns/backend-php
 public function action_test()
 {
     $requestingDevice = self::getDevice();
     if ($requestingDevice) {
         $content = '<ul>';
         $content .= '<li>ID: ' . $requestingDevice->id . '</li>';
         $content .= '<li>Brand Name: ' . $requestingDevice->getCapability("brand_name") . '</li>';
         $content .= '<li>Model Name: ' . $requestingDevice->getCapability("model_name") . '</li>';
         $content .= '<li>Xhtml Preferred Markup: ' . $requestingDevice->getCapability("preferred_markup") . '</li>';
         $content .= '<li>Resolution Width: ' . $requestingDevice->getCapability("resolution_width") . '</li>';
         $content .= '<li>Resolution Height: ' . $requestingDevice->getCapability("resolution_height") . '</li>';
         $content .= '</ul>';
     } else {
         $content = '<p>Could not get device information</p>';
     }
     Backend::addContent($content);
     return false;
 }
コード例 #8
0
ファイル: ChunkView.obj.php プロジェクト: jrgns/backend-php
 public static function hook_output($to_print)
 {
     Backend::add('BackendErrors', Backend::getError());
     Backend::add('BackendSuccess', Backend::getSuccess());
     Backend::add('BackendNotices', Backend::getNotice());
     Backend::add('BackendInfo', Backend::getInfo());
     Backend::setError();
     Backend::setSuccess();
     Backend::setNotice();
     Backend::setInfo();
     $content = Backend::getContent();
     if (empty($content)) {
         ob_start();
         var_dump($to_print);
         $content = ob_get_clean();
         if (substr($content, 0, 4) != '<pre') {
             $content = '<pre>' . $content . '</pre>';
         }
         Backend::addContent($content);
     }
     $to_print = Render::renderFile('styles.area.tpl.php');
     $to_print .= Render::renderFile('maincontent.tpl.php');
     $to_print .= Render::renderFile('scripts.tpl.php');
     $to_print = HtmlView::addLastContent($to_print);
     $to_print = HtmlView::replace($to_print);
     $to_print = HtmlView::rewriteLinks($to_print);
     $to_print = HtmlView::addLinks($to_print);
     $to_print = HtmlView::formsAcceptCharset($to_print);
     if (Component::isActive('BackendFilter')) {
         $BEFilter = new BEFilterObj();
         $BEFilter->read();
         $filters = $BEFilter->list ? $BEFilter->list : array();
         foreach ($filters as $row) {
             if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
                 $to_print = call_user_func(array($row['class'], $row['function']), $to_print);
             }
         }
     }
     return $to_print;
 }
コード例 #9
0
 public function html_filter($resultArray)
 {
     //backend_error.filter.tpl.php
     Backend::addContent(Render::renderFile('backend_request.filter.tpl.php', array('data' => $resultArray['data'], 'params' => $resultArray['params'], 'pager' => $resultArray['pager'], 'sort' => $resultArray['sort'])));
 }
コード例 #10
0
ファイル: AreaCtl.obj.php プロジェクト: jrgns/backend-php
 public function html_home($methods)
 {
     Backend::addContent(Render::file('std_home.tpl.php', array('methods' => $methods)));
 }
コード例 #11
0
ファイル: HtmlView.obj.php プロジェクト: jrgns/backend-php
 public function whoops($title, $message, $code_hint = false)
 {
     Backend::add('Sub Title', $title);
     Backend::addContent('<ht>' . $message . '<hr>');
     parent::whoops($title, $message, $code_hint);
 }
コード例 #12
0
ファイル: API.obj.php プロジェクト: jrgns/backend-php
 public function html_define($values)
 {
     if ($values) {
         if ($values['function']) {
             Backend::add('Sub Title', $values['class'] . '::' . $values['function']);
             Backend::addContent(Render::renderFile('api_function.tpl.php', $values));
         } else {
             Backend::add('Sub Title', $values['class']);
             Backend::addContent(Render::renderFile('api_class.tpl.php', $values));
         }
     }
     return true;
 }
コード例 #13
0
ファイル: Content.obj.php プロジェクト: jrgns/backend-php
 public static function show($id)
 {
     $content = Content::retrieve($id);
     if ($content) {
         $content = array_key_exists('markdown', $content) ? markdown($content['markdown']) : $content['body'];
         Backend::addContent($content);
     }
 }
コード例 #14
0
ファイル: TableCtl.obj.php プロジェクト: jrgns/backend-php
 public function html_import($result)
 {
     switch (true) {
         case $result instanceof DBObject:
             if (!Backend::get('Sub Title')) {
                 Backend::add('Sub Title', 'Import');
                 Backend::add('Sub Title', 'Import ' . $result->getMeta('name'));
             }
             $template_file = array($result->getArea() . '.import.tpl.php', $result->getArea() . '/import.tpl.php');
             if (!Render::checkTemplateFile($template_file[0]) && !Render::checkTemplateFile($template_file[1])) {
                 $template_file = 'std_import.tpl.php';
             }
             Backend::addContent(Render::file($template_file, array('db_object' => $result)));
             break;
         case is_numeric($result) && $result >= 0:
             Backend::addSuccess($result . ' records imported');
             Controller::redirect('?q=' . Controller::$area . '/list');
             break;
         default:
             Controller::redirect();
             break;
     }
     return $result;
 }
コード例 #15
0
ファイル: Component.obj.php プロジェクト: jrgns/backend-php
 function html_manage($result)
 {
     Backend::add('Sub Title', 'Manage Components');
     Backend::add('result', $result);
     Links::add('Admin', '?q=admin/index', 'secondary');
     Backend::addScript(SITE_LINK . 'js/jquery.js');
     Backend::addScript(SITE_LINK . 'js/component.manage.js');
     Backend::addContent(Render::file('component.manage.tpl.php'));
 }
コード例 #16
0
ファイル: BackendUser.obj.php プロジェクト: jrgns/backend-php
 public function html_signup($result)
 {
     Backend::add('Sub Title', 'Signup to ' . ConfigValue::get('Title'));
     switch (true) {
         case $result instanceof DBObject:
             //Successful signup, redirect
             if (!empty($_SESSION['bookmark'])) {
                 $bookmark = $_SESSION['bookmark'];
                 unset($_SESSION['bookmark']);
             } else {
                 //TODO Make this configurable
                 $bookmark = '?q=';
             }
             Controller::redirect($bookmark);
             break;
         case $result:
         default:
             Backend::add('Object', $result);
             Backend::addContent(Render::file('backend_user.signup.tpl.php'));
             break;
     }
     return $result;
 }
コード例 #17
0
ファイル: Render.obj.php プロジェクト: jrgns/backend-php
 public static function install_check()
 {
     if (!self::checkCacheFolder()) {
         if (function_exists('posix_getgrgid') && function_exists('posix_getegid')) {
             if ($group = posix_getgrgid(posix_getegid())) {
                 $group = $group['name'];
             }
         }
         $values = array('folder' => self::$cache_folder, 'group' => isset($group) ? $group : false);
         Backend::addContent(Render::renderFile('render.fix_cache_folder.tpl.php', $values));
         return false;
     }
     return true;
 }
コード例 #18
0
ファイル: Admin.obj.php プロジェクト: jrgns/backend-php
 public function html_scaffold($result)
 {
     if (is_post() && $result) {
         Backend::addSuccess('Scaffolds created for ' . class_name(Controller::$parameters[0]));
         Controller::redirect();
     } else {
         if (!$result) {
             Controller::redirect();
         }
     }
     Backend::addContent(Render::file('admin.scaffold.tpl.php', $result));
     return $result;
 }
コード例 #19
0
ファイル: File.obj.php プロジェクト: jrgns/backend-php
 function html_display($file)
 {
     Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
     Backend::add('Sub Title', $file->array['name']);
     Backend::addContent('<a href="?q=' . class_for_url(get_class($this)) . '/read/' . $file->array['id'] . '" title="' . $file->array['name'] . '">' . $file->array['name'] . '</a>');
 }
コード例 #20
0
ファイル: GateManager.obj.php プロジェクト: jrgns/backend-php
 public function html_permissions($result)
 {
     if (is_post()) {
         if ($result === false) {
             Backend::addError('Could not update Permissions');
         } else {
             Backend::addSuccess($result . ' Permissions Updated');
         }
         Controller::redirect('previous');
     }
     //GET
     if (!empty(Controller::$parameters[0])) {
         Backend::add('Sub Title', class_name(Controller::$parameters[0]) . ' Permissions');
         Links::add('All Permissions', '?q=gate_manager/permissions', 'secondary');
     } else {
         Backend::add('Sub Title', ConfigValue::get('Title') . ' Permissions');
     }
     Backend::addContent(Render::renderFile('gate_manager.permissions.tpl.php', (array) $result));
 }
コード例 #21
0
ファイル: ConfigValue.obj.php プロジェクト: jrgns/backend-php
 public static function install_check()
 {
     //Check the cache folder
     if (!Backend::checkConfigFile()) {
         if (function_exists('posix_getgrgid') && function_exists('posix_getegid')) {
             if ($group = posix_getgrgid(posix_getegid())) {
                 $group = $group['name'];
             }
         }
         $values = array('file' => Backend::getConfigFileLocation(), 'group' => isset($group) ? $group : false);
         Backend::addContent(Render::file('config_value.fix_config.tpl.php', $values));
         return false;
     }
     if (self::get('settings.ConfigValueSet')) {
         return true;
     }
     if (is_post()) {
         $result = true;
         foreach ($_POST as $name => $value) {
             $name = str_replace('_', '.', $name);
             if (in_array($name, array('application.Title', 'application.Moto', 'application.HelpBoxContent', 'application.Description', 'author.Name', 'author.Email', 'author.Website'))) {
                 if (!self::set($name, $value)) {
                     Backend::addError('Could not set ' . $name);
                     $result = false;
                 }
             } else {
                 var_dump('Rejected:', $name);
             }
         }
         self::set('settings.ConfigValueSet', $result);
         Controller::redirect();
     }
     Backend::addContent(Render::file('config_value.values.tpl.php'));
     return false;
 }
コード例 #22
0
ファイル: Home.obj.php プロジェクト: jrgns/backend-php
 public function html_error()
 {
     Backend::addContent('Something Went Wrong');
 }