예제 #1
0
 public function getSlotValue($slot)
 {
     sfLoader::loadHelpers(array('Asset', 'Url', 'Tag'));
     $params = sfYaml::load($slot->getValue());
     $res = '';
     if (isset($params['legend'])) {
         $res .= content_tag('p', $params['legend'], array('class' => 'image_legend'));
         $params['alt'] = $params['legend'];
         unset($params['legend']);
     }
     if (isset($params['url'])) {
         $url = $params['url'];
         unset($params['url']);
     }
     if (!isset($params['src'])) {
         return sprintf('<strong>Error</strong>: The value of slot %s in incorrect. The image has no source', $slot->getName());
     }
     $src = $params['src'];
     unset($params['src']);
     $res = image_tag($src, $params) . $res;
     if (isset($url)) {
         return link_to($res, $url);
     } else {
         return $res;
     }
 }
예제 #2
0
/**
 * Returns a image tag for sfImageHandler.
 *
 * @param string $filename
 * @param array  $options
 *
 * @return string  An image tag.
 */
function image_tag_sf_image($filename, $options = array())
{
    if (empty($options['alt'])) {
        $options['alt'] = '';
    }
    if (!$filename) {
        if (isset($options['no_image'])) {
            $filename = $options['no_image'];
            unset($options['no_image']);
        } else {
            $filename = 'no_image.gif';
        }
        return image_tag($filename, $options);
    }
    $filepath = sf_image_path($filename, $options);
    if (isset($options['size'])) {
        unset($options['size']);
    }
    if (isset($options['no_image'])) {
        unset($options['no_image']);
    }
    if (isset($options['f'])) {
        unset($options['f']);
    }
    if (isset($options['format'])) {
        unset($options['format']);
    }
    return image_tag($filepath, $options);
}
예제 #3
0
function link_to_star($object, $options = array())
{
    $user = sfContext::getInstance()->getUser();
    if ($user->isAuthenticated()) {
        $response = sfContext::getInstance()->getResponse();
        $has_jquery = sfConfig::get('app_sfPropelActAsStarredBehaviorPlugin_has_jquery');
        if (!$has_jquery) {
            $response->addJavascript('/sfPropelActAsStarredBehaviorPlugin/js/jquery-1.2.2.pack');
        }
        $response->addJavascript('/sfPropelActAsStarredBehaviorPlugin/js/sf_star');
        $is_starred = $object->isStarred() ? 'sf_star_on' : 'sf_star_off';
        $options = _parse_attributes($options);
        if (isset($options['class'])) {
            $options['class'] .= ' sf_star ' . $is_starred;
        } else {
            $options['class'] = 'sf_star ' . $is_starred;
        }
        $type = sfConfig::get('app_sfPropelActAsStarredBehaviorPlugin_content_type', null);
        if (!$type || $type == 'image') {
            $content = $object->isStarred() ? image_tag(sfConfig::get('app_sfPropelActAsStarredBehaviorPlugin_image_on', '/sfPropelActAsStarredBehaviorPlugin/images/star_on.gif')) : image_tag(sfConfig::get('app_sfPropelActAsStarredBehaviorPlugin_image_off', '/sfPropelActAsStarredBehaviorPlugin/images/star_off.gif'));
        } elseif (isset($options['txt_on']) && isset($options['txt_off'])) {
            $content = $object->isStarred() ? $options['txt_off'] : $options['txt_on'];
        } else {
            $content = $object->isStarred() ? sfConfig::get('app_sfPropelActAsStarredBehaviorPlugin_content_on') : sfConfig::get('app_sfPropelActAsStarredBehaviorPlugin_content_off');
        }
        $model = get_class($object);
        $id = $object->getPrimaryKey();
        return link_to($content, 'sfStar/starit?model=' . $model . '&id=' . $id, $options);
        // return content_tag('span',link_to($image,'sfStar/starit?model='.$model.'&id='.$id,'class=sf_star'));
    } else {
        return content_tag('span', '');
    }
}
예제 #4
0
/**
 * Get the navigation links for given sfDoctrinePager instance
 *
 * @param sfDoctrinePager $pager
 * @param string $uri  The uri to prefix to the links
 * @return string $html
 */
function get_sympal_pager_navigation($pager, $uri, $requestKey = 'page')
{
    sympal_use_stylesheet('/sfSympalPlugin/css/pager.css');
    $navigation = '<div class="sympal_pager_navigation">';
    if ($pager->haveToPaginate()) {
        $uri .= (preg_match('/\\?/', $uri) ? '&' : '?') . $requestKey . '=';
        // First and previous page
        if ($pager->getPage() != 1) {
            $navigation .= link_to(image_tag('/sf/sf_admin/images/first.png', 'align=absmiddle'), $uri . '1');
            $navigation .= link_to(image_tag('/sf/sf_admin/images/previous.png', 'align=absmiddle'), $uri . $pager->getPreviousPage()) . ' ';
        }
        // Pages one by one
        $links = array();
        foreach ($pager->getLinks() as $page) {
            $links[] = '<span>' . link_to_unless($page == $pager->getPage(), $page, $uri . $page) . '</span>';
        }
        $navigation .= join('  ', $links);
        // Next and last page
        if ($pager->getPage() != $pager->getLastPage()) {
            $navigation .= ' ' . link_to(image_tag('/sf/sf_admin/images/next.png', 'align=absmiddle'), $uri . $pager->getNextPage());
            $navigation .= link_to(image_tag('/sf/sf_admin/images/last.png', 'align=absmiddle'), $uri . $pager->getLastPage());
        }
    }
    $navigation .= '</div>';
    return $navigation;
}
/**
 * Returns an image link to use the lightbox function for 1 image.
 *
 * @param thumb_url          thumbnail url
 * @param image_url          full image url
 * @param image_link_options additional html attributes to add to image link (e.g.: array ('title' => 'My image'))
 * @param thumb_options      additional html attributes to add to thumb image tag (e.g.: array ('border' => 5))
 * 
 * @author Artur Rozek
 */
function light_image($thumb_url, $image_url, $image_link_options = array(), $thumb_options = array())
{
    //make lightbox effect
    $thumb_tag = image_tag($thumb_url, $thumb_options);
    $image_link_options['class'] = isset($image_link_options['class']) ? $image_link_options['class'] . " lightbox" : 'lightbox';
    echo link_to($thumb_tag, $image_url, $image_link_options);
}
 public function sortIcon($sort_dir, $popup)
 {
     if ($sort_dir != 'desc') {
         $sort_dir = 'asc';
     }
     return link_to(image_tag("/lyMediaManagerPlugin/images/sort-{$sort_dir}", "alt={$sort_dir}"), '@ly_media_asset_icons?&dir=' . ($sort_dir == 'desc' ? 'asc' : 'desc') . ($popup ? '&popup=1' : ''), array('title' => 'Switch sort direction'));
 }
예제 #7
0
function image_cache_tag($route, $format, $path, $image, $alt = null)
{
    $_formats = sfConfig::get('imagecache_formats');
    $_format = $_formats[$format];
    if (!isset($_format)) {
        throw new RuntimeException('Format not found');
    }
    $real_file_path = sfConfig::get('sf_upload_dir') . '/' . $path . '/' . $image;
    if (file_exists($real_file_path)) {
        $cache_file_path = sfConfig::get('sf_upload_dir') . '/cache/' . $format . '/' . $path . '/' . $image;
        $is_cached_file = file_exists($cache_file_path);
        $options = array('path' => $format . '/' . $path . '/' . $image);
        $url = urldecode(url_for($route, $options));
        if ($is_cached_file) {
            $cached_image = new sfImage($cache_file_path);
            $width = $cached_image->getWidth();
            $height = $cached_image->getHeight();
            return image_tag($url, array('size' => $width . 'x' . $height, 'alt' => $alt));
        } else {
            return image_tag($url, array('alt' => $alt));
        }
    } else {
        return '';
    }
}
function print_celula_tabela_consolidado($mes, $ano, $statusConta, $listaContas)
{
    ?>
  <?php 
    $loteContas = Conta::getLoteFromListaContas($statusConta, $ano, $mes, $listaContas);
    ?>
  <div class="overlay">
	  <div><?php 
    print_valor(Conta::getTotalFromLote($loteContas));
    ?>
</div>
	  <a rel="#overlay" href="<?php 
    echo url_for('financeiro/addConta?ano=' . $ano->getAno() . '&mes=' . $mes . '&statusConta=' . $statusConta->getSlug());
    ?>
"><?php 
    echo image_tag("add-conta.png");
    ?>
</a>
	  <?php 
    if (count($loteContas) > 0) {
        ?>
	   <a rel="#overlay" href="<?php 
        echo url_for('financeiro/listaContas?ano=' . $ano->getAno() . '&mes=' . $mes . '&statusConta=' . $statusConta->getSlug());
        ?>
"><?php 
        echo image_tag("list-conta.png", array('width' => 32, 'heigth' => 32));
        ?>
</a>
	  <?php 
    }
    ?>
  </div> 
<?php 
}
예제 #9
0
function cryptographp_reload()
{
    $reload_img = sfConfig::get('app_cryptographp_reloadimg', '/sfCryptographpPlugin/images/reload');
    //$ret = "<a style=\"cursor:pointer\" onclick=\"javascript:document.getElementById('cryptogram').src='".url_for('cryptographp/index?id=')."/'+Math.round(Math.random(0)*1000)+1\">".image_tag('/sfCryptographpPlugin/images/reload')."</a>";
    $ret = "<a style=\"cursor:pointer\" onclick=\"javascript:document.getElementById('cryptogram').src='" . url_for('cryptographp/index?id=') . "/'+Math.round(Math.random(0)*1000)+1\">" . image_tag($reload_img) . "</a>";
    return $ret;
}
예제 #10
0
function a_remote_dialog_toggle($options)
{
    if (!isset($options['id'])) {
        throw new sfException("Required id option not passed to a_dialog_toggle");
    }
    if (!isset($options['label'])) {
        throw new sfException("Required label option not passed to a_dialog_toggle");
    }
    if (!isset($options['action'])) {
        throw new sfException("Required action option not passed to a_dialog_toggle");
    }
    $id = $options['id'];
    $action = $options['action'];
    $label = $options['label'];
    if (isset($options['chadFrom'])) {
        $chadFrom = $options['chadFrom'];
    }
    if (isset($options['loading'])) {
        $loading = $options['loading'];
    }
    if (isset($options['hideToggle']) && $options['hideToggle'] == true) {
        $before = " \$('.{$id}-loading').show();";
    } else {
        $before = "\$('.{$id}-button.open').hide(); \$('.{$id}-loading').show();";
    }
    $s = '';
    $s .= jq_link_to_remote(__($label, null, 'apostrophe'), array("url" => $action, "update" => $id, "script" => true, "before" => $before, "complete" => "\$('#{$id}').fadeIn();\n  \t\t\t\t\t\t\t\t\t \$('.{$id}-loading').hide();\n\t\t\t\t\t\t\t\t\t\t \t\$('.{$id}-button.open').hide();\n  \t\t\t\t\t\t\t\t\t \$('#{$id}-button-close').show();" . (isset($chadFrom) ? "var arrowPosition = parseInt(\$('{$chadFrom}').offset().left);\n      \t\t\t\t\t\t\t\t \$('#{$id} .a-chad').css('left',arrowPosition+'px'); " : "") . "\n  \t\t\t\t\t\t\t\t\t aUI('#{$id}');\n  \t\t\t\t\t\t\t\t\t\$('.a-page-overlay').show();"), array('class' => "{$id}-button open", 'id' => "{$id}-button-open"));
    $s .= jq_link_to_function(__($label, null, 'apostrophe'), "\$('#{$id}-button-close').hide(); \n\t\t \$('#{$id}-button-open').show(); \n\t\t \$('#{$id}').hide();\n\t\t \$('.a-page-overlay').hide();", array('class' => "{$id}-button close", 'id' => "{$id}-button-close", 'style' => 'display:none;'));
    if (isset($loading)) {
        $s .= image_tag($loading, array('class' => "{$id}-loading", 'style' => 'display:none;'));
    }
    return $s;
}
 function test_image_tag()
 {
     $this->assertEqual('<img src="mocked_stylesheet_directory/assets/images/source.png" alt="Source"/>', image_tag("source.png"));
     $this->assertEqual('<img src="/source.png" alt="Source"/>', image_tag("/source.png"));
     $this->assertEqual('<img src="http://welaika.com/source.png" alt="Source"/>', image_tag("http://welaika.com/source.png"));
     $this->assertEqual('<img src="http://welaika.com/source.png" alt="test" class="image"/>', image_tag("http://welaika.com/source.png", array("alt" => "test", "class" => "image")));
 }
예제 #12
0
 public function render()
 {
     $result = '';
     $page = DbFinder::from('W3sPage')->with('W3sTemplate', 'W3sProject')->leftJoin('W3sGroup')->leftJoin('W3sTemplate')->leftJoin('W3sProject')->findPK($this->idPage);
     $slots = W3sSlotPeer::getTemplateSlots($page->getW3sGroup()->getTemplateId());
     $i = 0;
     foreach ($slots as $slot) {
         $idSlot = $slot->getId();
         $class = $i / 2 == intval($i / 2) ? "w3s_white_row" : "w3s_blue_row";
         switch ($slot->getRepeatedContents()) {
             case 0:
                 $repeatedColor = 'green';
                 $repeatedAlt = __('This contents is not repeated through pages');
                 break;
             case 1:
                 $repeatedColor = 'orange';
                 $repeatedAlt = __('This contents is repeated at group level');
                 break;
             case 2:
                 $repeatedColor = 'blue';
                 $repeatedAlt = __('This contents is repeated at site level');
                 break;
         }
         $result .= sprintf($this->rowSkeleton, $this->idLanguage . $idSlot, $class, $idSlot, link_to_function($slot->getSlotName(), 'W3sControlPanel.showRepeatedContentsForm(' . $idSlot . ');', 'onmouseover="W3sControlPanel.highlightSlot(\'' . $slot->getSlotName() . '\', ' . $slot->getRepeatedContents() . ')"'), image_tag(sfConfig::get('app_w3s_web_skin_images_dir') . '/control_panel/button_slot_' . $repeatedColor . '.jpg', 'title=' . $repeatedAlt . ' size=14x14'));
         $i++;
     }
     return sprintf('<div id="w3s_slot_list">%s</div>', $result);
 }
 public function testImageTag()
 {
     $this->assertDomEqual(image_tag('stato.png'), '<img alt="Stato" src="/images/stato.png" />');
     $this->assertDomEqual(image_tag('stato.png', array('size' => '80x30')), '<img alt="Stato" src="/images/stato.png" width="80" height="30" />');
     $this->assertDomEqual(image_tag('stato.png', array('alt' => 'Stato framework')), '<img alt="Stato framework" src="/images/stato.png" />');
     $this->assertDomEqual(image_tag('http://statoproject.com/images/stato.png'), '<img alt="Stato" src="http://statoproject.com/images/stato.png" />');
 }
function input_asset_tag($name, $value, $options = array())
{
    use_helper('Javascript', 'I18N');
    $type = 'all';
    if (isset($options['images_only'])) {
        $type = 'image';
        unset($options['images_only']);
    }
    $form_name = 'this.previousSibling.previousSibling.form.name';
    if (isset($options['form_name'])) {
        $form_name = '\'' . $options['form_name'] . '\'';
        unset($options['form_name']);
    }
    $html = '';
    if (is_file(sfConfig::get('sf_web_dir') . $value)) {
        $ext = substr($value, strpos($value, '.') - strlen($value) + 1);
        if (in_array($ext, array('png', 'jpg', 'gif'))) {
            $image_path = $value;
        } else {
            if (!is_file(sfConfig::get('sf_plugins_dir') . '/sfMediaLibraryPlugin/web/images/' . $ext . '.png')) {
                $ext = 'unknown';
            }
            $image_path = '/sfMediaLibraryPlugin/images/' . $ext;
        }
        $html .= link_to_function(image_tag($image_path, array('alt' => 'File', 'height' => '64')), "window.open('{$value}')");
        $html .= '<br />';
    }
    $html .= input_tag($name, $value, $options);
    $html .= '&nbsp;' . image_tag('/sfMediaLibraryPlugin/images/folder_open', array('alt' => __('Insert Image'), 'style' => 'cursor: pointer; vertical-align: middle', 'onclick' => 'sfMediaLibrary.openWindow({ form_name: ' . $form_name . ', field_name: \'' . $name . '\', type: \'' . $type . '\', scrollbars: \'yes\' })'));
    $html .= init_media_library();
    return $html;
}
예제 #15
0
/**
 * UI function to build an image icon with hover tooltip text.
 * Used in the config module initially.
 *
 * @param $tooltipText
 * @param string $image
 * @return string
 */
function config_explanation($tooltipText, $image = 'icon_info.png')
{
    return sprintf('<span class="config_explanation" style="position: relative;">
                %s
                <span class="tooltip from-above leftie">%s</span>
            </span>', image_tag($image, array('style' => 'margin: 0 5px; vertical-align: middle; cursor: pointer;')), $tooltipText);
}
예제 #16
0
 public function render($name, $value = null, $attributes = array(), $errors = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Tag', 'Asset'));
     $attrs = array_merge($this->attributes, $attributes);
     $loader_html = image_tag($this->getOption('ajax_loader_url'), array('alt' => "ajax_loader", 'style' => $this->getOption('ajax_loader_css'), 'id' => $this->generateAjaxLoaderId($name, $value)));
     return str_replace(array("%widget%", "%add_button%", "%refresh_button%", "%ajax_loader%"), array($this->getOption('widget')->render($name, $value, $attrs, $errors), $this->renderAddButton($name, $value), $this->renderRefreshButton($name, $value), $loader_html), $this->getDecoratorFormat());
 }
예제 #17
0
function gravatar_for($email, $s = 80, $d = 'mm', $r = 'g', $atts = array())
{
    $url = 'http://www.gravatar.com/avatar/';
    $url .= md5(strtolower(trim($email)));
    $url .= "?s={$s}&d={$d}&r={$r}";
    return image_tag($url, array('height' => $s, 'width' => $s, 'class' => 'rt-avatar'));
}
예제 #18
0
function show_georef_map($lon, $lat, $layer)
{
    $lang = sfContext::getInstance()->getUser()->getCulture();
    if (empty($layer)) {
        $layer = sfContext::getInstance()->getModuleName();
    }
    $html = '<div class="section" id="georef_container" style="display:none;">';
    $html .= '<div id="map" style="height:400px;width:100%">';
    $html .= '<div id="mapLoading">' . image_tag(sfConfig::get('app_static_url') . '/static/images/indicator.gif');
    $html .= __('Map is loading...') . '</div>';
    $html .= '</div>';
    $html .= '</div>';
    $async_map = sfConfig::get('app_async_map', false) && !sfContext::getInstance()->getRequest()->getParameter('debug', false);
    $js = "\n        C2C.map_init = function() {\n            Ext.get('georef_container').show();\n            var lon = Ext.getDom('lon') && Ext.getDom('lon').value || 0;\n            var lat = Ext.getDom('lat') && Ext.getDom('lat').value || 0;\n            c2corg.Map({\n                div: 'map',\n                lang: '{$lang}',\n                loading: 'mapLoading',\n                layers: ['{$layer}'],\n                connected: true,\n                georef: {\n                    initialState: {\n                        lon: lon,\n                        lat: lat,\n                        zoom: 15\n                    },\n                    callback: function(lonlat) {\n                        if (lonlat) {\n                            Ext.getDom('lon').value = Math.round(lonlat.lon*1E6)/1E6;\n                            Ext.getDom('lat').value = Math.round(lonlat.lat*1E6)/1E6;\n                        } else {\n                            Ext.getDom('lon').value = '';\n                            Ext.getDom('lat').value = '';\n                        }\n                        c2corg.coords.update_degminsec('lon');\n                        c2corg.coords.update_degminsec('lat');\n                    }\n                }\n            });\n        };";
    // asynchronous map loading
    if ($async_map) {
        use_helper('MyMinify');
        $c2c_script_url = minify_get_combined_files_url(array('/static/js/carto/build/carto.min.js', "/static/js/carto/build/lang-{$lang}.min.js", '/static/js/popup.js', '/static/js/carto/embedded.js'), (bool) sfConfig::get('app_minify_debug'));
        $js .= "C2C.async_map_init = function() {\n          \$.ajax({\n            url: '{$c2c_script_url}',\n            dataType: 'script',\n            cache: true\n          }).done(function() {\n            C2C.map_init();\n            Ext.EventManager.fireDocReady();\n          });\n        };";
    }
    // if coordinates not set, open automatically open the map
    if (!$lon && !$lat && !in_array($layer, array('sites', 'users', 'images', 'portals'))) {
        if ($async_map) {
            $js .= "C2C.async_map_init()";
        } else {
            $js .= "\$(window).load(C2C.map_init)";
        }
    }
    $html .= javascript_queue($js);
    return $html;
}
 public function render($name, $value = null, $attributes = array(), $errors = array())
 {
     $html = parent::render($name, $value, $attributes, $errors);
     $html .= "&nbsp;<span class='round_color'>&nbsp;</span>&nbsp;";
     $html .= image_tag('ColorPickerUIBtnWheel.png', array('class' => 'color_pckr'));
     $html .= "\n    <script type=\"text/javascript\">\n      \$(document).ready(function () { \n        \$('.round_color').css('backgroundColor','" . $value . "');      \n        \$('.color_pckr').qtip({\n          show: { delay: 0, event: 'click'},\n          hide: { event: 'click' },\n          style: {  \n            name: 'light',\n            title: { padding: '3px'},\n            width: { min: '215px', max: '215px'}\n          },         \n          content: {\n            title: { button: true, text: '&nbsp;' },\n            text: '<div id=\"colorpicker\"></div>',\n          },\n          events: {\n            show: function () {\n              \$('#colorpicker').farbtastic(function(color){\n                \$('#" . $this->generateId($name) . "').val(color);\n                \$('.round_color').css('backgroundColor', color);    \n              });\n            }\n          } \n       });       \n       \$('#" . $this->generateId($name) . "').keyup(function(){\n         \$.farbtastic('#colorpicker').setColor(\$(this).val());\n         \$('.round_color').css('backgroundColor', color);        \n       });\n       \$('#" . $this->generateId($name) . "').attr('value', '" . ($value ? $value : '#ededee') . "');\n     });\n   </script>\n    ";
     return $html;
 }
예제 #20
0
function display_picture($filename, $size = 'big', $target_size = null, $title = 'Click to display original image')
{
    $image_url = image_url($filename, $size);
    $target_image_url = image_url($filename, $target_size, true);
    $absolute_url = absolute_link($target_image_url, true);
    $image_options = empty($title) ? null : array('title' => $title, 'alt' => $title);
    return '<figure class="picture"><a title="' . __($title) . '" href="' . $absolute_url . '" itemprop="contentUrl">' . image_tag($image_url, $image_options) . '</a></figure><div class="picture_right"></div>';
}
예제 #21
0
파일: appHelper.php 프로젝트: noikiy/qdpm
function renderUserPhoto($img)
{
    if (strlen($img) > 0) {
        return image_tag('/uploads/users/' . $img, array('style' => 'width: 50px;', 'absolute' => true));
    } else {
        return image_tag('no_photo.png', array('absolute' => true));
    }
}
예제 #22
0
function op_bbs_image_icon($bbs)
{
    $html = '';
    if ($bbs->has_images) {
        $html = ' ' . image_tag('icon_camera.gif', array('alt' => 'photo'));
    }
    return $html;
}
예제 #23
0
 /**
  * 絵文字IDを画像表示用タグにして返す
  *
  * @param string $emoji_code_id 絵文字ID
  * @return string 画像表示用タグ
  */
 function get_emoji4emoji_code_id($emoji_code_id)
 {
     $carrier_id = $emoji_code_id[0];
     $emoji_code_id = str_replace(':', '', $emoji_code_id);
     $emoji_id = substr($emoji_code_id, 1);
     $emoji_name = $this->value_list[$carrier_id][$emoji_id];
     sfContext::getInstance()->getConfiguration()->loadHelpers('Asset');
     return image_tag('emoji/' . $carrier_id . '/' . $emoji_code_id . $this->emoji_image_extension, array('alt' => $emoji_name));
 }
예제 #24
0
function op_mtviewer_diary_link($diary, $width = 36)
{
    $title = _op_mtviewer_entry_str($diary, $width);
    $html = link_to($title, '@mtviewer_diary?id=' . $diary->id);
    if ($diary->has_images) {
        $html .= ' ' . image_tag('icon_camera.gif', array('alt' => 'photo'));
    }
    return $html;
}
예제 #25
0
function captcha_reload_button()
{
    //$reload_img = sfConfig::get('sf_web_dir'.'/sfCryptoCaptchaPlugin/images/reload.png', '/sfCryptoCaptchaPlugin/images/reload.png');
    $reload_img = '/images/reload.png';
    $refresh_url = url_for('sfCryptoCaptcha/captcha');
    $onclick = 'javascript:document.getElementById(\'captcha_img\').src=\'' . $refresh_url . '/\'+Math.round(Math.random(0)*1000)+1';
    $ret = '<a style="cursor:pointer" onclick="' . $onclick . '">' . image_tag($reload_img) . '</a>';
    return $ret;
}
예제 #26
0
 public function delete_button($id, $projects_id = 0, $confirm = false)
 {
     if ($this->access['delete']) {
         if (!$confirm) {
             $confirm = __('Are you sure?');
         }
         return link_to(image_tag(public_path('images/icons/delete.png', true), array('title' => __('Delete'), 'class' => 'iconDelete')), $this->module . '/delete?id=' . $id . $this->add_projects_id($projects_id) . $this->add_url_params('&'), array('method' => 'delete', 'class' => 'actionIcon', 'confirm' => $confirm));
     }
 }
예제 #27
0
function photo_thumbnail_tag($entity, $entity_id, $options = array())
{
    if (!is_array($options)) {
        $options = array();
    }
    if (photo_has_gallery($entity, $entity_id)) {
        return image_tag('/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/' . sfPhotoGalleryPeer::getFirst($entity, $entity_id), $options);
    }
    return image_tag('nopicture.jpg', $options);
}
예제 #28
0
function file_download_tag($entity, $entity_id, $options = array())
{
    if (!is_array($options)) {
        $options = array();
    }
    if (photo_has_gallery($entity, $entity_id)) {
        return image_tag('/' . sfConfig::get('sf_upload_dir_name') . '/files/' . sfFileGalleryPeer::getFirst($entity, $entity_id), $options);
    }
    //return "no files";
}
예제 #29
0
 public function getBlogCode()
 {
     sfApplicationConfiguration::getActive()->loadHelpers(array('Tag', 'I18N'));
     if (!$this->getText() && $this->Attributes->count()) {
         $pic = $this->Attributes[0];
         return "<a href='" . url_for('post/show?id=' . $this->getId(), 'absolute=true') . "'>" . image_tag($pic->getValue(), array('absolute' => true)) . "</a>";
     } else {
         return "<a href='" . url_for('post/show?id=' . $this->getId(), 'absolute=true') . "'>" . __('ссылка на пост') . "</a>";
     }
 }
 protected function configure($options = array(), $attributes = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Asset', 'Tag', 'I18N'));
     parent::configure($options, $attributes);
     $this->addOption('class_select', 'ancho');
     $this->addOption('label_unassociated', __('Unassociated'));
     $this->addOption('label_associated', __('Associated'));
     $this->addOption('associate', image_tag('/sfFormExtraPlugin/images/next.png'));
     $this->addOption('unassociate', image_tag('/sfFormExtraPlugin/images/previous.png'));
 }