当前位置: 首页>>代码示例>>PHP>>正文


PHP Library\Text类代码示例

本文整理汇总了PHP中Goteo\Library\Text的典型用法代码示例。如果您正苦于以下问题:PHP Text类的具体用法?PHP Text怎么用?PHP Text使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Text类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Suplantando al usuario
  * @param string $id   user->id
  */
 public function index()
 {
     $admin = $_SESSION['user'];
     if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['id']) && !empty($_POST['impersonate'])) {
         $impersonator = $_SESSION['user']->id;
         session_unset();
         $_SESSION['user'] = User::get($_POST['id']);
         $_SESSION['impersonating'] = true;
         $_SESSION['impersonator'] = $impersonator;
         unset($_SESSION['admin_menu']);
         /*
          * Evento Feed
          */
         // Evento Feed
         $log = new Feed();
         $log->setTarget($_SESSION['user']->id, 'user');
         $log->populate('Suplantación usuario (admin)', '/admin/users', \vsprintf('El admin %s ha %s al usuario %s', array(Feed::item('user', $admin->name, $admin->id), Feed::item('relevant', 'Suplantado'), Feed::item('user', $_SESSION['user']->name, $_SESSION['user']->id))));
         $log->doAdmin('user');
         unset($log);
         throw new Redirection('/dashboard');
     } else {
         Message::Error(Text::get('impersonate-error'));
         throw new Redirection('/dashboard');
     }
 }
开发者ID:kenjs,项目名称:Goteo,代码行数:29,代码来源:impersonate.php

示例2: process

 public static function process($action = 'list', $id = null)
 {
     $model = 'Goteo\\Model\\Blog\\Post\\Tag';
     $url = '/admin/tags';
     $errors = array();
     switch ($action) {
         case 'add':
             return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'edit', 'data' => (object) array(), 'form' => array('action' => "{$url}/edit/", 'submit' => array('name' => 'update', 'label' => Text::_('Añadir')), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'name' => array('label' => Text::_('Tag'), 'name' => 'name', 'type' => 'text')))));
             break;
         case 'edit':
             // gestionar post
             if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update'])) {
                 $errors = array();
                 // instancia
                 $item = new $model(array('id' => $_POST['id'], 'name' => $_POST['name']));
                 if ($item->save($errors)) {
                     Message::Info(Text::get('admin-tags-info-udate'));
                     throw new Redirection($url);
                 } else {
                     Message::Error(Text::get('admin-tags-error-save-fail') . implode('<br />', $errors));
                 }
             } else {
                 $item = $model::get($id);
             }
             return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'edit', 'data' => $item, 'form' => array('action' => "{$url}/edit/{$id}", 'submit' => array('name' => 'update', 'label' => Text::get('regular-save')), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'name' => array('label' => Text::_('Tag'), 'name' => 'name', 'type' => 'text')))));
             break;
         case 'remove':
             if ($model::delete($id)) {
                 throw new Redirection($url);
             }
             break;
     }
     return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'list', 'model' => 'tag', 'addbutton' => Text::_('Nuevo tag'), 'data' => $model::getList(1), 'columns' => array('edit' => '', 'name' => Text::_('Tag'), 'used' => Text::_('Entradas'), 'translate' => '', 'remove' => ''), 'url' => "{$url}"));
 }
开发者ID:kenjs,项目名称:Goteo,代码行数:34,代码来源:tags.php

示例3: process

 public static function process($action = 'list', $id = null)
 {
     $node = isset($_SESSION['admin_node']) ? $_SESSION['admin_node'] : \GOTEO_NODE;
     $model = 'Goteo\\Model\\Sponsor';
     $url = '/admin/sponsors';
     $errors = array();
     switch ($action) {
         case 'add':
             return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'edit', 'data' => (object) array('order' => $model::next($node), 'node' => $node), 'form' => array('action' => "{$url}/edit/", 'submit' => array('name' => 'update', 'label' => Text::_('Añadir')), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'node' => array('label' => '', 'name' => 'node', 'type' => 'hidden'), 'name' => array('label' => Text::_('Patrocinador'), 'name' => 'name', 'type' => 'text'), 'url' => array('label' => Text::_('Enlace'), 'name' => 'url', 'type' => 'text', 'properties' => 'size=100'), 'image' => array('label' => Text::_('Logo'), 'name' => 'image', 'type' => 'image'), 'order' => array('label' => Text::_('Posición'), 'name' => 'order', 'type' => 'text')))));
             break;
         case 'edit':
             // gestionar post
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 // instancia
                 $item = new $model(array('id' => $_POST['id'], 'name' => $_POST['name'], 'node' => $_POST['node'], 'image' => $_POST['image'], 'url' => $_POST['url'], 'order' => $_POST['order']));
                 // tratar si quitan la imagen
                 $current = $_POST['image'];
                 // la actual
                 if (isset($_POST['image-' . $current . '-remove'])) {
                     $image = Model\Image::get($current);
                     $image->remove('sponsor');
                     $item->image = '';
                     $removed = true;
                 }
                 // tratar la imagen y ponerla en la propiedad image
                 if (!empty($_FILES['image']['name'])) {
                     $item->image = $_FILES['image'];
                 }
                 if ($item->save($errors)) {
                     Message::Info(Text::_('Datos grabados correctamente'));
                     throw new Redirection($url);
                 } else {
                     Message::Error(Text::_('No se ha grabado correctamente. ') . implode(', ', $errors));
                 }
             } else {
                 $item = $model::get($id);
             }
             return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'edit', 'data' => $item, 'form' => array('action' => "{$url}/edit/{$id}", 'submit' => array('name' => 'update', 'label' => Text::get('regular-save')), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'node' => array('label' => '', 'name' => 'node', 'type' => 'hidden'), 'name' => array('label' => Text::_('Patrocinador'), 'name' => 'name', 'type' => 'text'), 'url' => array('label' => Text::_('Enlace'), 'name' => 'url', 'type' => 'text', 'properties' => 'size=100'), 'image' => array('label' => Text::_('Logo'), 'name' => 'image', 'type' => 'image'), 'order' => array('label' => Text::_('Posición'), 'name' => 'order', 'type' => 'text')))));
             break;
         case 'up':
             $model::up($id, $node);
             throw new Redirection($url);
             break;
         case 'down':
             $model::down($id, $node);
             throw new Redirection($url);
             break;
         case 'remove':
             if ($model::delete($id)) {
                 Message::Info(Text::_('Se ha eliminado el registro'));
                 throw new Redirection($url);
             } else {
                 Message::Info(Text::_('No se ha podido eliminar el registro'));
             }
             break;
     }
     return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'list', 'addbutton' => Text::_('Nuevo patrocinador'), 'data' => $model::getAll($node), 'columns' => array('edit' => '', 'name' => Text::_('Patrocinador'), 'url' => Text::_('Enlace'), 'image' => Text::_('Imagen'), 'order' => Text::_('Posición'), 'up' => '', 'down' => '', 'remove' => ''), 'url' => "{$url}"));
 }
开发者ID:anvnguyen,项目名称:Goteo,代码行数:58,代码来源:sponsors.php

示例4: process

 public static function process($action = 'list', $id = null)
 {
     $node = isset($_SESSION['admin_node']) ? $_SESSION['admin_node'] : \GOTEO_NODE;
     $errors = array();
     switch ($action) {
         case 'add':
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $page = new Page();
                 $page->id = $_POST['id'];
                 $page->name = $_POST['name'];
                 if ($page->add($errors)) {
                     Message::Info('La página <strong>' . $page->name . '</strong> se ha creado correctamente, se puede editar ahora.');
                     throw new Redirection("/admin/pages/edit/{$page->id}");
                 } else {
                     Message::Error('No se ha creado bien ' . implode('<br />', $errors));
                     throw new Redirection("/admin/pages/add");
                 }
             }
             return new View('view/admin/index.html.php', array('folder' => 'pages', 'file' => 'add'));
             break;
         case 'edit':
             if ($node != \GOTEO_NODE && !in_array($id, static::_node_pages())) {
                 Message::Info('No puedes gestionar la página <strong>' . $id . '</strong>');
                 throw new Redirection("/admin/pages");
             }
             // si estamos editando una página
             $page = Page::get($id, $node, \GOTEO_DEFAULT_LANG);
             // si llega post, vamos a guardar los cambios
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $page->name = $_POST['name'];
                 $page->description = $_POST['description'];
                 $page->content = $_POST['content'];
                 if ($page->save($errors)) {
                     // Evento Feed
                     $log = new Feed();
                     if ($node != \GOTEO_NODE && in_array($id, static::_node_pages())) {
                         $log->setTarget($node, 'node');
                     }
                     $log->populate(Text::_('modificacion de página institucional (admin)'), '/admin/pages', \vsprintf("El admin %s ha %s la página institucional %s", array(Feed::item('user', $_SESSION['user']->name, $_SESSION['user']->id), Feed::item('relevant', 'Modificado'), Feed::item('relevant', $page->name, $page->url))));
                     $log->doAdmin('admin');
                     unset($log);
                     Message::Info('La página ' . $page->name . ' se ha actualizado correctamente');
                     throw new Redirection("/admin/pages");
                 } else {
                     Message::Error(implode('<br />', $errors));
                 }
             }
             // sino, mostramos para editar
             return new View('view/admin/index.html.php', array('folder' => 'pages', 'file' => 'edit', 'page' => $page));
             break;
         case 'list':
             // si estamos en la lista de páginas
             $pages = Page::getList($node);
             return new View('view/admin/index.html.php', array('folder' => 'pages', 'file' => 'list', 'pages' => $pages, 'node' => $node));
             break;
     }
 }
开发者ID:isbkch,项目名称:Goteo,代码行数:57,代码来源:pages.php

示例5: index

 public function index()
 {
     if (isset($_GET['error'])) {
         throw new \Goteo\Core\Error('418', Text::html('fatal-error-teapot'));
     }
     // orden de los elementos en portada
     $order = Home::getAll();
     // si estamos en easy mode, quitamos el feed
     if (defined('GOTEO_EASY') && \GOTEO_EASY === true && isset($order['feed'])) {
         unset($order['feed']);
     }
     // entradas de blog
     if (isset($order['posts'])) {
         // entradas en portada
         $posts = Post::getAll();
     }
     // Proyectos destacados
     if (isset($order['promotes'])) {
         $promotes = Promote::getAll(true);
         foreach ($promotes as $key => &$promo) {
             try {
                 $promo->projectData = Project::getMedium($promo->project, LANG);
             } catch (\Goteo\Core\Error $e) {
                 unset($promotes[$key]);
             }
         }
     }
     // actividad reciente
     if (isset($order['feed'])) {
         $feed = array();
         $feed['goteo'] = Feed::getAll('goteo', 'public', 15);
         $feed['projects'] = Feed::getAll('projects', 'public', 15);
         $feed['community'] = Feed::getAll('community', 'public', 15);
     }
     // Banners siempre
     /*            $banners   = Banner::getAll(true);
     
                 foreach ($banners as $id => &$banner) {
                     
                     if (!empty($banner->project)) {
                         try {
                             $banner->project = Project::get($banner->project, LANG);
                         } catch (\Goteo\Core\Error $e) {
                             unset($banners[$id]);
                         }
                     }
                     
                 }*/
     $template = VIEW_PATH . '/index.html.php';
     return new View($template, array('banners' => $banners, 'posts' => $posts, 'promotes' => $promotes, 'order' => $order));
 }
开发者ID:kenjs,项目名称:Goteo,代码行数:51,代码来源:index.php

示例6: process

 public static function process($action = 'list', $id = null)
 {
     $model = 'Goteo\\Model\\News';
     $url = '/admin/news';
     $errors = array();
     switch ($action) {
         case 'add':
             return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'edit', 'data' => (object) array('order' => $model::next()), 'form' => array('action' => "{$url}/edit/", 'submit' => array('name' => 'update', 'label' => 'Añadir'), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'title' => array('label' => 'Noticia', 'name' => 'title', 'type' => 'text', 'properties' => 'size="100" maxlength="100"'), 'description' => array('label' => 'Entradilla', 'name' => 'description', 'type' => 'textarea', 'properties' => 'cols="100" rows="2"'), 'url' => array('label' => 'Enlace', 'name' => 'url', 'type' => 'text', 'properties' => 'size=100'), 'order' => array('label' => 'Posición', 'name' => 'order', 'type' => 'text')))));
             break;
         case 'edit':
             // gestionar post
             if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update'])) {
                 // instancia
                 $item = new $model(array('id' => $_POST['id'], 'title' => $_POST['title'], 'description' => $_POST['description'], 'url' => $_POST['url'], 'order' => $_POST['order']));
                 if ($item->save($errors)) {
                     if (empty($_POST['id'])) {
                         // Evento Feed
                         $log = new Feed();
                         $log->populate('nueva micronoticia (admin)', '/admin/news', \vsprintf('El admin %s ha %s la micronoticia "%s"', array(Feed::item('user', $_SESSION['user']->name, $_SESSION['user']->id), Feed::item('relevant', 'Publicado'), Feed::item('news', $_POST['title'], '#news' . $item->id))));
                         $log->doAdmin('admin');
                         unset($log);
                     }
                     throw new Redirection($url);
                 } else {
                     Message::Error(implode('<br />', $errors));
                 }
             } else {
                 $item = $model::get($id);
             }
             return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'edit', 'data' => $item, 'form' => array('action' => "{$url}/edit/{$id}", 'submit' => array('name' => 'update', 'label' => Text::get('regular-save')), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'title' => array('label' => 'Noticia', 'name' => 'title', 'type' => 'text', 'properties' => 'size="100"  maxlength="80"'), 'description' => array('label' => 'Entradilla', 'name' => 'description', 'type' => 'textarea', 'properties' => 'cols="100" rows="2"'), 'url' => array('label' => 'Enlace', 'name' => 'url', 'type' => 'text', 'properties' => 'size=100'), 'order' => array('label' => 'Posición', 'name' => 'order', 'type' => 'text')))));
             break;
         case 'up':
             $model::up($id);
             break;
         case 'down':
             $model::down($id);
             break;
         case 'remove':
             $tempData = $model::get($id);
             if ($model::delete($id)) {
                 // Evento Feed
                 $log = new Feed();
                 $log->populate('micronoticia quitada (admin)', '/admin/news', \vsprintf('El admin %s ha %s la micronoticia "%s"', array(Feed::item('user', $_SESSION['user']->name, $_SESSION['user']->id), Feed::item('relevant', 'Quitado'), Feed::item('blog', $tempData->title))));
                 $log->doAdmin('admin');
                 unset($log);
                 throw new Redirection($url);
             }
             break;
     }
     return new View('view/admin/index.html.php', array('folder' => 'base', 'file' => 'list', 'model' => 'news', 'addbutton' => 'Nueva noticia', 'data' => $model::getAll(), 'columns' => array('edit' => '', 'title' => 'Noticia', 'order' => 'Posición', 'up' => '', 'down' => '', 'translate' => '', 'remove' => ''), 'url' => "{$url}"));
 }
开发者ID:isbkch,项目名称:Goteo,代码行数:51,代码来源:news.php

示例7: save

 public function save(&$errors = array())
 {
     if (!$this->validate($errors)) {
         return false;
     }
     try {
         $sql = "REPLACE INTO project_account (project, bank, bank_owner, paypal, paypal_owner, allowpp) VALUES(:project, :bank, :bank_owner, :paypal, :paypal_owner, :allowpp)";
         $values = array(':project' => $this->project, ':bank' => $this->bank, ':bank_owner' => $this->bank_owner, ':paypal' => $this->paypal, ':paypal_owner' => $this->paypal_owner, ':allowpp' => $this->allowpp);
         self::query($sql, $values);
         return true;
     } catch (\PDOException $e) {
         $errors[] = Text::_("Las cuentas no se han asignado correctamente. Por favor, revise los datos.") . $e->getMessage();
         return false;
     }
 }
开发者ID:kenjs,项目名称:Goteo,代码行数:15,代码来源:account.php

示例8: process

 public static function process($action = 'list', $id = null)
 {
     $model = 'Goteo\\Model\\Skill';
     $url = '/admin/skills';
     $errors = array();
     switch ($action) {
         case 'add':
             if (isset($_GET['word'])) {
                 $item = (object) array('name' => $_GET['word']);
             } else {
                 $item = (object) array();
             }
             $parent_skill = $model::getAllParent();
             return new View('view/admin/index.html.php', array('folder' => 'skills', 'file' => 'edit', 'data' => $item, 'parent_skill' => $parent_skill, 'form' => array('action' => "{$url}/edit/", 'submit' => array('name' => 'update', 'label' => Text::_('Añadir')), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'name' => array('label' => Text::_('Skill'), 'name' => 'name', 'type' => 'text'), 'description' => array('label' => Text::_('Descripción'), 'name' => 'description', 'type' => 'textarea', 'properties' => 'cols="100" rows="2"')))));
             break;
         case 'edit':
             // gestionar post
             if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update'])) {
                 // instancia
                 $item = new $model(array('id' => $_POST['id'], 'name' => $_POST['name'], 'description' => $_POST['description'], 'parent_skill_id' => $_POST['parent_skill_id']));
                 if ($item->save($errors)) {
                     throw new Redirection($url);
                 } else {
                     Message::Error(implode('<br />', $errors));
                 }
             } else {
                 $item = $model::get($id);
             }
             $parent_skill = $model::getAllParent();
             return new View('view/admin/index.html.php', array('folder' => 'skills', 'file' => 'edit', 'data' => $item, 'parent_skill' => $parent_skill, 'form' => array('action' => "{$url}/edit/{$id}", 'submit' => array('name' => 'update', 'label' => 'Guardar'), 'fields' => array('id' => array('label' => '', 'name' => 'id', 'type' => 'hidden'), 'name' => array('label' => 'Skill', 'name' => 'name', 'type' => 'text'), 'description' => array('label' => 'Descripción', 'name' => 'description', 'type' => 'textarea', 'properties' => 'cols="100" rows="2"')))));
             break;
         case 'up':
             $model::up($id);
             break;
         case 'down':
             $model::down($id);
             break;
         case 'remove':
             if ($model::delete($id)) {
                 throw new Redirection($url);
             }
             break;
         case 'keywords':
             return new View('view/admin/index.html.php', array('folder' => 'keywords', 'file' => 'list', 'skills' => $model::getList(), 'words' => $model::getKeyWords()));
             break;
     }
     return new View('view/admin/index.html.php', array('folder' => 'skills', 'file' => 'list', 'model' => 'skill', 'addbutton' => Text::_('New skill'), 'otherbutton' => '<a href="/admin/skills/keywords" class="button">' . Text::get('admin-skill_keyword') . '</a>', 'data' => $model::getAll(), 'columns' => array('edit' => '', 'name' => 'Skill', 'numProj' => 'Proyectos', 'numUser' => 'Usuarios', 'order' => 'Prioridad', 'translate' => '', 'up' => '', 'down' => '', 'translate' => '', 'remove' => ''), 'url' => "{$url}"));
 }
开发者ID:kenjs,项目名称:Goteo,代码行数:48,代码来源:skills.php

示例9: process

 public static function process($action = 'list', $id = null, $filters = array())
 {
     // valores de filtro
     $groups = Text::groups();
     // metemos el todos
     \array_unshift($groups, Text::_('Todas las agrupaciones'));
     //@fixme temporal hasta pasar las agrupaciones a tabal o arreglar en el list.html.php
     // I dont know if this must serve in default lang or in current navigation lang
     $data = Text::getAll($filters, 'original');
     foreach ($data as $key => $item) {
         $data[$key]->group = $groups[$item->group];
     }
     switch ($action) {
         case 'list':
             return new View('view/admin/index.html.php', array('folder' => 'texts', 'file' => 'list', 'data' => $data, 'columns' => array('edit' => '', 'text' => Text::_('Texto'), 'group' => Text::_('Agrupación')), 'url' => '/admin/texts', 'filters' => array('filtered' => $filters['filtered'], 'group' => array('label' => Text::_('Filtrar por agrupación:'), 'type' => 'select', 'options' => $groups, 'value' => $filters['group']), 'text' => array('label' => Text::_('Buscar texto:'), 'type' => 'input', 'options' => null, 'value' => $filters['text']))));
             break;
         case 'edit':
             // gestionar post
             if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update'])) {
                 $errors = array();
                 $id = $_POST['id'];
                 $text = $_POST['text'];
                 $data = array('id' => $id, 'text' => $_POST['text']);
                 if (Text::update($data, $errors)) {
                     Message::Info(Text::_('El texto ha sido actualizado'));
                     throw new Redirection("/admin/texts");
                 } else {
                     Message::Error(implode('<br />', $errors));
                 }
             } else {
                 //@TODO: this must get the text in the GOTEO_DEFAULT_LANG or it will be overwrited
                 $text = Text::getPurpose($id);
                 // Julian Canaves  23 nov 2013
                 // right now getPurpose gets the spanish text.
                 // In future this spanish text will be moved to the `Text` table
                 //  and the `Purpose` table will distribute to database text or to gettext
                 //  and there will be no hardcoded strings
                 //  and will be all happy, fun and joy
             }
             return new View('view/admin/index.html.php', array('folder' => 'texts', 'file' => 'edit', 'data' => (object) array('id' => $id, 'text' => $text), 'form' => array('action' => '/admin/texts/edit/' . $id, 'submit' => array('name' => 'update', 'label' => Text::_('Aplicar')), 'fields' => array('idtext' => array('label' => '', 'name' => 'id', 'type' => 'hidden', 'properties' => ''), 'newtext' => array('label' => Text::_('Texto'), 'name' => 'text', 'type' => 'textarea', 'properties' => 'cols="100" rows="6"')))));
             break;
         default:
             throw new Redirection("/admin");
     }
 }
开发者ID:isbkch,项目名称:Goteo,代码行数:45,代码来源:texts.php

示例10: index

 public function index($post = null)
 {
     if (!empty($post)) {
         $show = 'post';
         // -- Mensaje azul molesto para usuarios no registrados
         if (empty($_SESSION['user'])) {
             $_SESSION['jumpto'] = '/blog/' . $post;
             Message::Info(Text::html('user-login-required'));
         }
     } else {
         $show = 'list';
     }
     // sacamos su blog
     $blog = Model\Blog::get(\GOTEO_NODE, 'node');
     $filters = array();
     if (isset($_GET['tag'])) {
         $tag = Model\Blog\Post\Tag::get($_GET['tag']);
         if (!empty($tag->id)) {
             $filters['tag'] = $tag->id;
         }
     } else {
         $tag = null;
     }
     if (isset($_GET['author'])) {
         $author = Model\User::getMini($_GET['author']);
         if (!empty($author->id)) {
             $filters['author'] = $author->id;
         }
     } else {
         $author = null;
     }
     if (!empty($filters)) {
         $blog->posts = Model\Blog\Post::getList($filters);
     }
     if (isset($post) && !isset($blog->posts[$post]) && $_GET['preview'] != $_SESSION['user']->id) {
         throw new \Goteo\Core\Redirection('/blog');
     }
     // segun eso montamos la vista
     return new View('view/blog/index.html.php', array('blog' => $blog, 'show' => $show, 'filters' => $filters, 'post' => $post, 'owner' => \GOTEO_NODE));
 }
开发者ID:anvnguyen,项目名称:Goteo,代码行数:40,代码来源:blog.php

示例11: post

 public function post($post, $project = null)
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST['message'])) {
         $comment = new Model\Blog\Post\Comment(array('user' => $_SESSION['user']->id, 'post' => $post, 'date' => date('Y-m-d H:i:s'), 'text' => $_POST['message']));
         if ($comment->save($errors)) {
             // a ver los datos del post
             $postData = Model\Blog\Post::get($post);
             // Evento Feed
             $log = new Feed();
             if (!empty($project)) {
                 $projectData = Model\Project::getMini($project);
                 $log->setTarget($projectData->id);
                 $log_html = \vsprintf('%s ha escrito un %s en la entrada "%s" en las %s del proyecto %s', array(Feed::item('user', $_SESSION['user']->name, $_SESSION['user']->id), Feed::item('message', 'Comentario'), Feed::item('update-comment', $postData->title, $projectData->id . '/updates/' . $postData->id . '#comment' . $comment->id), Feed::item('update-comment', 'Novedades', $projectData->id . '/updates/'), Feed::item('project', $projectData->name, $projectData->id)));
             } else {
                 $log->setTarget('goteo', 'blog');
                 $log_html = \vsprintf('%s ha escrito un %s en la entrada "%s" del blog de %s', array(Feed::item('user', $_SESSION['user']->name, $_SESSION['user']->id), Feed::item('message', 'Comentario'), Feed::item('blog', $postData->title, $postData->id . '#comment' . $comment->id), Feed::item('blog', 'Goteo', '/')));
             }
             $log->populate('usuario escribe comentario en blog/novedades', '/admin/projects', $log_html);
             $log->doAdmin('user');
             // Evento público
             if (!empty($project)) {
                 $projectData = Model\Project::getMini($project);
                 $log_html = Text::html('feed-updates-comment', Feed::item('update-comment', $postData->title, $projectData->id . '/updates/' . $postData->id . '#comment' . $comment->id), Feed::item('update-comment', 'Novedades', $projectData->id . '/updates/'), Feed::item('project', $projectData->name, $projectData->id));
             } else {
                 $log_html = Text::html('feed-blog-comment', Feed::item('blog', $postData->title, $postData->id . '#comment' . $comment->id), Feed::item('blog', 'Goteo', '/'));
             }
             $log->populate($_SESSION['user']->name, '/user/profile/' . $_SESSION['user']->id, $log_html, $_SESSION['user']->avatar->id);
             $log->doPublic('community');
             unset($log);
             //Notificación al autor del proyecto
             // Obtenemos la plantilla para asunto y contenido
             $template = Template::get(31);
             // Sustituimos los datos
             $subject = str_replace('%PROJECTNAME%', $projectData->name, $template->title);
             $response_url = SITE_URL . '/user/profile/' . $_SESSION['user']->id . '/message';
             $project_url = SITE_URL . '/project/' . $projectData->id . '/updates/' . $postData->id . '#comment' . $comment->id;
             $search = array('%MESSAGE%', '%OWNERNAME%', '%USERNAME%', '%PROJECTNAME%', '%PROJECTURL%', '%RESPONSEURL%');
             $replace = array($_POST['message'], $projectData->user->name, $_SESSION['user']->name, $projectData->name, $project_url, $response_url);
             $content = \str_replace($search, $replace, $template->text);
             $mailHandler = new Mail();
             $mailHandler->to = $projectData->user->email;
             $mailHandler->toName = $projectData->user->name;
             $mailHandler->subject = $subject;
             $mailHandler->content = $content;
             $mailHandler->html = true;
             $mailHandler->template = $template->id;
             $mailHandler->send($errors);
             unset($mailHandler);
         } else {
             // error
         }
     }
     if (!empty($project)) {
         throw new Redirection("/project/{$project}/updates/{$post}#comment" . $comment->id, Redirection::TEMPORARY);
     } else {
         throw new Redirection("/blog/{$post}#comment" . $comment->id, Redirection::TEMPORARY);
     }
 }
开发者ID:kenjs,项目名称:Goteo,代码行数:58,代码来源:message.php

示例12:

        ?>
</div>
            <?php 
    }
} else {
    ?>
            <div class="subhead-banner"><?php 
    echo Text::html('main-banner-header');
    ?>
</div>
            <?php 
}
?>
        </div>
        <div class="mod-pojctopen"><?php 
echo Text::html('open-banner-header', $fbCode);
?>
</div>
    </div>
    <div class="sliderbanners-ctrl">
        <a class="prev">prev</a>
        <ul class="paginacion"></ul>
        <a class="next">next</a>
    </div>
</div>

<?php 
if (isset($_SESSION['messages'])) {
    include 'view/header/message.html.php';
}
?>
开发者ID:isbkch,项目名称:Goteo,代码行数:31,代码来源:index.html.php

示例13:

        $title   = Text::get('regular-hello') . " $name";
//        $message = Text::get('project-invest-login');
        break;
    case 'confirm':
        $title   = Text::get('regular-hello') . " $name";
//        $message = Text::get('project-invest-confirm');
        break;
    case 'continue':
        $title   = Text::get('regular-hello') . " $name";
//        $message = Text::get('project-invest-continue');
        break;
    case 'ok':
        $title   = Text::get('regular-thanks') . " {$name}!";
//        $message = Text::get('project-invest-ok');
        break;
    case 'fail':
        $title   = Text::get('regular-sorry') . " {$name}";
//        $message = Text::get('project-invest-fail');
        break;
}

$level = (int) $this['level'] ?: 3;

?>
<div class="widget invest-message">
    <h2><?php echo $avatarhtml; ?><span><?php echo $title; ?></span><?/*<br />
    <span class="message"><?php echo $message; ?></span></h2>*/?>


</div>
开发者ID:kenjs,项目名称:Goteo,代码行数:30,代码来源:investMsg.html.php

示例14:

        ?>
                        <li><a href="/admin"><span><?php 
        echo Text::get('regular-admin_board');
        ?>
</span></a></li>
                        <?php 
    }
    ?>
                        <li class="logout"><a href="/user/logout"><span><?php 
    echo Text::get('regular-logout');
    ?>
</span></a></li>
                    </ul>
                </div>
            </li>            
            <?php 
} else {
    ?>
            
            <li class="login">
                <a href="/user/login"><?php 
    echo Text::get('regular-login');
    ?>
</a>
            </li>
            
            <?php 
}
?>
        </ul>
    </div>
开发者ID:anvnguyen,项目名称:Goteo,代码行数:31,代码来源:menu.html.php

示例15:

                    <select id="orig-lang" name="lang">
                        <?php 
foreach ($langs as $item) {
    ?>
                            <option value="<?php 
    echo $item->id;
    ?>
"<?php 
    if ($project->lang == $item->id || empty($project->lang) && $item->id == 'es') {
        echo ' selected="selected"';
    }
    ?>
><?php 
    echo $item->name;
    ?>
</option>
                        <?php 
}
?>
                    </select>
                </td>
            </tr>
        </table>


       <input type="submit" name="save" value="<?php 
echo Text::_("Guardar");
?>
" />
    </form>
</div>
开发者ID:kenjs,项目名称:Goteo,代码行数:31,代码来源:edit.html.php


注:本文中的Goteo\Library\Text类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。