<?php

if (!$object || !$object->id) {
    return;
}
use_helper('Date', 'DmMedia');
echo _open('div.dm_media_file');
echo _tag('h3.title.none', $object->getFile());
echo _open('div.clearfix');
if ($object->isImage()) {
    $sf_response->addJavascript('lib.fancybox');
    $sf_response->addStylesheet('lib.fancybox');
    $sf_response->addJavascript('admin.fancyboxLaunch');
    echo _tag('div.view', _link($object->getFullWebPath())->text(_media($object)->size(250, 150))->set('.fancybox')->target('_blank'));
} else {
    echo _tag('div.view', _link($object->getFullWebPath())->text(_media('dmCore/images/media/unknown.png')->size(64, 64))->target('_blank'));
}
echo _tag('div.content', _tag('div.infos', definition_list(media_file_infos($object), '.clearfix.dm_little_dl')));
echo _close('div');
echo _close('div');
Exemple #2
0
$div = '<div id="test_id" class="test_class">div content</div>';
$t->is(£('div#test_id.test_class', 'div content'), $div, $div);
$div = '<div class="' . htmlentities('{"attr":"value"}') . '">div content</div>';
$t->is(£('div', array('json' => array('attr' => 'value')), 'div content'), $div, $div);
$div = '<div id="test_id" class="test_class ' . htmlentities('{"attr":"value"}') . '">div content</div>';
$t->is(£('div#test_id.test_class', array('json' => array('attr' => 'value')), 'div content'), $div, $div);
$div = '<div id="test_id" class="test_class ' . htmlentities('{"attrs":["value1","value2"]}') . '">div content</div>';
$t->is(£('div#test_id.test_class', array('json' => array('attrs' => array('value1', 'value2'))), 'div content'), $div, $div);
$a = '<a href="an_href#with_anchor" id="test_id" class="test_class">a content</a>';
$t->is(£('a#test_id.test_class href="an_href#with_anchor"', 'a content'), $a, $a);
$closeDiv = '</div>';
$t->is(£c('div'), $closeDiv, $closeDiv);
$dl = '<dl><dt>key</dt><dd>value</dd></dl>';
$t->is(definition_list(array('key' => 'value')), $dl, $dl);
$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>';
Exemple #3
0
<?php

if (!$object || $object->isNew()) {
    return;
}
use_helper('I18N', 'Date', 'DmAdminMedia');
echo _open('div.dm_media_file');
echo _tag('h3.title.none', $object->getFile());
echo _open('div.clearfix');
echo _tag('div.view', $object->isImage() ? _media($object)->size(200, 200) : media_file_image_tag($object));
echo _tag('div.content', _tag('div.infos', definition_list(array(__('Size') => dmOs::humanizeSize($object->getSize()), __('Type') => $object->getType(), __('Created at') => format_date($object->get('created_at'), 'f'), __('Updated at') => format_date($object->get('created_at'), 'f'), __('Url') => $object->getFullWebPath()), '.clearfix.dm_little_dl')));
echo _close('div');
echo _close('div');
Exemple #4
0
	<?php 
    foreach ($zones as $zone) {
        ?>
		<?php 
        if ($zone->getDirectRoomsCount($activity->getId(), RoomPeer::getActiveCriteria()) > 0) {
            ?>
			<h3><?php 
            echo $zone->getName();
            ?>
</h3>
			<ul class="blocklist">
				<?php 
            foreach ($zone->getDirectRooms($activity->getId(), RoomPeer::getActiveCriteria()) as $room) {
                ?>
					<?php 
                $features_array = $room->getValuedFeaturesArray();
                ?>

					<?php 
                echo block_item($room->getName(), array(color_square($activity->getColor()), definition_list(array(__('Capacity') => $room->getCapacity(), __('Address') => $room->getAddress())), definition_list($features_array), link_to(__('Select'), 'reservation/index?roomId=' . $room->getId())));
                ?>
				<?php 
            }
            ?>
			</ul>
		<?php 
        }
        ?>
	<?php 
    }
}
Exemple #5
0
<?php

$indices = array();
foreach ($engine->getIndices() as $name => $index) {
    $description = $index->describe();
    $indices[sprintf('%s', ucfirst(format_language($index->getCulture())))] = _tag('div.clearfix', _tag('span.fleft.s16.s16_file_text style=width:100px', $description['Documents'] . ' ' . __('Pages')) . _tag('span.fleft', $description['Size']));
}
echo definition_list($indices, '.dm_little_dl');
Exemple #6
0
<?php

use_helper('Date', 'DmMedia');
echo _open('div.dm_media_file');
echo _tag('h1.title.none', $file->file);
echo _open('div.clearfix');
echo _tag('div.view', _link('/' . $file->getWebPath())->text($file->isImage() ? _media($file)->size(300, 300) : media_file_image_tag($file))->target('blank')->set('.fancybox'));
echo _tag('div.content', _tag('div.infos', definition_list(array(__('Size') => dmOs::humanizeSize($file->size), __('Type') => $file->mime, __('Created at') => format_datetime($file->createdAt), __('Updated at') => format_datetime($file->updatedAt), __('Url') => $file->getFullWebPath()), '.clearfix') . _link($file->getFullWebPath())->text(__('Download'))->target('blank')->set('.block.s16.s16_download')) . get_partial('dmInterface/flash') . _tag('div.form', $form->render('.dm_form.list.little action=dmMediaLibrary/saveFile')) . _tag('div.actions.clearfix', _tag('a.close_dialog.button.fright', __('Close')) . _link('dmMediaLibrary/deleteFile?media_id=' . $file->id)->text(__('Delete'))->set('.button.red.dm_js_confirm.fleft')->title(__('Delete this file')) . (false && $file->isImage() ? _link('dmMediaLibrary/editImage?media_id=' . $file->id)->text(__('Edit image'))->set('.button.edit_image') : '')));
echo _close('div');
echo _close('div');
Exemple #7
0
use_helper('Date');
use_stylesheet('lib.ui-tabs');
use_javascript('lib.ui-tabs');
use_javascript('admin.sitemap');
echo _open('div.dm_sitemap.mt10');
echo sprintf('%s%s%s', sprintf('<form style="text-align: center" method="post" class="dm_sitemap_generate_form" action="%s">', _link('@dm_sitemap?action=generate')->getHref()), sprintf('<input type="submit" value="%s" />', __('Generate sitemap')), '</form>');
echo _open('div.dm_sitemap_tabs.mt10');
echo _open('ul');
foreach ($sitemap->getFiles() as $file) {
    echo _tag('li', _tag('a href=#dm_sitemap_' . dmString::slugify(basename($file)), basename($file)));
}
echo _close('ul');
foreach ($sitemap->getFiles() as $file) {
    echo _open('div#dm_sitemap_' . dmString::slugify(basename($file)));
    if (file_exists($file)) {
        echo _tag('div.clearfix.mb10', definition_list(array('Position' => _link($sitemap->getWebPath($file)), 'Urls' => $sitemap->countUrls($file), 'Size' => $sitemap->getFileSize($file), 'Updated at' => format_date($sitemap->getUpdatedAt($file))), '.clearfix.dm_little_dl.fleft.mr20'));
        echo _tag('pre', array('style' => 'background: #fff; padding: 10px; border: 1px solid #ddd; max-height: 350px; overflow-y: auto;'), htmlentities(file_get_contents($file), ENT_QUOTES, 'UTF-8'));
    } else {
        echo sprintf('<input type="submit" class="dm_sitemap_generate" value="%s" />', __('Generate sitemap'));
    }
    if (!is_writable($file)) {
        echo _tag('p.error', __('File %1% is not writable', array('%1%' => dmProject::unrootify($file))));
    }
    echo _close('div');
}
echo _close('div');
if (isset($phpCli)) {
    echo _open('div.dm_box.big.search_engine');
    echo _tag('h1.title', __('Set up a cron to update the sitemap'));
    echo _open('div.dm_box_inner.documentation');
    echo _tag('p', __('Most UNIX and GNU/Linux systems allows for task planning through a mechanism known as cron. The cron checks a configuration file (a crontab) for commands to run at a certain time.'));