Esempio n. 1
0
function £table($opt = null)
{
    return _table($opt);
}
Esempio n. 2
0
$t->is($templateHelper->£('div', array('json' => array('attr' => 'value')), 'div content'), _tag('div', array('json' => array('attr' => 'value')), 'div content'), $div);
$t->is(£('div', array('json' => array('attr' => 'value')), 'div content'), _tag('div', array('json' => array('attr' => 'value')), 'div content'), $div);
$a = '<a href="an_href#with_anchor" id="test_id" class="test_class">a content</a>';
$t->is($templateHelper->£('a#test_id.test_class href="an_href#with_anchor"', 'a content'), _tag('a#test_id.test_class href="an_href#with_anchor"', 'a content'), $a);
$t->is(£('a#test_id.test_class href="an_href#with_anchor"', 'a content'), _tag('a#test_id.test_class href="an_href#with_anchor"', 'a content'), $a);
$closeDiv = '</div>';
$t->is(£c('div'), _tagC('div'), $closeDiv);
$div = '<div title="title with a # inside" id="test_id" class="test_class other_class"></div>';
$t->is($templateHelper->£('div#test_id.test_class.other_class title="title with a # inside"'), _tag('div#test_id.test_class.other_class title="title with a # inside"'), $div);
$t->is(£('div#test_id.test_class.other_class title="title with a # inside"'), _tag('div#test_id.test_class.other_class title="title with a # inside"'), $div);
$div = '<div title="title with a #inside" id="test_id" class="test_class other_class"></div>';
$t->is($templateHelper->£('div#test_id.test_class.other_class title="title with a #inside"'), _tag('div#test_id.test_class.other_class title="title with a #inside"'), $div);
$t->is(£('div#test_id.test_class.other_class title="title with a #inside"'), _tag('div#test_id.test_class.other_class title="title with a #inside"'), $div);
$div = '<div title="title with a #inside" class="test_class other_class"></div>';
$t->is($templateHelper->£('div.test_class.other_class title="title with a #inside"'), _tag('div.test_class.other_class title="title with a #inside"'), $div);
$t->is(£('div.test_class.other_class title="title with a #inside"'), _tag('div.test_class.other_class title="title with a #inside"'), $div);
$div = '<div title="title with a .inside" class="test_class other_class"></div>';
$t->is($templateHelper->£('div.test_class.other_class title="title with a .inside"'), _tag('div.test_class.other_class title="title with a .inside"'), $div);
$t->is(£('div.test_class.other_class title="title with a .inside"'), _tag('div.test_class.other_class title="title with a .inside"'), $div);
$div = '<div lang="c1"></div>';
$t->is($templateHelper->£('div lang=c1'), _tag('div lang=c1'), $div);
$t->is(£('div lang=c1'), _tag('div lang=c1'), $div);
$div = '<div></div>';
$t->is(£('div lang=' . $helper->get('user')->getCulture()), $div, $div);
$table = '<table><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead></table>';
$t->is(£table()->head('Header 1', 'Header 2')->render(), _table()->head('Header 1', 'Header 2')->render(), $table);
$t->is($templateHelper->£table()->head('Header 1', 'Header 2')->render(), _table()->head('Header 1', 'Header 2')->render(), $table);
$table = '<table><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr class="even"><td>Value 1</td><td>Value 2</td></tr><tr class="odd"><td>Value 3</td><td>Value 4</td></tr></tbody></table>';
$t->is($templateHelper->£table()->head('Header 1', 'Header 2')->body('Value 1', 'Value 2')->body('Value 3', 'Value 4')->render(), _table()->head('Header 1', 'Header 2')->body('Value 1', 'Value 2')->body('Value 3', 'Value 4')->render(), $table);
$t->is(£table()->head('Header 1', 'Header 2')->body('Value 1', 'Value 2')->body('Value 3', 'Value 4')->render(), _table()->head('Header 1', 'Header 2')->body('Value 1', 'Value 2')->body('Value 3', 'Value 4')->render(), $table);
Esempio n. 3
0
$dl = '<dl class="test_class other_class"><dt>key</dt><dd>value</dd></dl>';
$t->is(definition_list(array('key' => 'value'), '.test_class.other_class'), $dl, $dl);
$div = '<div title="title with a # inside" id="test_id" class="test_class other_class"></div>';
$t->is(£('div#test_id.test_class.other_class title="title with a # inside"'), $div, $div);
$div = '<div title="title with a #inside" id="test_id" class="test_class other_class"></div>';
$t->is(£('div#test_id.test_class.other_class title="title with a #inside"'), $div, $div);
$div = '<div title="title with a #inside" class="test_class other_class"></div>';
$t->is(£('div.test_class.other_class title="title with a #inside"'), $div, $div);
$div = '<div title="title with a .inside" class="test_class other_class"></div>';
$t->is(£('div.test_class.other_class title="title with a .inside"'), $div, $div);
$div = '<div lang="c1"></div>';
$t->is(£('div lang=c1'), $div, $div);
$div = '<div></div>';
$t->is(£('div lang=' . $helper->get('user')->getCulture()), $div, $div);
$table = '<table><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead></table>';
$t->is(_table()->head('Header 1', 'Header 2')->render(), $table, $table);
$table = '<table><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr><td>Value 1</td><td>Value 2</td></tr><tr><td>Value 3</td><td>Value 4</td></tr></tbody></table>';
$t->is(£table()->head('Header 1', 'Header 2')->body('Value 1', 'Value 2')->body('Value 3', 'Value 4')->render(), $table, $table);
$table = '<table><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead><tbody><tr class="even"><td>Value 1</td><td>Value 2</td></tr><tr class="odd"><td>Value 3</td><td>Value 4</td></tr></tbody></table>';
$t->is(£table()->useStrip(true)->head('Header 1', 'Header 2')->body('Value 1', 'Value 2')->body('Value 3', 'Value 4')->render(), $table, $table);
$ctrlFullPath = dmOs::join(sfConfig::get('sf_web_dir'), 'dmCorePlugin/js/dmCoreCtrl.js');
$t->is($helper->get('helper')->getJavascriptFullPath('core.ctrl'), $ctrlFullPath, 'core ctrl is in ' . $ctrlFullPath);
$t->comment('Test use_beaf');
$helper->get('helper')->setOption('use_beaf', true);
$expected = '<div class="beafh clearfix"><div class="beafore"></div><div class="beafin">test</div><div class="beafter"></div></div>';
$t->is($helper->get('helper')->tag('div.beafh', 'test'), $expected, $expected);
$expected = '<div class="beafv clearfix"><div class="beafore"></div><div class="beafin">test</div><div class="beafter"></div></div>';
$t->is($helper->get('helper')->tag('div.beafv', 'test'), $expected, $expected);
$expected = '<div class="beafh myclass clearfix"><div class="beafore"></div><div class="beafin">test</div><div class="beafter"></div></div>';
$t->is($helper->get('helper')->tag('div.beafh.myclass', 'test'), $expected, $expected);
$expected = '<div class="beafv myclass clearfix"><div class="beafore"></div><div class="beafin">test</div><div class="beafter"></div></div>';
Esempio n. 4
0
<?php

use_javascript('lib.dataTable');
use_stylesheet('ui-lightness/jquery-ui-1.8rc3.custom');
use_stylesheet('dataTable');
// Plugin : List
// Vars : $pluginPager
$table = _table('.data_table')->head(__('Plugin'), __('Status'), __('Users'), __('Author'), __('Created'));
foreach ($pluginPager as $plugin) {
    $table->body(_tag('h2.t_plugin', _link($plugin)) . _tag('p', $plugin->resume), _media($plugin->isDone ? 'check.png' : 'gear.png')->alt($plugin->isDone ? 'Ready' : 'Work in progress'), $plugin->count_usages, $plugin->CreatedBy->username, date('Y/m/d', strtotime($plugin->createdAt)));
}
echo $table;
Esempio n. 5
0
<?php

// Vars: $artistPager
use_helper('Text');
use_javascript('lib.dataTable');
use_stylesheet('smoothness/jquery-ui-1.8.6.custom');
use_stylesheet('dataTable');
$table = _table('.data_table')->head(__('Photo'), __('Name'), __('Biography'));
foreach ($artistPager as $artist) {
    $table->body(_media($artist->getPhoto())->size(100)->method('scale'), _link($artist), truncate_text($artist->getBiography(), 200));
}
echo $table;
Esempio n. 6
0
<?php

use_javascript('lib.dataTable');
use_stylesheet('smoothness/jquery-ui-1.8.6.custom');
use_stylesheet('dataTable');
// Beca : List
// Vars: $becaPager
$table = _table('.data_table')->head(__('Año'), __('Artista'), __('Obra'));
foreach ($becaPager as $beca) {
    $table->body($beca->year, _link($beca->getArtist()), $beca->work);
}
echo $table;
Esempio n. 7
0
<?php

// Vars: $order
if (!$order) {
    echo _tag('p', 'Неверный параметр');
    echo _tag('p', _link('@homepage')->text('&laquo; вернуться на главную'));
} else {
    echo _table();
    echo _open('ul');
    echo _close('ul');
}
Esempio n. 8
0
<!-- Область основного контента -->
<form action=''>
	<label>Количество колонок: </label><br />
	<input name='cols' type='text' value="" /><br />
	<label>Количество строк: </label><br />
	<input name='rows' type='text' value="" /><br />
	<label>Цвет: </label><br />
	<input name='color' type='text' value="" /><br /><br />
	<input type='submit' value='Создать' />
</form>
<!-- Таблица -->
<?php 
include_once 'functions.inc.php';
_table();
_table(10, 10, 'green');
_table(100, 10, 'yellow');
?>
<!-- Таблица -->
<!-- Область основного контента -->
Esempio n. 9
0
use_javascript('lib.ui-tabs');
use_stylesheet('lib.ui-tabs');
use_javascript('admin.history');
use_stylesheet('admin.history');
use_stylesheet('admin.dataTable');
echo _open('div.dm_history.mt10');
echo _open('ul.version_tabs');
foreach ($revisions as $revision) {
    echo _tag('li.version_tab', _tag('a href=#revision_' . $revision->version, $revision->version));
}
echo _close('ul');
$model = get_class($record);
$revisionModel = get_class($revision);
$fields = array_diff($revisions[0]->getTable()->getFieldNames(), array('id', 'version', 'lang'));
$recordDiff = $sf_context->get('record_text_diff');
$table = _table();
$table->head(__('Field'), __('Difference'), __('Value'));
$nbRevisions = count($revisions);
foreach ($revisions as $index => $revision) {
    $recordDiff->compare(dmArray::get($revisions, $index + 1, new $revisionModel()), $revision);
    $diffs = $recordDiff->getHtmlDiffs($fields);
    $values = $recordDiff->getHtmlValues($fields);
    echo _open('div.revision.dm_data#revision_' . $revision->version);
    echo _open('div.revision_header');
    echo _link($record)->text(__('Back to %1%', array('%1%' => $record->__toString())))->set('.s16.s16_arrow_left.back_to_record');
    if ($index !== 0) {
        echo _link('+/dmAdminGenerator/revert')->textTitle(__('Revert to revision %1%', array('%1%' => $revision->version)))->set('.dm_medium_button.dm_js_confirm.revert_to_revision')->params(array('model' => $model, 'pk' => $record->getPrimaryKey(), 'version' => $revision->version));
    }
    echo _tag('p.revision_title', __('Revision %number%', array('%number%' => $revision->version)) . (isset($values['updated_by']) ? ' - ' . $values['updated_by'] : '') . (isset($values['updated_at']) ? ' - ' . format_date($values['updated_at'], 'f') : ''));
    echo _close('div');
    $table->clearBody();
Esempio n. 10
0
<?php

use_stylesheet('admin.dataTable');
use_helper('Date');
$mail = $dmSentMail;
echo _tag('div.dm_data', _table()->useStrip(true)->body('From', $mail->from_email)->body('To', $mail->to_email)->body('CC', $mail->cc_email)->body('BCC', $mail->bcc_email)->body('Sender', $mail->sender_email)->body('Reply to', $mail->reply_to_email)->body('Date', format_date($mail->created_at, 'f'))->body('Language', format_language($mail->culture))->body('Template', _link($mail->Template))->body('Strategy', $mail->strategy)->body('Transport', $mail->transport));