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


PHP _media函数代码示例

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


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

示例1: media_file_image_tag

function media_file_image_tag(DmMedia $file, $options = array()) {
  $options = array_merge(array(
              'width' => $file->isImage() ? 128 : 64,
              'height' => $file->isImage() ? 98 : 64
          ), dmString::toArray($options, true));

  if ($file->isImage()) {
    $image = _media($file);
  } else {
    if (file_exists(
            dmOs::join(
                    sfConfig::get('sf_web_dir')
                    .
                    '/dmCorePlugin/images/media/'
                    .
                    dmOs::getFileExtension($file->getFile(), false)
                    . '.png'
            )
    )) {
      $image = _media('/dmCorePlugin/images/media/' . dmOs::getFileExtension($file->getFile(), false) . '.png');
    } else {
      $image = _media('/dmCorePlugin/images/media/unknown.png');
    }
  }

  return $image->size($options['width'], $options['height']);
}
开发者ID:jaimesuez,项目名称:diem,代码行数:27,代码来源:DmMediaHelper.php

示例2: media_file_image_tag

function media_file_image_tag($file, $options = array())
{
    $options = array_merge(array('width' => $file->isImage() ? 128 : 64, 'height' => $file->isImage() ? 98 : 64), dmString::toArray($options, true));
    if ($file->isImage()) {
        $image = _media($file)->size($options['width'], $options['height']);
    } else {
        $image = _media('dmCore/images/media/unknown.png')->size($options['width'], $options['height']);
    }
    return $image;
}
开发者ID:jdart,项目名称:diem,代码行数:10,代码来源:DmMediaHelper.php

示例3: _open

<?php

// Vars: $product
echo _open('div.one_good');
echo _link(_media($product->Photo)->getSrc())->set('.og_photo.zoomPic')->text(_media($product->Photo)->size('220') . _media('/i/lupe.png')->alt('увеличить')->set('.lupe'));
echo _open('div.og_text');
echo _tag('h3', $product->name);
echo _tag('p', $product->body);
echo _open('div.price');
if ($product->hide_price) {
} else {
    echo _link('+/product/add_to_cart?id=' . $product->id)->set('.add_to_cart')->text('Добавить в корзину') . round($product->price) . ' руб.';
}
echo _close('div');
/*echo _tag('div.price',
    _link('+/product/add_to_cart?id='.$product->id)
    ->set('.add_to_cart')->text('Добавить в корзину') .
  ($product->hide_price ? 'цена договорная' : round($product->price).' руб.') );
  */
echo _close('div');
// og_text
echo _close('div');
// one_good
?>
<script>
$(document).ready(function() {

	/* This is basic - uses default settings */

	$("a.zoomPic").fancybox();
})
开发者ID:rafix,项目名称:dmshop,代码行数:31,代码来源:_show.php

示例4: _open

<?php

// Vars: $productPager
echo $productPager->renderNavigationTop();
echo _open('div.catalog');
foreach ($productPager as $product) {
    if ($product->is_in_action) {
        echo _open('div.product');
        echo _tag('div.title', _link($product));
        echo _tag('div.picture', _link($product)->text(_media($product->Photo)->size(80, 80)));
        echo _tag('div.description', $product->description);
        echo _tag('div.price', 'old price: ' . _tag('strike', round($product->price)));
        echo _tag('div.price', 'new price: ' . _tag('span.new_price', round($product->price_action)));
        echo _link('+/product/add_to_cart?id=' . $product->id)->text('add to cart');
    } else {
        echo _open('div.product');
        echo _tag('div.title', _link($product));
        echo _tag('div.picture', _link($product)->text(_media($product->Photo)->size(80, 80)));
        echo _tag('div.description', $product->description);
        echo _tag('div.price', 'price: ' . _tag('span.new_price', round($product->price_action)));
        echo _link('+/product/add_to_cart?id=' . $product->id)->text('add to cart');
    }
    echo _close('div');
    // cat_good
}
echo _close('div');
// catalog
echo $productPager->renderNavigationBottom();
开发者ID:rafix,项目名称:dmshop,代码行数:28,代码来源:_listByCategory.php

示例5: _tag

echo _tag('span.descriptor', 'Pa&iacutes: ' . _tag('span.recurso_list', $patente->pais));
echo _close('p');
echo _open('p');
echo _tag('span.descriptor', 'Instituci&oacuten: ' . _tag('span.recurso_list', $patente->institucion));
echo _close('p');
echo _open('p');
echo _tag('span.descriptor', 'No. de publicaci&oacuten: ' . _tag('span.recurso_list', $patente->num_internacional));
echo _close('p');
echo _open('p');
echo _tag('span.descriptor', 'Idioma: ' . _tag('span.recurso_list', $patente->idioma));
echo _close('p');
echo _open('p');
if ($patente->formato_duro) {
    if ($patente->prestado) {
        $records = dmDb::query('SolicitudPrestamo s')->where('s.dm_user_id = ?', sfContext::getInstance()->getUser()->getUserId())->andwhere('s.recurso_id = ?', $patente->id)->fetchRecords();
        $cont = 0;
        foreach ($records as $record) {
            $cont++;
        }
        if ($cont >= 1) {
            echo _tag('span.descriptor', 'Disponible: ' . _tag('span.recurso_list', 'No ' . _tag('span.recurso_list.aviso', 'Usted ser&aacute avisado cuando este recurso est&eacute disponible')));
        } else {
            echo _tag('span.descriptor', 'Disponible: No. ' . _link('+/SolicitudPrestamo/solicitar')->text('Avisarme cuando est&eacute disponible'));
        }
    } else {
        echo _tag('span.descriptor', 'Disponible: ' . _tag('span.recurso_list', 'S&iacute'));
    }
} else {
    echo _link($patente->Slide)->title('Descargar patente')->set('.image_descargar')->text(_media('download.png')->alt('Descargar patente'));
}
echo _close('div');
开发者ID:rafix,项目名称:bibliocnic,代码行数:31,代码来源:_show.php

示例6: _media

function £media($source)
{
    return _media($source);
}
开发者ID:runopencode,项目名称:diem-extended,代码行数:4,代码来源:DmHelper.php

示例7: use_helper

<?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;
开发者ID:rafix,项目名称:ctaller,代码行数:12,代码来源:_list.php

示例8: _open

echo _open('p');
echo _tag('span.descriptor', 'Palabras claves: ' . _tag('span.recurso_list', $presentacion->palabras_claves));
echo _close('p');
echo _open('p');
echo _tag('span.descriptor', 'A&ntildeo de publicaci&oacuten: ' . _tag('span.recurso_list', $presentacion->anno));
echo _close('p');
echo _open('p');
echo _tag('span.descriptor', 'No. de diapositivas: ' . _tag('span.recurso_list', $presentacion->num_diapositivas));
echo _close('p');
echo _tag('span.descriptor', 'Idioma: ' . _tag('span.recurso_list', $presentacion->idioma));
echo _close('p');
echo _open('p');
if ($presentacion->formato_duro) {
    if ($presentacion->prestado) {
        $records = dmDb::query('SolicitudPrestamo s')->where('s.dm_user_id = ?', sfContext::getInstance()->getUser()->getUserId())->andwhere('s.recurso_id = ?', $presentacion->id)->fetchRecords();
        $cont = 0;
        foreach ($records as $record) {
            $cont++;
        }
        if ($cont >= 1) {
            echo _tag('span.descriptor', 'Disponible: ' . _tag('span.recurso_list', 'No ' . _tag('span.recurso_list.aviso', 'Usted ser&aacute avisado cuando este recurso est&eacute disponible')));
        } else {
            echo _tag('span.descriptor', 'Disponible: No. ' . _link('+/SolicitudPrestamo/solicitar')->text('Avisarme cuando est&eacute disponible'));
        }
    } else {
        echo _tag('span.descriptor', 'Disponible: ' . _tag('span.recurso_list', 'S&iacute'));
    }
} else {
    echo _link($presentacion->Slide)->title('Descargar presentacion')->set('.image_descargar')->text(_media('download.png')->alt('Descargar presentacion'));
}
echo _close('div');
开发者ID:rafix,项目名称:bibliocnic,代码行数:31,代码来源:_show.php

示例9: _tag

echo _tag('h2.title', __('Menu'));
echo _tag('div.control_wrap.dm_box_inner', _tag('div.control', $controlMenu->render()));
echo _close('div');
// right
echo _open('div.center');
echo _open('ul.content.clearfix');
if ($folder->isRoot()) {
    echo _tag('li.parent_folder', _tag('a.root', _media('dmAdmin/images/media/up2.png')->size(64, 64)));
} else {
    echo _tag('li.parent_folder', _link($sf_context->getRouting()->getMediaUrl($folder->getNode()->getParent()))->text(_media('dmAdmin/images/media/up.png')->size(64, 64)->alt(__('Back to the parent folder'))));
}
if ($children = $folder->getNode()->getChildren()) {
    $arrChildren = array();
    foreach ($children as $f) {
        $arrChildren[$f->getName()] = $f;
    }
    ksort($arrChildren);
    foreach ($arrChildren as $f) {
        echo _tag('li.folder', _link($sf_context->getRouting()->getMediaUrl($f))->text(($f->isWritable() ? _media('dmAdmin/images/media/folder.png')->size(64, 64) : _media('dmAdmin/images/media/folder-locked.png')) . _tag('span.name', media_wrap_text($f->getName())) . _tag('span.more', format_number_choice('[0]no element|[1]1 element|(1,+Inf]%1% elements', array('%1%' => $f->getNbElements()), $f->getNbElements()))));
    }
}
foreach ($files as $f) {
    echo _tag('li.file.media_id_' . $f->getId(), $f->isImage() && $f->checkFileExists() ? _link($sf_context->getRouting()->getMediaUrl($f))->text(_tag('span.image_background', array('style' => sprintf('background: url("%s") top left no-repeat', _media($f)->size(128, 128)->quality(80)->getSrc())), _tag('span.name', media_wrap_text(dmString::truncate($f->getFile(), 40))))) : _link($sf_context->getRouting()->getMediaUrl($f))->text(media_file_image_tag($f) . _tag('span.name', media_wrap_text(dmString::truncate($f->getFile(), 40)))));
}
echo _close('ul');
echo _close('div');
// center
echo _close('div');
// list
echo _close('div');
echo _close('div');
开发者ID:theolymp,项目名称:diem,代码行数:31,代码来源:pathSuccess.php

示例10: _tag

<?php

if (!$record->exists()) {
    echo _tag('p.help_box', _tag('span.s16.s16_help.block', __('Save this %1% to access to the gallery', array('%1%' => dmString::lcfirst(__($record->getDmModule()->getName()))))));
    return;
}
$link = _link('+/dmMedia/gallery?model=' . get_class($record) . '&pk=' . $record->getPrimaryKey());
echo _open('div.dm_gallery_medium.clearfix');
$sf_response->addJavascript('lib.fancybox');
$sf_response->addStylesheet('lib.fancybox');
$sf_response->addJavascript('admin.fancyboxLaunch');
foreach ($record->getDmGallery() as $media) {
    echo _link($media->getFullWebPath())->text(_media($media)->size(120, 120)->set('.media'))->target('_blank')->set('.fancybox rel=fancyboxGallery');
}
echo $link->text(_tag('span.s16.s16_add.block', __('Edit medias')))->set('.dm_gallery_link.dm_medium_button');
echo _close('div');
开发者ID:runopencode,项目名称:diem-extended,代码行数:16,代码来源:_galleryMedium.php

示例11: use_javascript

<?php

use_javascript('lib.ui-sortable');
use_stylesheet('admin.gallery');
use_javascript('lib.ui-sortable');
use_javascript('admin.gallery');
echo _open('div.dm_gallery_big', array('json' => $galleryOptions));
echo $addByIdForm->open('action=dmMedia/addToGalleryById') . $addByIdForm['media_id']->field() . $addByIdForm['model']->field() . $addByIdForm['pk']->field() . $addByIdForm->close();
echo _tag('div.dm_gallery_actions.clearfix', _link($record)->set('.s16.s16_arrow_left.back') . _tag('a.open_form.dm_big_button', _tag('span.s16.s16_add', __('Add'))));
echo $form->render('.dm_add_media.dm_form.list.little.ui-corner-all' . ($form->isBound() ? '' : '.none') . ' action="+/dmMedia/gallery?model=' . get_class($record) . '&pk=' . $record->getPrimaryKey() . '"');
echo _tag('div.help_box', __('Drag & drop a media here'));
echo _open('ul.list.clearfix');
foreach ($medias as $media) {
    try {
        $mediaHtml = _media($media)->size(160, 160);
    } catch (dmException $e) {
        $mediaHtml = _media('/dmCorePlugin/images/media/unknown.png')->size(160, 140) . $media->file;
    }
    echo _tag('li#dm_sort_' . $media->get('dm_gallery_rel_id') . '.element', $mediaHtml . _link('+/dmMedia/galleryDelete?model=' . get_class($record) . '&pk=' . $record->getPrimaryKey() . '&rel_id=' . $media->get('dm_gallery_rel_id'))->text(_tag('span.s16block.s16_delete'))->title(__('Remove this media'))->set('.delete.dm_js_confirm') . _link($sf_context->getRouting()->getMediaUrl($media))->text(_tag('span.s16block.s16_edit'))->title(__('Edit this media'))->set('.edit'));
}
echo _close('ul');
echo _close('div');
开发者ID:theolymp,项目名称:diem,代码行数:22,代码来源:gallerySuccess.php

示例12: use_helper

<?php

use_helper('Date');
echo _open('div.clearfix');
echo _media($artist->Photo)->size(200, 200)->set('.image')->method('scale');
echo _tag('h3.personal_data', $artist);
echo _tag('br');
echo _tag('p.artist_infos', _tag('span', format_date($artist->dob, 'D')));
echo _tag('h4.cv', __('Biography'));
echo markdown($artist->biography);
echo _close('div');
开发者ID:rafix,项目名称:ctaller,代码行数:11,代码来源:_biography.php

示例13: use_helper

<?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');
echo _tag('div.view', _link($object->getFullWebPath())->text($object->isImage() ? _media($object)->size(250, 150) : _media('dmCore/images/media/unknown.png')->size(64, 64)));
echo _tag('div.content', _tag('div.infos', definition_list(media_file_infos($object), '.clearfix.dm_little_dl')));
echo _close('div');
echo _close('div');
开发者ID:theolymp,项目名称:diem,代码行数:13,代码来源:_viewBig.php

示例14: _open

<?php

/*
 * Action for Site using Diem : List
 * Vars : $sitePager
 */
echo _open('div.site.list');
echo $sitePager->renderNavigationTop();
echo _open('ul.elements.clearfix');
$it = 1;
foreach ($sitePager as $site) {
    echo _open('li.element.clickable');
    echo _tag('h2.t_medium', $site->name);
    echo _tag('div.content.clearfix', ($site->Media ? _link($site->url)->text(_media($site->Media)->alt($site->Media->legend ? $site->Media->legend : $site->name)->width(200)) : '') . markdown($site->text) . _tag('p.version', 'Diem ' . _tag('strong', $site->diemVersion)));
    echo _close('li');
    if (++$it % 2) {
        echo _tag('li.clearboth');
    }
}
echo _close('ul');
echo $sitePager->renderNavigationBottom();
echo _close('div');
开发者ID:Regmaya,项目名称:diem-project,代码行数:22,代码来源:_list.php

示例15: _media

<?php

echo _media('logo.png')->set('#logo_image.logo.big')->alt('Casa taller Pedro Pablo Oliva')->width(350);
//echo _tag('h1.t_site', _link('@homepage')->text('Casa Taller'));
echo _tag('h2.t_site', _link('@homepage')->text('Casa Taller Pedro Pablo Oliva'));
//echo _tag('p.t_baseline', __('Pedro Pablo Oliva'));
开发者ID:rafix,项目名称:ctaller,代码行数:6,代码来源:_header.php


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