function renderAsIcons() { $out = ''; if (isset($this->pager)) { $out .= $this->pager->render(); } // $out.='<table border="1">'; /* if (is_array($this->column)) { foreach ($this->column as $id=>$column) { $out.='<th>' . $column['title'] .'</th>'; } } else { trigger_error('datagrid::render() no column defined'); } if (is_array($this->local_action)) { $out.='<th>' . translate('datagrid_action_header') .'</th>'; } */ if (is_array($this->data)) { $i = 0; foreach ($this->data as $data) { $i++; if ($i >= count($this->data)) { $out .= '<table class="icon_table" style="float: none">'; } else { $out .= '<table class="icon_table" style="float: left">'; } $out .= '<tr>'; $out .= '<td>'; $out .= '<img src="decoration/types/folder.png">'; $out .= '</td>'; $out .= '</tr>'; $out .= '<tr>'; $out .= '<td>'; $out .= substr($data['title'], 0, 32); $out .= '<br/>'; // add local action buttons if (is_array($this->local_action)) { //$out .= '<td>'; foreach ($this->local_action as $action) { require_once ROOT . '/class/url.class.php'; $url = new url(); // find the primary columns to pass to the url foreach ($this->column as $id => $column) { if ($column['primary']) { $url->setParam($id, $data[$id]); } } $url->setFilename($action['url']); $out .= '<a href="' . $url->render() . '">' . $action['title'] . '</a> '; } } $out .= '</td>'; $out .= '</tr>'; $out .= '</table>'; foreach ($this->column as $id => $column) { // $out.='<td>' . substr($data[$id], 0, 32) .'</td>'; } } } else { translate('empty_datagrid'); } // add local action buttons if (is_array($this->global_action)) { foreach ($this->global_action as $action) { require_once ROOT . '/class/url.class.php'; $url = new url(); $url->setFilename($action['url']); require_once ROOT . '/class/button.class.php'; $button = new button($action['title'], $url->render()); $out .= $button->render(); } } return $out; }
<?php require_once '../class/url.class.php'; require_once '../class/record.class.php'; require_once '../thinkedit.init.php'; $url = new url(); $url->setParam('id', 7); $url->setParam('action', 'move'); $url->setParam('locale', 'en'); $url->unSetParam('id'); echo '<pre>'; echo $url->render(); // try it with ./url.test.php?test_class=record&test_type=article&test_id=5 // and with url.test.php?test_class=record&test_type=article echo $url->getParam('test'); $record = new record('article'); $record->set('id', 5); $url->addObject($record, 'my_'); echo '<hr>'; echo $url->render(); $object = $url->getObject('test_'); $object->load(); echo '<hr>'; print_r($object);
$page->startPanel('test'); $page->add($module->view()); $page->endPanel('test'); $page->startPanel('title'); $page->add('<h1>Welcome to Thinkedit 3.0</h1>'); $page->endPanel('title'); $page->addSeparator(); $page->startPanel('help'); $page->add('Navigate using icons bellow, use "up" to go up in the hierarchy'); $page->endPanel('help'); $page->addSeparator(); $page->startPanel('breadcrumb'); $parent = $module->getParent(); if ($parent) { $parent_link = new url(); $parent_link->setParam('node', $parent->getNode()); $page->add('<a href="' . $parent_link->render() . '">Up</a> '); } else { $page->add('You are at the root of this site'); } $page->endPanel('breadcrumb'); $page->addSeparator(); $browser->addAction('delete', 'effacer'); $browser->setGlobalAction('browse'); $childs = $module->getChild(); if ($childs) { foreach ($childs as $child) { $browser->addFolder($child); } } $page->startPanel('browser');