示例#1
0
 public function action_edit()
 {
     $id = $this->request->param('id');
     if ($id != $this->user) {
         $this->request->redirect(URL::base());
     }
     $view = View::factory('player_edit');
     $view->realname = @real_name_from_id($id);
     if ($_POST) {
         $realname = @$_POST['realname'];
         $current_password = @$_POST['current_password'];
         $new_password = @$_POST['new_password'];
         $confirm_password = @$_POST['confirm_password'];
         if ($new_password) {
             if (!Auth::check_password($current_password)) {
                 array_push($this->template->errors, "Password did not match password on file.");
             }
             if ($new_password != $confirm_password) {
                 array_push($this->template->errors, "New passwords did not match.");
             }
             if (empty($this->template->errors)) {
                 password(name_from_id($id));
             }
         }
         if ($realname) {
             DB::update('users')->set(array('realname' => $realname))->where('id', '=', $id)->execute();
         }
         $this->request->redirect('/player/view/2');
     }
     $this->template->content = $view;
 }
示例#2
0
文件: url.php 项目: joelpittet/core
 /**
  * Fetches an absolute site URL based on a URI segment.
  *
  *     echo URL::site('foo/bar');
  *
  * @param   string  site URI to convert
  * @param   mixed   protocol string or boolean, add protocol and domain?
  * @return  string
  * @uses    URL::base
  */
 public static function site($uri = '', $protocol = FALSE)
 {
     // Chop off possible scheme, host, port, user and pass parts
     $path = preg_replace('~^[-a-z0-9+.]++://[^/]++/?~', '', trim($uri, '/'));
     // Concat the URL
     return URL::base(TRUE, $protocol) . $path;
 }
示例#3
0
文件: bb.php 项目: anqh/anqh
 /**
  * Create new BBCode object and initialize our own settings
  *
  * @param  string  $text
  */
 public function __construct($text = null)
 {
     parent::BBCode();
     $this->text = $text;
     // Automagically print hrefs
     $this->SetDetectURLs(true);
     // We have our own smileys
     $config = Kohana::$config->load('site.smiley');
     if (!empty($config)) {
         $this->ClearSmileys();
         $this->SetSmileyURL(URL::base() . $config['dir']);
         foreach ($config['smileys'] as $name => $smiley) {
             $this->AddSmiley($name, $smiley['src']);
         }
     } else {
         $this->SetEnableSmileys(false);
     }
     // We handle newlines with Kohana
     //$this->SetIgnoreNewlines(true);
     $this->SetPreTrim('a');
     $this->SetPostTrim('a');
     // User our own quote
     $this->AddRule('quote', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_quote'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns'), 'content' => BBCODE_REQUIRED));
     // Media tags
     $this->AddRule('audio', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_media'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'allow' => array('align' => '/^left|center|right$/'), 'default' => array('align' => 'left'), 'content' => BBCODE_REQUIRED, 'plain_content' => array('')));
     $this->AddRule('video', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_media'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'allow' => array('align' => '/^left|center|right$/'), 'default' => array('align' => 'left'), 'content' => BBCODE_REQUIRED, 'plain_content' => array('')));
 }
示例#4
0
    public static function getLanguages($is_public = 1)
    {
        $languages = Model_Languages::listAll($is_public);
        //
        foreach ($languages as $lang) {
            ?>
            <li>
                <div>
                    <a href="<?php 
            echo URL::base();
            ?>
language/changelangto/<?php 
            echo $lang['abbr'];
            ?>
" title="<?php 
            echo $lang['name'];
            ?>
"><img src="<?php 
            echo URL::base();
            ?>
assets/img/<?php 
            echo $lang['icon'];
            ?>
" alt="<?php 
            echo $lang['name'];
            ?>
"></a>
                </div>
            </li>
        <?php 
        }
    }
示例#5
0
 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_form()
 {
     $this->auto_render = FALSE;
     $order_id = $this->request->param('id');
     $order = new Model_Order();
     $order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         // dependant on product we have different names
         if ($order->id_product == Paypal::to_featured) {
             $item_name = __('Advertisement to featured');
         } else {
             if ($order->id_product == Paypal::to_top) {
                 $item_name = __('Advertisement to top');
             } else {
                 $item_name = $order->description . __(' category');
             }
         }
         $paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
         $paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => core::config('payment.paypal_account'), 'paypal_currency' => core::config('payment.paypal_currency'), 'item_name' => $item_name);
         $this->template = View::factory('paypal', $paypal_data);
         $this->response->body($this->template->render());
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->request->redirect(Route::url('default'));
     }
 }
示例#6
0
    public function action_signup()
    {
        $this->template->menu_signup = TRUE;
        // Если залогинен, то перекидываем на дерево
        if (Auth::instance()->logged_in()) {
            $this->redirect(Route::url('user/id', array('user_id' => Auth::instance()->get_user()->id)));
        }
        $post = Arr::extract($this->request->post(), array('name', 'surname', 'email'));
        $data['errors'] = NULL;
        if ($this->request->method() == 'POST') {
            // Генерирую случайный пароль из цифр
            $post['password'] = Text::random('numeric', 5);
            try {
                $user = ORM::factory('User')->values($post)->save();
                $user->add('roles', ORM::factory('Role', array('name' => 'login')));
                $message = '
						Для входа на сайт ' . $_SERVER['HTTP_HOST'] . ' используйте следующие данные:<br><br>
						Адрес электронной почты: ' . HTML::chars($user->email) . '<br>
						Пароль: ' . HTML::chars($post['password']) . '<br><br>
						<a href="' . URL::base(TRUE) . '">Перейти на сайт</a>';
                Useful::mail($user->email, 'Регистрация LiveTex', $message, 'LiveTex');
                // Авторизовываю
                Auth::instance()->login($user->email, $post['password'], TRUE);
                $this->redirect(Route::url('user/id', array('user_id' => $user->id)));
            } catch (ORM_Validation_Exception $e) {
                $data['errors'] = $e->errors('orm');
            }
        }
        $data += $post;
        $this->template->content = View::factory('auth/signup', $data);
    }
示例#7
0
 public function before()
 {
     if (!User::current()) {
         $this->redirect('/login');
     }
     $url = str_replace('.', '_', URL::base() . $this->request->uri());
     if (isset($_GET[$url])) {
         unset($_GET[$url]);
     }
     if (isset($_GET[$url . '/'])) {
         unset($_GET[$url . '/']);
     }
     if (Group::current('is_admin') || Group::current('show_all_jobs') && Group::current('allow_finance')) {
         Pager::$counts[] = 2500;
     }
     if (Arr::get($_GET, 'limit') && in_array($_GET['limit'], Pager::$counts)) {
         DB::update('users')->set(array('list_items' => intval($_GET['limit'])))->where('id', '=', User::current('id'))->execute();
         die(json_encode(array('success' => 'true')));
     }
     if (Arr::get($_GET, 'dismiss')) {
         DB::delete('notifications')->where('user_id', '=', User::current('id'))->and_where('id', '=', intval($_GET['dismiss']))->execute();
         die(json_encode(array('success' => 'true')));
     }
     if (!Group::current('allow_assign')) {
         Enums::$statuses[Enums::STATUS_UNALLOC] = 'Not active';
     }
     View::set_global('notifications', DB::select()->from('notifications')->where('user_id', '=', User::current('id'))->order_by('id', 'desc')->execute());
 }
示例#8
0
 /**
  * Validate a client
  *
  * Example SQL query:
  *
  * <code>
  * # Client ID + redirect URI
  * SELECT oauth_clients.id, oauth_clients.secret, oauth_client_endpoints.redirect_uri, oauth_clients.name,
  * oauth_clients.auto_approve
  *  FROM oauth_clients LEFT JOIN oauth_client_endpoints ON oauth_client_endpoints.client_id = oauth_clients.id
  *  WHERE oauth_clients.id = :clientId AND oauth_client_endpoints.redirect_uri = :redirectUri
  *
  * # Client ID + client secret
  * SELECT oauth_clients.id, oauth_clients.secret, oauth_clients.name, oauth_clients.auto_approve FROM oauth_clients 
  * WHERE oauth_clients.id = :clientId AND oauth_clients.secret = :clientSecret
  *
  * # Client ID + client secret + redirect URI
  * SELECT oauth_clients.id, oauth_clients.secret, oauth_client_endpoints.redirect_uri, oauth_clients.name,
  * oauth_clients.auto_approve FROM oauth_clients LEFT JOIN oauth_client_endpoints 
  * ON oauth_client_endpoints.client_id = oauth_clients.id
  * WHERE oauth_clients.id = :clientId AND oauth_clients.secret = :clientSecret AND
  * oauth_client_endpoints.redirect_uri = :redirectUri
  * </code>
  *
  * Response:
  *
  * <code>
  * Array
  * (
  *     [client_id] => (string) The client ID
  *     [client secret] => (string) The client secret
  *     [redirect_uri] => (string) The redirect URI used in this request
  *     [name] => (string) The name of the client
  *     [auto_approve] => (bool) Whether the client should auto approve
  * )
  * </code>
  *
  * @param  string     $clientId     The client's ID
  * @param  string     $clientSecret The client's secret (default = "null")
  * @param  string     $redirectUri  The client's redirect URI (default = "null")
  * @param  string     $grantType    The grant type used in the request (default = "null")
  * @return bool|array               Returns false if the validation fails, array on success
  */
 public function getClient($clientId, $clientSecret = null, $redirectUri = null, $grantType = null)
 {
     // NOTE: this implementation does not implement any grant type checks!
     if (!$clientSecret and !$redirectUri) {
         return FALSE;
     }
     if ($redirectUri and $clientId === $this->get_internal_client_id()) {
         // The internal client only supports local redirects, so we strip the
         // domain information from the URI. This also prevents accidental redirect
         // outside of the current domain.
         $redirectUri = parse_url($redirectUri, PHP_URL_PATH);
         // We attempt to strip out the base URL, so that deployments work properly
         // when installed to a sub-directory.
         $baseUrl = preg_quote(URL::base(NULL, true), '~');
         $redirectUri = preg_replace("~^{$baseUrl}~", '/', $redirectUri);
     }
     if ($clientSecret and $redirectUri) {
         $query = $this->query_secret_and_redirect_uri($clientId, $clientSecret, $redirectUri);
     } else {
         if ($clientSecret) {
             $query = $this->query_secret($clientId, $clientSecret);
         } else {
             if ($redirectUri) {
                 $query = $this->query_redirect_uri($clientId, $redirectUri);
             }
         }
     }
     $query->param(':clientId', $clientId)->param(':clientSecret', $clientSecret)->param(':redirectUri', $redirectUri);
     return $this->select_one_result($query);
 }
示例#9
0
 /**
  * ajax-based serverside processed datatables example action
  */
 public function action_datatables_ajax()
 {
     // Column definition
     $columns = array("test1" => "Testcolumn #1", "test2" => "Testcolumn #2");
     // Generate random data
     $data = Session::instance()->get('dattables_example', array());
     if (empty($data)) {
         for ($i = 0; $i < 5000; $i++) {
             $data[] = array('test1' => $this->generateRandomString(25), 'test2' => $this->generateRandomString(25));
         }
     }
     // Create datatable
     $datatable = new Datatable($columns);
     // Here you could also pass in a orm model like this: $datatable->add_entries(ORM::factory('Model'));
     // Then the model needs to have columns named like the keys in the column definition, so in this example
     // test1 and test2 are needed properties on the model.
     $datatable->add_entries($data);
     $datatable->set_serverside(URL::base() . 'UIFWExamples/datatables_ajax');
     // Render html code from datatable->render() with the html layout
     if (Request::$current->is_ajax()) {
         echo $datatable->ajax_render();
     } else {
         $this->renderHtml($datatable->render());
     }
 }
示例#10
0
 /**
  * Create HTML link anchors. Note that the title is not escaped, to allow
  * HTML elements within links (images, etc).
  *
  * @param   string  URL or URI string
  * @param   string  link text
  * @param   array   HTML anchor attributes
  * @param   string  use a specific protocol
  * @return  string
  */
 public static function anchor($uri, $title = NULL, array $attributes = NULL, $protocol = NULL)
 {
     if ($title === NULL) {
         // Use the URI as the title
         $title = $uri;
     }
     // Translate the title
     $title = __($title);
     if ($uri === '') {
         // Only use the base URL
         $uri = URL::base(FALSE, $protocol);
     } else {
         if (strpos($uri, '://') !== FALSE) {
             if (HTML::$windowed_urls === TRUE and empty($attributes['target'])) {
                 // Make the link open in a new window
                 $attributes['target'] = '_blank';
             }
         } elseif ($uri[0] !== '#') {
             // Make the URI absolute for non-id anchors
             $uri = URL::site($uri, $protocol);
         }
     }
     // Add the sanitized link to the attributes
     $attributes['href'] = $uri;
     return '<a' . HTML::attributes($attributes) . '>' . $title . '</a>';
 }
示例#11
0
 public static function url()
 {
     if (empty(self::$base)) {
         self::$base = dirname($_SERVER['PHP_SELF']) != '/' ? dirname($_SERVER['PHP_SELF']) : '';
     }
     return self::$base;
 }
示例#12
0
文件: base.php 项目: reith2004/admin
 /**
  * __construct
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     API::$component = 'admin';
     $this->url = Config::get('layla.admin.url_prefix') . '/';
     View::share('base_url', URL::base());
 }
示例#13
0
 protected function redirect($link = NULL, $code = 302)
 {
     if (empty($link)) {
         $link = URL::base();
     }
     $this->request->current()->redirect($link, $code);
 }
示例#14
0
 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_pay()
 {
     $this->auto_render = FALSE;
     $order_id = $this->request->param('id');
     $order = new Model_Order();
     $order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         // case when selling advert
         if ($order->id_product == Model_Order::PRODUCT_AD_SELL) {
             $paypal_account = $order->ad->paypal_account();
             $currency = i18n::get_intl_currency_symbol();
             if (isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) {
                 $order->amount = $order->amount + $order->ad->cf_shipping;
             }
         } else {
             $paypal_account = core::config('payment.paypal_account');
             $currency = core::config('payment.paypal_currency');
         }
         $paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
         $paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => $paypal_account, 'paypal_currency' => $currency, 'item_name' => $order->description);
         $this->template = View::factory('paypal', $paypal_data);
         $this->response->body($this->template->render());
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->redirect(Route::url('default'));
     }
 }
示例#15
0
 /**
  * Builds the html-code for all registered scripts and styles.
  * This can get used to ouput them in the header of the main layout view.
  */
 public static function get_html_styles_and_scripts()
 {
     $output = '';
     // Build all styles
     foreach (self::$_styles as $style) {
         // Check if the style is remote
         $is_remote = strpos($style, "http://") !== FALSE;
         // Check if not remote and locally our file exists
         if (!$is_remote && !file_exists(DOCROOT . $style)) {
             throw new Exception('Style not found: ' . DOCROOT . $style);
         }
         $output .= '<link rel="stylesheet" type="text/css" href="' . ($is_remote ? '' : URL::base()) . $style . '">' . "\r\n";
     }
     // Build all scripts
     foreach (self::$_scripts as $script) {
         // Check if the style is remote
         $is_remote = strpos($script, "http://") !== FALSE;
         // Check if not remote and locally our file exists
         if (!$is_remote && !file_exists(DOCROOT . $style)) {
             throw new Exception('Style not found: ' . DOCROOT . $style);
         }
         $output .= '<script type="text/javascript" src="' . ($is_remote ? '' : URL::base()) . $script . '"></script>' . "\r\n";
     }
     return $output;
 }
 /**
  * Creates a new controller instance. Each controller must be constructed
  * with the request object that created it.
  *
  * @param   Request   $request  Request that created the controller
  * @param   Response  $response The request's response
  * @return  void
  */
 public function __construct(Request $request, Response $response)
 {
     parent::__construct($request, $response);
     // Set transformation
     if (isset($_GET['transform'])) {
         if ($_GET['transform'] == 'TRUE') {
             $this->transform = TRUE;
         } elseif ($_GET['transform'] == 'FALSE') {
             $this->transform = FALSE;
         } elseif ($_GET['transform'] == 'XML') {
             $this->transform = 'XML';
         } elseif ($_GET['transform'] == 'JSON') {
             $this->transform = 'JSON';
         } else {
             $this->transform = 'auto';
         }
     } else {
         $this->transform = Kohana::$config->load('xslt.transform');
     }
     // Set XSLT path
     $this->xslt_path = Kohana::$base_url . 'xsl/';
     // Create the XML DOM
     $this->dom = new DomDocument('1.0', 'UTF-8');
     $this->dom->formatOutput = TRUE;
     // Create the XML root
     $this->xml = $this->dom->appendChild($this->dom->createElement('root'));
     // Create the meta node
     $this->xml_meta = $this->xml->appendChild($this->dom->createElement('meta'));
     xml::to_XML(array('protocol' => isset($_SERVER['HTTPS']) ? 'https' : 'http', 'domain' => $_SERVER['SERVER_NAME'], 'base' => URL::base(), 'path' => $this->request->uri(), 'action' => $this->request->action(), 'controller' => $this->request->controller(), 'url_params' => $_GET), $this->xml_meta);
     // Create the content node
     $this->xml_content = $this->xml->appendChild($this->dom->createElement('content'));
     return TRUE;
 }
示例#17
0
 public function action_logout()
 {
     $auth = Auth::instance();
     $auth->logout();
     $this->request->redirect(URL::base());
     //redireccionamos a la pagina principal
 }
示例#18
0
文件: ikea.php 项目: netaspid/ikea-ws
 public function action_index()
 {
     $art = $this->request->param('id');
     $mGetDataByLink = ORM::factory('Link')->where('articul', '=', "")->find_all();
     if (!$art) {
         foreach ($mGetDataByLink as $mGetDataSingleton) {
             $arrayData = MyExtention::DisplayInfo($mGetDataSingleton->link);
             if ($arrayData) {
                 foreach ($arrayData as $key => $value) {
                     if ($key == "partnumber") {
                         $pn = $value;
                     }
                 }
             }
             if (isset($pn)) {
                 $mGetDataSingleton->set('articul', $pn)->save();
             }
         }
         $view = View::factory('Ikea');
         $view->partnumber = $mGetDataByLink;
         $this->response->body($view);
     } else {
         $url = URL::base() . "xmlshow/" . $art . ".xml";
         //var_dump($url);
         $this->redirect($url);
     }
 }
示例#19
0
 public function __construct()
 {
     $this->tags = array('Serie de lo Subliminal', 'Cartulina', 'Lienzo', 'Serie Animal', 'Serie el Bloque', 'Serie Camino');
     $this->authors = array('', 'Juan L. Brouwer', 'Oscar J. Jacas');
     $this->comments = array('Monlusce lfersa eronerts ler kertase. Lorem ipsum dolor sit amet consect- etuer adipiscing praesent vestibulum molestiet lacuenean fuscem suscipit varius micum sociis natoque penatibuset magnis dis.', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');
     $this->paintings = array(array('name' => 'Ciudad Calcinada', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/aa992922d5531f8c18e68c9b0e3ef47c3b2eabd5'), array('name' => 'Ciudad en Rojo', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/cfd1438daf02bcbc4e2b8f6b69b83297f239a815'), array('name' => 'El bien y el mal', 'dimensions' => '35 x 40.5 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/e435ff3aaa6868a89c0104ecfe39c098d386e212'), array('name' => 'Equilibrio', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/224f2d9b339cecdb2f1d3b78bb887bf998977ce0'), array('name' => 'Estacionamiento', 'dimensions' => '80 x 83 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/bb9f8daffd22fc9c7eedf4c71929e8b7c798e6ee'), array('name' => 'Estado de Gracia', 'dimensions' => '100 x 130 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/adfd7e02326b4a3002427db4db89450ab218cf32'), array('name' => 'Interior', 'dimensions' => '100 x 90 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/1dd68e5c21e5a83b2707c28202c36423c03b04dd'), array('name' => 'Pistola', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/97aec79c85cf519745f3a3c24de4b653e9a86f71'), array('name' => 'Sectores', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/62051e7ffdb0ea228440c2567675412cd92b2d02'), array('name' => 'Secuencia', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/433b5106c905e4103eb6839f16c5446d540440ea'), array('name' => 'Serie Columnas. No 3. Agudeza', 'dimensions' => '100 x 133 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/4f6e989b78429c7574fc39b1f5a4e1d303f9880a'), array('name' => 'Serie de lo Subliminal. No 1', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/656744773f4aa5c8e476b0ea8714aa2de1980662'), array('name' => 'Serie Disolución No 3', 'dimensions' => '67 x 65.5 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2011, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/b0b7bda998469f1c19dd7b1c9b7a36535fe13e13'), array('name' => 'Serie Disolución. No 2', 'dimensions' => '45.5 x 45.5 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2011, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/8af3d624a8402421ef1af9da72b5a63562d4bb93'), array('name' => 'Serie Disolución. No 4', 'dimensions' => '50 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/c2cf1de4ea1dad5bb885509a77bdf3c333c32c00'), array('name' => 'Serie Disolución. No 5', 'dimensions' => '50 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/13a55a8c6e028460a7258a17f1f632554f2bd678'), array('name' => 'Serie Disoución. No 6', 'dimensions' => '33 x 33.5 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/d606d5499a7cd2a5e935ee81b6dea9ed26db8798'), array('name' => 'Serie Disolución No 1', 'dimensions' => '91 x 110 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2011, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/14de170eec4bc59a3772bec4393c0ccf41d8d94a'), array('name' => 'To be or not to be', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/6025f94596c2445f0a776d9bac929829de3c948d'), array('name' => 'Transparency Inside', 'dimensions' => '50 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(1), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/60f8fe46572ddf74fae3eaa175d74f687ab54d9f'), array('name' => 'A prueba de bala', 'dimensions' => '80 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/109fd1b9b202bf067ad41aabe2f0d41f8ad83c66'), array('name' => 'Agua pasada no mueve molino', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/84cb86a6c52cd3ce1d007e820963dcccc999f135'), array('name' => 'Coliseo', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/c4e327b21afbfd7200c8b108f8d77721bb303562'), array('name' => 'Densidad', 'dimensions' => '70.5 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/6af8c038f7482f576c508abe8f2f94b1d6d3736a'), array('name' => 'Distancia', 'dimensions' => '80 x 82 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/3975ce41a954b03acf3a7689035b9b9f47d8900f'), array('name' => 'Dos puertas', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/ac8dece7a4898f37be6011722ea2961fc13bded8'), array('name' => 'Fundición', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/97b235c835c09a7413c6357fc7b455ea9a0e195c'), array('name' => 'Influencia externa', 'dimensions' => '33.5 x 40 cmm', 'type' => 'Tempera sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/1b415544ed9ce54f0f28687daae86fe761ae18ab'), array('name' => 'Inframundo', 'dimensions' => '50 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/e4dd04fcd75b8e3aae7534d9a05726a336554129'), array('name' => 'Intersecciones', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/c3e575e1f5f35f0b7a6fc3fa86656b538e883983'), array('name' => 'Límite al cielo', 'dimensions' => '33 x 33.5 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/136457d73c339508b5b07a9b2d29609643b8f0d8'), array('name' => 'Niveles del subconciente', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/7ee00d3d2fe002cb25f3bae4909623a843c24f0b'), array('name' => 'Orillas', 'dimensions' => '105 x 133 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/5b9351d34d2b5784fdadb675d79983296e1663fd'), array('name' => 'Reflejo azul', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/c7bb275299f079e37ecaa84ed4133612332cdfd2'), array('name' => 'Reflejos', 'dimensions' => '70 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/f039761754933a9cf3701c6fb2c3068878485192'), array('name' => 'Serie Animal. No 1. Toy horse', 'dimensions' => '65 x 34.5 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/4e0c4fbf143463d51e11e6119a19863a278c98b3'), array('name' => 'Serie Animal. No 2. Animal mitológico', 'dimensions' => '32.5 x 33.5 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/236111d07e8715bbffd37d98629eebd2651a2c18'), array('name' => 'Serie Animal. No 5. Fósil', 'dimensions' => '50 x 33.5 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/ad4c80f027b67311853082f2a31f5165b3c9348d'), array('name' => 'Serie Camino. No 1', 'dimensions' => '100 x 130 cmm', 'type' => 'Acrílico sobre Lienzo', 'painter' => $this->getAuthor(2), 'year' => 2011, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/b6b6c4f7d9d933ef892df79b8986aa4e8c61ce49'), array('name' => 'Serie de lo Subliminal. No 4. Reflejos de la Ciudad', 'dimensions' => '50 x 70 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/17b2827b1a98892b70b849d8043a3c3e62bead0a'), array('name' => 'Serie el Bloque. No 5. Reflejo nocturno', 'dimensions' => '50 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/5f6b069b34f38431d38194bd65ded6b548e347f8'), array('name' => 'Serie el Bloque.No 4. Yunque', 'dimensions' => '50 x 50 cmm', 'type' => 'Acrílico sobre Cartulina', 'painter' => $this->getAuthor(2), 'year' => 2012, 'comment' => $this->getComment(), 'image_path' => URL::base() . '/uploads/paintings/0fef9d2e73a0def95d24eba4aec17fc439f350cd'));
 }
示例#20
0
 public function get_edit($group_id)
 {
     if (!ctype_digit($group_id)) {
         $this->data['message'] = __('permissions::lang.Invalid group id provided')->get(ADM_LANG);
         $this->data['message_type'] = 'error';
         return Redirect::to(ADM_URI . '/permissions/')->with($this->data);
     }
     $group = Groups\Model\Group::find($group_id);
     if (!isset($group) or empty($group)) {
         $this->data['message'] = __('permissions::lang.Sorry can\'t find group to edit it\'s permissions')->get(ADM_LANG);
         $this->data['message_type'] = 'error';
         return Redirect::to(ADM_URI . '/permissions/')->with($this->data);
     }
     if (isset($group) and $group->slug == 'admin') {
         $this->data['message'] = __('permissions::lang.The Administration group has access to everything, and cannot be edited')->get(ADM_LANG);
         $this->data['message_type'] = 'error';
         return Redirect::to(ADM_URI . '/permissions/')->with($this->data);
     }
     $this->data['section_bar'] = array(__('permissions::lang.Permissions')->get(ADM_LANG) => URL::base() . '/' . ADM_URI . '/permissions', __('permissions::lang.Edit Group Permissions')->get(ADM_LANG) => URL::base() . '/' . ADM_URI . '/permissions/' . $group->id . '/edit');
     $this->data['section_bar_active'] = __('permissions::lang.Edit Group Permissions')->get(ADM_LANG);
     $this->data['group_name'] = $group->name;
     $this->data['group_id'] = $group->id;
     $this->data['permission_groups'] = Permission::build_permission_groups($group->id);
     return $this->theme->render('permissions::backend.edit', $this->data);
 }
 public function before()
 {
     parent::before();
     View::set_global('base', URL::base(TRUE, FALSE));
     $this->__JS__ = 'public/static/template/admin/';
     $this->__CSS__ = 'public/static/template/admin/';
 }
示例#22
0
 static function iframe($url, $css_class = NULL)
 {
     $class_str = '';
     if ($css_class) {
         $class_str = ' class="' . $css_class . '"';
     }
     return '<iframe style="width: 100%; height: 600px;" src="' . URL::base() . $url . '"' . $class_str . ' ></iframe>';
 }
示例#23
0
 public function before()
 {
     $this->setAsset('http://localhost' . URL::base() . 'assets/');
     if ($this->tt == 0) {
         return 0;
     }
     return parent::before();
 }
示例#24
0
文件: Edit.php 项目: moult/ko-cms
 /**
  * Gets the editable page content markup as a string
  *
  * @return string
  */
 public function content_string()
 {
     $template_content = $this->template_content;
     $template_content = str_replace('{{baseurl}}', URL::base(), $template_content);
     $template_content = str_replace('{{', '&#123;&#123;', $template_content);
     $template_content = str_replace('}}', '&#125;&#125;', $template_content);
     return $template_content;
 }
示例#25
0
 /**
  * Setup the test environment
  */
 public function setUp()
 {
     URL::$base = null;
     Config::set('application.url', 'http://localhost');
     Config::set('application.index', 'index.php');
     Router::$names = array();
     Router::$routes = array();
 }
示例#26
0
 public function driver_selenium()
 {
     $driver = parent::driver_selenium();
     $config = Kohana::$config->load('functest.drivers.selenium');
     $connection = new Driver_Selenium_Connection($config['server']);
     $connection->start($config['desired']);
     return $driver->connection($connection)->base_url(URL::base(TRUE));
 }
示例#27
0
 /**
  * Uniformize test environment
  */
 public static function setUpBeforeClass()
 {
     URL::$base = 'http://test/';
     Config::set('application.languages', array());
     Config::set('application.index', '');
     Config::set('application.asset_url', '');
     Config::set('application.ssl', true);
 }
示例#28
0
 public static function avatar($email, $sz = 64, $d = null)
 {
     if ($d === null) {
         $d = URL::base(true, true) . "assets/images/default-user.png";
     }
     $sz = min(512, max(1, $sz), $sz);
     return sprintf(self::$_avatar_base, self::hash($email), urlencode($d), $sz);
 }
示例#29
0
文件: HTML.php 项目: noikiy/kohana
 public static function script($file, array $attributes = NULL, $index = FALSE)
 {
     if (strpos($file, '://') === FALSE) {
         $file = URL::base($index) . $file;
     }
     $attributes['src'] = $file;
     return '<script' . HTML::attributes($attributes) . '></script>';
 }
示例#30
0
文件: Site.php 项目: qlsove/faq
 public static function favicon($file, array $attributes = array('rel' => 'icon', 'type' => 'image/x-icon'), $protocol = NULL, $index = FALSE)
 {
     if (strpos($file, '://') === FALSE) {
         $file = URL::base($protocol, $index) . $file;
     }
     $attributes['href'] = $file;
     return '<link' . HTML::attributes($attributes) . ' />';
 }