PHP Classes

File: attachmanager_views_examples/_imageitem.php

Recommend this page to a friend!
  Classes of Insolita  >  Ext Imperavi  >  attachmanager_views_examples/_imageitem.php  >  Download  
File: attachmanager_views_examples/_imageitem.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Ext Imperavi
Integrates the Imperavi editor in YII applications
Author: By
Last change:
Date: 6 months ago
Size: 3,269 bytes
 

Contents

Class file image Download
<?php
/**
 * Created by PhpStorm.
 * User: Insolita
 * Date: 31.07.14
 * Time: 18:22
 *
 *
 * @var \yii\web\View $this
 * @var AttachModelExample $img
 */

$popover_content
   
= '
<div id="redactor_image_popover_'
. $img->id . '">
        <div>'
   
.
        \
yii\helpers\Html::a(
           
"???????",
           
'#',
            [
               
'data-redactor_imgdeleter' => $img->id,
               
'class' => 'btn btn-danger btn-sm',
               
'data-confirm' => '?? ??????? ??? ?????? ??? ????????'
           
]
        )

    . \
yii\helpers\Html::label("???????", "redactor_img_alt" . $img->id)
    . \
yii\helpers\Html::textInput("img_alt", $img->filetitle, ["id" => "redactor_img_alt" . $img->id])
    .
'</div> <div>'
   
.
        \
yii\helpers\Html::label("Css ?????", "redactor_img_css" . $img->id)
        . \
yii\helpers\Html::dropDownList(
           
"img_css",
           
'',
            [
'img-thumbnail'=>'img-thumbnail','img-rounded'=>'img-rounded','any_css_classes'=>'preset what you want'],
            [
"id" => "redactor_img_css" . $img->id]
        )
        .
'</div><div>'
   
. \yii\helpers\Html::label("??????", "redactor_imgsize" . $img->id)
    . \
yii\helpers\Html::dropDownList(
       
"img_size",
       
"thumb",
        [
'thumb' => "??????", 'mid' => "??????? ??????", 'big' => "??????? ??????", 'orig' => '???????????? ??????','othersize'=>'preset what you want'],
        [
"id" => "redactor_imgsize" . $img->id]
    )
    .
'</div><div>'
   
. \yii\helpers\Html::label("????????????", "redactor_imgalign" . $img->id)
    . \
yii\helpers\Html::dropDownList(
       
"img_align",
       
"",
        [
'no' => '???', 'left' => "?????", 'right' => "??????"],
        [
"id" => "redactor_imgalign" . $img->id]
    )
    .
'</div><div>'
   
. \yii\helpers\Html::label("?????????? ?? ?????", "redactor_ispreview" . $img->id)
    . \
yii\helpers\Html::checkbox("is_preview", false, ["id" => "redactor_ispreview" . $img->id])
    .
'</div><div>'

   
. \yii\helpers\Html::button(
       
"???????? html",
        [
'data-redactor_inshtml_img' => $img->id, 'class' => 'btn btn-info btn-sm']
    )
    . \
yii\helpers\Html::button(
       
"???????? bb-code",
        [
'data-redactor_insbb_img' => $img->id, 'class' => 'btn btn-info btn-sm']
    )
    .
'
        </div>
    </div>'
;
?>
<td>
    <?=
   
\yii\helpers\Html::a(
        \
yii\helpers\Html::img(
           
$img->getImageUrl('thumb'),
            [
'class' => 'img-thumbnail', 'id' => 'rimg_' . $img->id]
        ),
       
'javascript:void(0)',
        [
           
'data-redactor_listedimg' => $img->id,
           
'data-pjax' => 0,
           
'id' => 'aimg_' . $img->id,
           
'title' => $img->filetitle,
           
'data-content' => $popover_content
       
]
    );
?>


    <div id="redactor_images_data_<?= $img->id ?>" style="display: none"
         data-url_thumb="<?= $img->getImageUrl('thumb')?>"
         data-url_orig="<?= $img->getImageUrl('orig')?>"
         data-url_mid="<?= $img->getImageUrl('mid')?>"
         data-url_big="<?= $img->getImageUrl('big')?>"
        >
    </div>
</td>

For more information send a message to info at phpclasses dot org.