icon() public static method

Generates an icon.
public static icon ( string $icon, array $htmlOptions = [], string $tagName = 'span' ) : string
$icon string the icon type.
$htmlOptions array additional HTML attributes.
$tagName string the icon HTML tag.
return string the generated icon.
コード例 #1
0
    /**
     * Renders the input file field
     */
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        echo CHtml::openTag('div', $this->htmlOptions);
        echo CHtml::openTag('div', array('class' => 'input-prepend bfh-timepicker-toggle', 'data-toggle' => 'bfh-timepicker'));
        echo CHtml::tag('span', array('class' => 'add-on'), TbHtml::icon(TbHtml::ICON_TIME));
        if ($this->hasModel()) {
            echo CHtml::activeTextField($this->model, $this->attribute, $this->inputOptions);
        } else {
            echo CHtml::textField($name, $this->value, $this->inputOptions);
        }
        echo CHtml::closeTag('div');
        echo '<div class="bfh-timepicker-popover">
				<table class="table">
				<tbody>
					<tr>
						<td class="hour">
						<a class="next" href="#"><i class="icon-chevron-up"></i></a><br>
						<input type="text" class="input-mini" readonly><br>
						<a class="previous" href="#"><i class="icon-chevron-down"></i></a>
						</td>
						<td class="separator">:</td>
						<td class="minute">
						<a class="next" href="#"><i class="icon-chevron-up"></i></a><br>
						<input type="text" class="input-mini" readonly><br>
						<a class="previous" href="#"><i class="icon-chevron-down"></i></a>
						</td>
					</tr>
				</tbody>
				</table>
			</div>';
        echo CHtml::closeTag('div');
    }
コード例 #2
0
 /**
  * Generates a nicely formatted help block, useful to explain what a form or 
  * a page does. Nothing is rendered if the "showHelpBlocks" setting is set 
  * to false.
  * @param string $content the block content
  * @return string the HTML for the help block
  */
 public static function helpBlock($content)
 {
     if (!Setting::getBoolean('showHelpBlocks')) {
         return;
     }
     $output = CHtml::openTag('p', array('class' => 'form-help'));
     $output .= TbHtml::icon(TbHtml::ICON_EXCLAMATION_SIGN);
     $output .= $content;
     $output .= CHtml::closeTag('p');
     return $output;
 }
コード例 #3
0
 /**
  * Runs the widget
  */
 public function run()
 {
     // Don't render links for spectators
     if (Yii::app()->user->role === User::ROLE_SPECTATOR) {
         return;
     }
     if (!$this->checkLinks()) {
         echo CHtml::tag('p', array('class' => 'missing-video-file'), TbHtml::icon(TBHtml::ICON_WARNING_SIGN) . Yii::t('RetrieveMediaWidget', 'The file(s) for this item is not available'));
         return;
     }
     $this->renderForm();
 }
コード例 #4
0
 /**
  * Renders the data cell content.
  * @param integer $row the row number (zero-based).
  * @param mixed $data the data associated with the row.
  */
 protected function renderDataCellContent($row, $data)
 {
     /* @var $am CAuthManager|AuthBehavior */
     $am = Yii::app()->getAuthManager();
     if ($am->hasParent($this->itemName, $data['name'])) {
         echo TbHtml::linkButton(TbHtml::icon(TbHtml::ICON_REMOVE), array('color' => TbHtml::BUTTON_COLOR_LINK, 'size' => TbHtml::BUTTON_SIZE_MINI, 'url' => array('removeParent', 'itemName' => $this->itemName, 'parentName' => $data['name']), 'rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'Remove')));
     } else {
         if ($am->hasChild($this->itemName, $data['name'])) {
             echo TbHtml::linkButton(TbHtml::icon(TbHtml::ICON_REMOVE), array('color' => TbHtml::BUTTON_COLOR_LINK, 'size' => TbHtml::BUTTON_SIZE_MINI, 'url' => array('removeChild', 'itemName' => $this->itemName, 'childName' => $data['name']), 'rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'Remove')));
         }
     }
 }
コード例 #5
0
 /**
  * {@inheritDoc}
  * @see CGridColumn::getDataCellContent()
  */
 public function getDataCellContent($row)
 {
     $data = $this->grid->dataProvider->data[$row];
     if (is_bool($this->value)) {
         $value = $this->value;
     } elseif (is_string($this->value)) {
         $value = (bool) $this->evaluateExpression($this->value, array('data' => $data, 'row' => $row));
     } else {
         $value = is_scalar($data) && (bool) $data;
     }
     if ($value) {
         return CHtml::tag('span', array('style' => 'color:green;'), TbHtml::icon('ok'));
     } else {
         return CHtml::tag('span', array('style' => 'color:red;'), TbHtml::icon('remove'));
     }
 }
コード例 #6
0
ファイル: TbBreadcrumb.php プロジェクト: ShuiMuQinHua/yiishop
 /**
  * Runs the widget.
  */
 public function run()
 {
     // todo: consider adding control property for displaying breadcrumbs even when empty.
     if (!empty($this->links)) {
         $links = array();
         if ($this->homeLabel !== false) {
             $label = $this->homeLabel !== null ? $this->homeLabel : TbHtml::icon('home');
             $links[$label] = $this->homeUrl !== null ? $this->homeUrl : Yii::app()->homeUrl;
         }
         foreach ($this->links as $label => $url) {
             if (is_string($label) || is_array($url)) {
                 if ($this->encodeLabel) {
                     $label = CHtml::encode($label);
                 }
                 $links[$label] = $url;
             } else {
                 $links[] = $this->encodeLabel ? CHtml::encode($url) : $url;
             }
         }
         echo TbHtml::breadcrumbs($links, $this->htmlOptions);
     }
 }
コード例 #7
0
    /**
     * Renders the input file field
     */
    public function renderField()
    {
        list($name, $id) = $this->resolveNameID();
        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);
        echo CHtml::openTag('div', $this->htmlOptions);
        echo CHtml::openTag('div', array('class' => 'input-prepend bfh-datepicker-toggle', 'data-toggle' => 'bfh-datepicker'));
        echo CHtml::tag('span', array('class' => 'add-on'), TbHtml::icon(TbHtml::ICON_CALENDAR));
        if ($this->hasModel()) {
            echo CHtml::activeTextField($this->model, $this->attribute, $this->inputOptions);
        } else {
            echo CHtml::textField($name, $this->value, $this->inputOptions);
        }
        echo CHtml::closeTag('div');
        echo '<div class="bfh-datepicker-calendar">
				<table class="calendar table table-bordered">
					<thead>
						<tr class="months-header">
							<th class="month" colspan="4">
							<a class="previous" href="#"><i class="icon-chevron-left"></i></a>
							<span></span>
							<a class="next" href="#"><i class="icon-chevron-right"></i></a>
						</th>
						<th class="year" colspan="3">
							<a class="previous" href="#"><i class="icon-chevron-left"></i></a>
							<span></span>
							<a class="next" href="#"><i class="icon-chevron-right"></i></a>
						</th>
						</tr>
						<tr class="days-header">
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
			</div>';
        echo CHtml::closeTag('div');
    }
コード例 #8
0
 /**
  * Renders a link button.
  * @param string $id the ID of the button
  * @param array $button the button configuration which may contain 'label', 'url', 'imageUrl' and 'options' elements.
  * @param integer $row the row number (zero-based)
  * @param mixed $data the data object associated with the row
  */
 protected function renderButton($id, $button, $row, $data)
 {
     if (isset($button['visible']) && !$this->evaluateExpression($button['visible'], array('row' => $row, 'data' => $data))) {
         return;
     }
     $url = TbArray::popValue('url', $button);
     if ($url !== '#') {
         $url = $this->evaluateExpression($url, array('data' => $data, 'row' => $row));
     }
     $imageUrl = TbArray::popValue('imageUrl', $button, false);
     $label = TbArray::popValue('label', $button, $id);
     $options = TbArray::popValue('options', $button, array());
     TbArray::defaultValue('title', $label, $options);
     TbArray::defaultValue('rel', 'tooltip', $options);
     if ($icon = TbArray::popValue('icon', $button, false)) {
         echo CHtml::link(TbHtml::icon($icon), $url, $options);
     } else {
         if ($imageUrl && is_string($imageUrl)) {
             echo CHtml::link(CHtml::image($imageUrl, $label), $url, $options);
         } else {
             echo CHtml::link($label, $url, $options);
         }
     }
 }
コード例 #9
0
ファイル: _list.php プロジェクト: vorobeyme/portal
:</strong><br />
                <?php 
    echo implode(', ', array_values(CHtml::listData($data->positions, 'id', 'name')));
    ?>
            <?php 
}
?>
            </td>
            <td style="text-align: right;">
                <?php 
echo CHtml::link(TbHtml::icon(TbHtml::ICON_EYE_OPEN), array("profiles/view", 'id' => $data->id));
if (Yii::app()->user->checkAccess(User::ROLE_MANAGER) || Yii::app()->user->checkAccess(User::ROLE_VOLONT) && $data->recruiter_id == Yii::app()->user->id) {
    echo " | " . CHtml::link(TbHtml::icon(TbHtml::ICON_EDIT), array("profiles/update", 'id' => $data->id));
}
if (Yii::app()->user->checkAccess(User::ROLE_MANAGER)) {
    echo " | " . CHtml::link(TbHtml::icon(TbHtml::ICON_REMOVE), "#", array('submit' => array('profiles/delete', 'id' => $data->id), 'confirm' => 'Ви впевнені, що хочете видалити цей запис?'));
}
?>
                <div class="to_export">
                <?php 
echo CHtml::label('Експорт анкети', 'export_' . $data->id);
echo CHtml::checkBox('toExport[]', in_array($data->id, $this->toExport), array('value' => $data->id, 'class' => 'toExport', 'id' => 'export_' . $data->id));
?>
                </div>
            </td>
        </tr>
        <tr class="additional <?php 
echo $index % 2 ? 'odd' : 'even';
?>
">
            <td colspan="2">
コード例 #10
0
 /**
  * Renders the data cell content.
  * This method renders the view, update and toggle buttons in the data cell.
  * @param integer $row the row number (zero-based)
  * @param mixed $data the data associated with the row
  */
 protected function renderDataCellContent($row, $data)
 {
     $checked = CHtml::value($data, $this->name);
     $toggleOptions = $this->toggleOptions;
     $toggleOptions['icon'] = $checked === null ? $this->emptyIcon : ($checked ? $this->checkedIcon : $this->uncheckedIcon);
     $toggleOptions['url'] = isset($toggleOptions['url']) ? $this->evaluateExpression($toggleOptions['url'], array('data' => $data, 'row' => $row)) : '#';
     if (!$this->displayText) {
         $htmlOptions = TbArray::getValue('htmlOptions', $this->toggleOptions, array());
         $htmlOptions['title'] = $this->getButtonLabel($checked);
         $htmlOptions['rel'] = 'tooltip';
         echo CHtml::link(TbHtml::icon($toggleOptions['icon']), $toggleOptions['url'], $htmlOptions);
     } else {
         echo TbHtml::button($this->getButtonLabel($checked), $toggleOptions);
     }
 }
コード例 #11
0
        'allowClear' => true,
        'placeholder' => 'Buscar',
        'onclick' => 'js:{var codigocarga=this.value;'
        . 'procesa(codigocarga);'
        . '$("#cargapractica").val("").trigger("change");'
        . '}',
    ),
));

}
echo "</div>";
?>
<div style="clear: both;margin-top:15px;"></div>
<?php
// grilla form practicas 
$i = 0;
$columnas =6;
$filas = 4;
for ($f = 1; $f <= $filas; $f++) {
    echo "<div class='control-group centrado'>";
    for ($col = 1; $col <= $columnas; $col++) {
        echo TbHtml::badge(str_pad($i + 1, 2, "0", STR_PAD_LEFT), array('color' => TbHtml::BADGE_COLOR_WARNING, 'style' => 'margin-left:10px;'));
        echo Tbhtml::textField("codigocarga[$i]", $codigocarga[$i], array("style" => 'width:50px;', 'disabled' => true, 'class' => $i . ' ' . 'practicas', 'rel' => $i));
      if ($accion=='carga'){  echo $form->hiddenField($models_practicas[$i], "[$i]idpractica");}
        echo TbHtml::icon(TbHtml::ICON_REMOVE, array('rel' => $i));
        $i++;
    }
    echo "</div>";
}
echo "</div>";
コード例 #12
0
ファイル: index.php プロジェクト: asopin/portal
<?php

/**
 * @var $dataProvider CDataProvider
 * @var $this VacanciesController
 */
$this->menu = array(array('label' => Yii::t('main', 'vacancy.create.link'), 'url' => array('create_vacancy')));
$this->widget('bootstrap.widgets.TbGridView', ['dataProvider' => $dataProvider, 'filter' => null, 'columns' => ['id', 'name', ['class' => CDataColumn::class, 'value' => function (Vacancy $object) {
    return $object->user->first_name . " " . $object->user->phone;
}, 'header' => Yii::t('main', 'vacancy.label.user')], 'city.city_name', 'close_time:date', ['class' => CDataColumn::class, 'value' => function (Vacancy $vacancy) {
    return VacancyHelper::statusName($vacancy);
}, 'header' => Yii::t('main', 'vacancy.label.status')], ['class' => CDataColumn::class, 'value' => function (Vacancy $object) {
    return CHtml::link(TbHtml::icon(TbHtml::ICON_EDIT), ["update_vacancy", 'id' => $object->id]);
}, 'type' => 'raw']]]);
コード例 #13
0
ファイル: admin.php プロジェクト: Tebro/xbmc-video-server
<?php

/* @var $this BackendController */
/* @var $model Backend */
$this->pageTitle = $title = Yii::t('Backend', 'Manage backends');
?>

<h2><?php 
echo $title;
?>
</h2>

<?php 
echo FormHelper::helpBlock(Yii::t('Backend', 'This is where you configure your backends. A 
	backend is an instance of XBMC that the application connects to and serves 
	library contents from. If you specify more than one backend, a new item 
	will appear in the main menu, allowing you to easily switch backends.'));
?>

<?php 
echo TbHtml::linkButton(Yii::t('Backend', 'Create new backend'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'url' => array('create')));
?>

<hr />

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('type' => TbHtml::GRID_TYPE_STRIPED, 'dataProvider' => Backend::model()->dataProvider, 'enableSorting' => false, 'template' => '{items}', 'columns' => array('name', 'hostname', 'port', 'tcp_port', array('name' => 'default', 'header' => Yii::t('Backend', 'Default'), 'type' => 'raw', 'value' => function ($data) {
    return $data->default ? TbHtml::icon(TbHtml::ICON_OK) : '';
}), 'macAddress', 'subnetMask', array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{update} {delete}'))));
コード例 #14
0
//     echo TbHtml::labelTb('Seleccionar Prácticas', array('color' => TbHtml::LABEL_COLOR_WARNING, 'style' => 'margin:20px 0 20px ;font-size:13px;padding:5px;'));
   
     
     echo TbHtml::checkBox('marcatodas', '', array(
    'label' => TbHtml::labelTb('Seleccionar todas las  Prácticas', array('color' => TbHtml::LABEL_COLOR_INFO, 'style' => 'font-size:13px;padding:7px;margin-left: -17px;',)),
    'style'=>'float:right;margin-right:427px',
     )); 
     echo TbHtml::button('Borrar Selección', array('color' => TbHtml::BUTTON_COLOR_DANGER,
      'onclick'=>'js:$("#marcatodas").prop("checked",false);$("#rango").empty();',
      'style'=>'float:right;',
      )); 
    
    echo TbHtml::labelTb("Selecccionar rango de Prácticas",array('color' => TbHtml::LABEL_COLOR_INFO, 'style' => 'font-size:13px;padding:7px;margin: 36px 11px 0 2px ;'));
 
     
     echo TbHtml::ajaxLink(TbHtml::icon(TbHtml::ICON_PLUS), 
            // $url 
          array('Practica/Selectrango'),
             
          // array $ajaxoptions   
           array(   
                'data' => 'js:($("select#idnomenclador").val()) &&($(".tipopract:checked").serialize()+ "&idnomenclador=" + $("select#idnomenclador").val())',
                'type' => 'GET',
                'dataType' => 'html',
            //                     'data' => 'js:"nomenclador=" + $("select#idnomenclador option:selected").text()',
                'url' => CController::createUrl('Practica/selectrango'), //url to call.
            //                    'update' => "#rango",   
                'success' => 'js:function(data){$("#rango").append(data)}'
                    )
       );    
  ?>
コード例 #15
0
ファイル: basics.php プロジェクト: crisu83/yiistrap-docs
?>
 <small>ICON_WRENCH</small></li>
        <li><?php 
echo TbHtml::icon(TbHtml::ICON_TASKS);
?>
 <small>ICON_TASKS</small></li>
        <li><?php 
echo TbHtml::icon(TbHtml::ICON_FILTER);
?>
 <small>ICON_FILTER</small></li>
        <li><?php 
echo TbHtml::icon(TbHtml::ICON_BRIEFCASE);
?>
 <small>ICON_BRIEFCASE</small></li>
        <li><?php 
echo TbHtml::icon(TbHtml::ICON_FULLSCREEN);
?>
 <small>ICON_FULLSCREEN</small></li>
    </ul>

    <hr class="bs-docs-separator">

    <h2>How to use</h2>

    <pre class="prettyprint linenums">
&lt;?php echo TbHtml::icon(TbHtml::ICON_GLASS); ?></pre>

    <hr class="bs-docs-separator">

    <h2>Icon examples</h2>
コード例 #16
0
ファイル: EssaysHasCrugeUser.php プロジェクト: argenis1763/vc
 public function getButtonEssay($idEssay)
 {
     /*return  TbHtml::submitButton('Essay',array(
           'submit'=>array('write','id'=>$idEssay),
           'color'=>TbHtml::BUTTON_COLOR_PRIMARY,
           'size'=>TbHtml::BUTTON_SIZE_MINI,
       ));*/
     return CHtml::link(TbHtml::icon(TbHtml::ICON_EYE_OPEN), array('write', 'id' => $idEssay));
 }
コード例 #17
0
ファイル: viewdetalle.php プロジェクト: juankie/gestcb9git
<?php 
 echo TbHtml::labelTb('Detalle Práctica', array('color' => TbHtml::LABEL_COLOR_WARNING, 'style' => 'margin-left:-2px;font-size:13px;padding:5px;'));
 
 // dos formas de poner boton de cierre
// echo TbHtml::closeButton(TbHtml::CLOSE_TEXT,$htmlOptions=array('onclick'=>'js: $( this ).parent("div").hide()')); 
echo TbHtml::icon(TbHtml:: ICON_REMOVE_CIRCLE,$htmlOptions=array('style'=>'float:right;' ,'onclick'=>'js: $( this ).parent("div").hide()'));
$this->widget('zii.widgets.CDetailView', array(
'data' => $model,
'attributes' => array(
//        'idpractica',
        'codigo',
        'nombre',
        'estadistica',
        array(
            'name' => 'asitioweb',
            'type' => 'boolean'
        ),
        array(
            'name' => 'idpractipo',
            'value' => $model->idpractipo0->nombre,
        ),
        array(
            'name' => 'idnomenclador',
            'value' => $model->idnomenclador0->nombre,
        ),
)));?>
コード例 #18
0
 /**
  * {@inheritDoc}
  * @see PluggableController::beforeAction()
  */
 public function beforeAction($action)
 {
     $this->submenu = array(array('label' => TbHtml::icon('plus') . '&nbsp;&nbsp;' . Yii::t('access.controller', 'Module Acceptation'), 'url' => array('/' . $this->module->id . '/accept/index'), 'htmlOptions' => array('class' => $this->id === 'accept' ? 'active' : '')), array('label' => TbHtml::icon('star-empty') . '&nbsp;&nbsp;' . Yii::t('access.controller', 'User Access Management'), 'url' => array('/' . $this->module->id . '/manage/index'), 'htmlOptions' => array('class' => $this->id === 'manage' ? 'active' : '')), array('label' => TbHtml::icon('bookmark') . '&nbsp;&nbsp;' . Yii::t('access.controller', 'Role Management'), 'url' => array('/' . $this->module->id . '/role/index'), 'htmlOptions' => array('class' => $this->id === 'role' ? 'active' : '')), array('label' => TbHtml::icon('user') . '&nbsp;&nbsp;' . Yii::t('access.controller', 'User Management'), 'url' => array('/' . $this->module->id . '/user/index'), 'htmlOptions' => array('class' => $this->id === 'user' ? 'active' : '')));
     $this->breadcrumbs = array(TbHtml::icon('ok') . '&nbsp;&nbsp;' . Yii::t('access.controller', 'Access Management Module') => array('/' . $this->getModule()->id . '/' . $this->getModule()->defaultController . '/index'));
     return parent::beforeAction($action);
 }
コード例 #19
0
<?php

/* @var $this SiteController */
$this->pageTitle = Yii::app()->name . ' - About';
$this->breadcrumbs = array('About');
echo TbHtml::icon(TbHtml::ICON_HEART);
$this->widget('bootstrap.widgets.TbBreadcrumb', array('links' => array('About' => array('/site/page', 'view' => 'about'))));
?>
<h1>About</h1>

<p>This is a "static" page. You may change the content of this page
by updating the file <code><?php 
echo __FILE__;
?>
</code>.</p>








<div class="well" style="max-width: 340px; padding: 8px 0;">
    <?php 
echo TbHtml::navList(array(array('label' => 'List header'), array('label' => 'Home', 'url' => '#', 'active' => true), array('label' => 'Library', 'url' => '#'), array('label' => 'Applications', 'url' => '#'), array('label' => 'Another list header'), array('label' => 'Profile', 'url' => '#'), array('label' => 'Settings', 'url' => '#'), TbHtml::menuDivider(), array('label' => 'Help', 'url' => '#')));
?>
</div>


コード例 #20
0
ファイル: view_sp_report.php プロジェクト: robertgunze/eams
                    <?php endif;?>
                    <?php if($percentageChange > 0):?>
                    <?php $deltaSign = TbHtml::icon(TbHtml::ICON_ARROW_UP);?>
                    <?php elseif($percentageChange < 0): ?>
                    <?php $deltaSign = TbHtml::icon(TbHtml::ICON_ARROW_DOWN);?>
                    <?php endif;?>
                    
                    <?php $deltaLabel = TbHtml::labelTb($percentageChange.'% '.$deltaSign, array('color' => TbHtml::LABEL_COLOR_INFO));  ?>
                    
                    <td id="<?php echo $fact->id?>" style="width:110px"><?php echo $fact->indicator_value."  ".$deltaLabel; ?></td>
                        <?php if($mapping->eamsFacts[0]->indicator_value > 0):?>
                        <?php $percentageChange = number_format(100/($mapping->eamsFacts[0]->indicator_value) * ($mapping->eamsFacts[count($mapping->eamsFacts)-1]->indicator_value - $mapping->eamsFacts[0]->indicator_value),2) ?>
                          <?php if($percentageChange > 0):?>
                            <?php $deltaSign = TbHtml::icon(TbHtml::ICON_ARROW_UP);?>
                          <?php else: ?>
                            <?php $deltaSign = TbHtml::icon(TbHtml::ICON_ARROW_DOWN);?>
                          <?php endif;?>
                        <?php $deltaLabel = TbHtml::labelTb($percentageChange.'% '.$deltaSign, array('color' => TbHtml::LABEL_COLOR_INFO));  ?>
                    
                        <?php else:?>
                        <?php $percentageChange = 'N/A'?>
                        <?php endif;?>
                   <?php endforeach;?>
                   <?php endif;?>
                      
            <?php endforeach;?>
            <td><?php echo $deltaLabel; ?></td>
            <td ></td> 
            
    </tr>
 <?php endforeach;?>
コード例 #21
0
 /**
  * Renders a warning about a missing file
  */
 private function renderMissingFile()
 {
     echo CHtml::tag('p', array('class' => 'missing-video-file'), TbHtml::icon(TBHtml::ICON_WARNING_SIGN) . Yii::t('RetrieveMediaWidget', 'The file(s) for this item is not available'));
 }
コード例 #22
0
 /**
  * Renders the data cell content.
  * @param integer $row the row number (zero-based).
  * @param mixed $data the data associated with the row.
  */
 protected function renderDataCellContent($row, $data)
 {
     if ($this->userId !== null) {
         echo TbHtml::linkButton(TbHtml::icon(TbHtml::ICON_REMOVE), array('color' => TbHtml::BUTTON_COLOR_LINK, 'size' => TbHtml::BUTTON_SIZE_MINI, 'url' => array('revoke', 'itemName' => $data['name'], 'userId' => $this->userId), 'rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'Revoke')));
     }
 }
コード例 #23
0
ファイル: registrate.php プロジェクト: argenis1763/vc
<fieldset>
    
    <p class="note">Campos con <span class="required">*</span> son requeridos.</p>
    
    <legend>Registrar Usuario</legend>
    
			<?php 
echo $form->errorSummary($user);
?>
			
            <?php 
echo $form->textFieldControlGroup($user, 'username', array('append' => TbHtml::icon(TbHtml::ICON_USER), 'placeholder' => 'Username', 'required' => true));
?>

            <?php 
echo $form->textFieldControlGroup($user, 'email', array('append' => TbHtml::icon(TbHtml::ICON_ENVELOPE), 'placeholder' => '*****@*****.**', 'required' => true));
?>

            <?php 
echo $form->textFieldControlGroup($user, 'newPassword', array('append' => TbHtml::ajaxButton("Generar", Yii::app()->user->ui->ajaxGenerateNewPasswordUrl, array('success' => new CJavaScriptExpression('fnSuccess'), 'error' => new CJavaScriptExpression('fnError'))), 'placeholder' => 'Contraseña', 'readonly' => 'readonly', 'required' => true, 'help' => 'Presione el boton "Generar" para obtener un contraseña segura.', 'helpOptions' => array('type' => TbHtml::HELP_TYPE_BLOCK)));
//TbHtml::button('Search'))); /*,array('help' => 'La contraseña debe incluir al menos 8 caracteres.')*///)
?>
			
 			<?php 
echo TbHtml::inlineradioButtonListControlGroup('UserType', '', array('1' => 'Estudiante', '2' => 'Padre', '3' => 'Tutor'), array('label' => 'Tipo de Usuario <span class="required">*</span>', 'required' => true));
?>
	        

    <script>
            function fnSuccess(data){
                    $('#CrugeStoredUser_newPassword').val(data);
コード例 #24
0
ファイル: view.php プロジェクト: jerichozis/portal
<?php 
$this->endWidget();
?>

<p><?php 
echo TbHtml::submitButton('Редагувати анкету', array('submit' => array('/manage/profiles/update', 'id' => $model->id), 'color' => TbHtml::BUTTON_COLOR_PRIMARY));
?>
</p>

<?php 
$this->widget('bootstrap.widgets.TbDetailView', array('type' => 'bordered condensed', 'data' => $model, 'attributes' => array(array('name' => 'status', 'value' => $model->statusTypes[$model->status]), 'first_name', 'last_name', array('name' => 'gender', 'value' => $model->genderTypes[$model->gender]), array('name' => 'birth_date', 'value' => Yii::app()->dateFormatter->formatDateTime($model->birth_date, "long", false) . " (" . $this->getTimeDiff($model->birth_date) . ")"), 'contact_phone', 'email:email', array('name' => 'residenciesIds', 'value' => implode(', ', array_values(CHtml::listData($model->citiesResidence, 'city_index', 'city_name')))), array('name' => 'education', 'value' => $model->educationTypes[$model->education]), 'eduction_info:ntext', 'work_experience:ntext', 'skills:ntext', 'summary:ntext', array('name' => 'categoryIds', 'value' => implode(', ', array_values(CHtml::listData($model->categories, 'id', 'name'))), 'type' => 'html'), 'desired_position', array('name' => 'positionsIds', 'value' => implode(', ', array_values(CHtml::listData($model->positions, 'id', 'name')))), 'salary', array('name' => 'jobLocationsIds', 'value' => implode(', ', array_values(CHtml::listData($model->citiesJobLocations, 'city_index', 'city_name')))), 'documents', array('name' => 'driverLicensesIds', 'value' => implode(', ', array_values(CHtml::listData($model->driverLicensesTypes, 'id', 'name')))), 'applicant_type', 'cv_file:url', array('name' => 'assistanceIds', 'value' => $model->assistances, 'type' => 'html'), array('name' => 'recruiter_id', 'value' => isset($model->recruiter->last_name) ? CHtml::link($model->recruiter->first_name . " " . $model->recruiter->last_name, array('/manage/reqruiter', 'id' => $model->recruiter->id)) : '', 'type' => 'html'), 'recruiter_comments:ntext', 'who_filled', array('name' => 'added_time', 'value' => Yii::app()->dateFormatter->formatDateTime($model->added_time, "long"), 'type' => 'html'))));
?>

<?php 
echo TbHtml::lead('Можливі вакансії:');
?>


<?php 
$this->widget('bootstrap.widgets.TbGridView', ['dataProvider' => $vacanciesDataProvider, 'filter' => null, 'columns' => ['id', 'name', 'city.city_name', ['class' => CDataColumn::class, 'value' => function (Vacancy $object) {
    return $object->company->name;
}, 'header' => Yii::t('main', 'vacancy.label.company')], ['class' => CDataColumn::class, 'value' => function (Vacancy $object) {
    return $object->user->first_name . " " . $object->user->phone;
}, 'header' => Yii::t('main', 'vacancy.label.user')], ['name' => 'close_time', 'value' => function (Vacancy $vacancy) {
    return Yii::app()->dateFormatter->formatDateTime($vacancy->close_time, "long", false);
}], ['class' => CDataColumn::class, 'value' => function (Vacancy $vacancy) {
    return VacancyHelper::statusName($vacancy);
}, 'header' => Yii::t('main', 'vacancy.label.status')], ['class' => CDataColumn::class, 'value' => function (Vacancy $object) {
    return CHtml::link(TbHtml::icon(TbHtml::ICON_EYE_OPEN), ["vacancies/view", 'id' => $object->id]) . ' ' . CHtml::link(TbHtml::icon(TbHtml::ICON_EDIT), ["vacancies/update", 'id' => $object->id]);
}, 'type' => 'raw']]]);
コード例 #25
0
ファイル: index.php プロジェクト: asopin/portal
<?php

/**
 * @var $model Company
 * @var $this CompaniesController
 */
?>

    <h1><?php 
echo Yii::t('main', 'companies');
?>
</h1>

<?php 
$this->widget('bootstrap.widgets.TbGridView', ['dataProvider' => $model->search(), 'filter' => $model, 'columns' => ['id', 'name', 'address', 'site_url:url', ['class' => CDataColumn::class, 'value' => function (Company $object) {
    return CHtml::link(Yii::t('main', 'vacancy.create.link'), $this->createUrl("vacancies/create", ['id' => $object->id]));
}, 'type' => 'raw'], ['class' => CDataColumn::class, 'value' => function (Company $object) {
    return CHtml::link(TbHtml::icon(TbHtml::ICON_EYE_OPEN), ["companies/view", 'id' => $object->id]);
}, 'type' => 'raw']]]);
コード例 #26
0
 public function testIcon()
 {
     $I = $this->codeGuy;
     $html = TbHtml::icon(TbHtml::ICON_CHECK, array('class' => 'icon'));
     $i = $I->createNode($html, 'i.icon-check');
     $I->seeNodeEmpty($i);
     $html = TbHtml::icon(TbHtml::ICON_REMOVE, array('color' => TbHtml::ICON_COLOR_WHITE));
     $i = $I->createNode($html, 'i.icon-remove');
     $I->seeNodeCssClass($i, 'icon-white');
     $I->seeNodeEmpty($i);
     $html = TbHtml::icon('pencil white');
     $i = $I->createNode($html, 'i.icon-pencil');
     $I->seeNodeCssClass($i, 'icon-white');
     $I->seeNodeEmpty($i);
     $html = TbHtml::icon(array());
     $this->assertEquals('', $html);
 }
コード例 #27
0
ファイル: inside_menu.php プロジェクト: asopin/portal
 * @var string $content
 */
$this->beginContent('application.modules.manage.views.layouts.inside');
?>
            <div class="masthead">
                    <?php 
$this->widget('bootstrap.widgets.TbNavbar', array('brandLabel' => Yii::t('main', Yii::app()->name), 'brandUrl' => array('/manage/'), 'collapse' => true, 'items' => array(array('class' => 'bootstrap.widgets.TbNav', 'items' => array(array('label' => 'Анкети претендентів', 'url' => array('/manage/profiles'), 'visible' => Yii::app()->user->checkAccess(User::ROLE_VOLONT)), ['label' => 'Вакансіі', 'items' => [['label' => 'Перелік вакансій', 'url' => array('/manage/vacancies'), 'visible' => Yii::app()->user->checkAccess(User::ROLE_VOLONT)], ['label' => 'Компанії', 'url' => array('/manage/companies'), 'visible' => Yii::app()->user->checkAccess(User::ROLE_VOLONT)]]], array('label' => 'Роботодавець', 'visible' => Yii::app()->user->checkAccess(User::ROLE_EMPL), 'url' => array('/manage/employer')), array('label' => 'Адміністративна частина', 'items' => array(array('label' => 'Користувачі', 'url' => array('/manage/users')), TbHtml::menuDivider(), array('label' => 'Довідник категорій', 'url' => ['/manage/categories'])), 'visible' => Yii::app()->user->checkAccess(User::ROLE_ADMIN) || Yii::app()->user->checkAccess(User::ROLE_MANAGER)))), array('class' => 'bootstrap.widgets.TbNav', 'htmlOptions' => array('class' => 'pull-right'), 'items' => array(array('label' => Yii::t('main', 'Hello') . ", " . Yii::app()->session['first_name'] . " " . Yii::app()->session['last_name'] . "!", 'items' => array(array('label' => 'Мій профайл', 'url' => array('/manage/profile/'))), 'visible' => !Yii::app()->user->isGuest), array('label' => Yii::t('main', 'Logout'), 'url' => array('/manage/logout'), 'visible' => !Yii::app()->user->isGuest), array('label' => Yii::t('main', 'Login'), 'url' => array('/manage/login'), 'visible' => Yii::app()->user->isGuest))))));
?>
            </div>
            <div class="row-fluid">
            <?php 
if (!empty($this->menu)) {
    ?>
                <div class="float-menu">
                    <span class="sticker"><?php 
    echo TbHtml::icon(TbHtml::ICON_TASKS);
    ?>
</span>
                    <?php 
    echo TbHtml::navList($this->menu);
    ?>
                </div>
            <?php 
}
?>
                <?php 
if (Yii::app()->user->hasFlash('error')) {
    ?>
                        <div class="alert alert-danger">
                            <?php 
    echo Yii::app()->user->getFlash('error');
コード例 #28
0
ファイル: widgets.php プロジェクト: crisu83/yiistrap-docs
    <p class="muted">Example coming soon!</p>

</section>

<!-- Typeahead
================================================== -->
<section id="typeahead">

    <div class="page-header">
        <h1>Typeahead <small>TbTypeaAhead.php</small></h1>
    </div>

    <div class="bs-docs-example" style="background-color: #f5f5f5;">
        <?php 
$this->widget('bootstrap.widgets.TbTypeAhead', array('name' => 'typeahead-test', 'source' => array("Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Dakota", "North Carolina", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"), 'htmlOptions' => array('prepend' => TbHtml::icon(TbHtml::ICON_GLOBE), 'placeholder' => 'Write an USA state')));
?>
    </div>

<pre class="prettyprint linenums">
&lt;?php $this->widget('bootstrap.widgets.TbTypeAhead', array(
    'name' => 'typeahead-test',
    'source' => array(...),
    'htmlOptions' => array(
        'prepend' => TbHtml::icon(TbHtml::ICON_GLOBE),
        'placeholder' => 'Write an USA state'
    ),
)); ?></pre>

</section>
コード例 #29
0
<?php

$leftItems = array(array('label' => Yii::t('Menu', 'Movies'), 'items' => array(array('label' => Yii::t('Menu', 'Browse'), 'url' => array('movie/index'), 'active' => in_array($this->route, array('movie/index', 'movie/details'))), array('label' => Yii::t('Menu', 'Recently added'), 'url' => array('movie/recentlyAdded'))), 'linkOptions' => array('class' => 'fa fa-video-camera')), array('label' => Yii::t('Menu', 'TV Shows'), 'items' => array(array('label' => Yii::t('Menu', 'Browse'), 'url' => array('tvShow/index'), 'active' => in_array($this->route, array('tvShow/index', 'tvShow/details', 'tvShow/season'))), array('label' => Yii::t('Menu', 'Recently added'), 'url' => array('tvShow/recentlyAdded'))), 'linkOptions' => array('class' => 'fa fa-desktop')));
$rightItems = array();
// Add a "Change backend" menu when there's more than one configured backend
$backends = Backend::model()->findAll();
if (count($backends) > 1) {
    $backendItems = array();
    $currentBackend = Yii::app()->backendManager->getCurrent();
    foreach ($backends as $backend) {
        $label = $backend->name;
        if ($currentBackend !== null && $currentBackend->id == $backend->id) {
            $label = TbHtml::icon(TbHtml::ICON_OK) . ' ' . $label;
        }
        $backendItems[] = array('label' => $label, 'url' => array('backend/change', 'id' => $backend->id));
    }
    $rightItems[] = array('label' => Yii::t('Menu', 'Change backend'), 'items' => $backendItems, 'linkOptions' => array('class' => 'fa fa-cloud'));
}
// Add the "Settings" menu for administrators
if (Yii::app()->user->role == User::ROLE_ADMIN) {
    $rightItems[] = array('label' => Yii::t('Menu', 'Settings'), 'items' => array(array('label' => Yii::t('Menu', 'Settings')), array('label' => Yii::t('Menu', 'Manage'), 'url' => array('setting/admin')), array('label' => Yii::t('Menu', 'Backends')), array('label' => Yii::t('Menu', 'Manage'), 'url' => array('backend/admin')), array('label' => Yii::t('Menu', 'Create new'), 'url' => array('backend/create')), array('label' => Yii::t('Menu', 'Users')), array('label' => Yii::t('Menu', 'Manage'), 'url' => array('user/admin')), array('label' => Yii::t('Menu', 'Create new'), 'url' => array('user/create')), array('label' => Yii::t('Menu', 'System log')), array('label' => Yii::t('Menu', 'Browse'), 'url' => array('log/'))), 'linkOptions' => array('class' => 'fa fa-cogs'));
}
// Add the "Actions" menu
$changeLanguageItem = array('label' => Yii::t('Menu', 'Change language'), 'url' => '#', 'linkOptions' => array('data-toggle' => 'modal', 'data-target' => '#change-language-modal'));
$actions = array(array('label' => Yii::t('Menu', 'Interface')), $changeLanguageItem, array('label' => Yii::t('Menu', 'System')));
// Only show "Flush cache" if cacheApiCalls is enabled
if (Setting::getBoolean('cacheApiCalls')) {
    $actions[] = array('label' => Yii::t('Menu', 'Flush cache'), 'url' => array('site/flushCache'), 'linkOptions' => array('confirm' => Yii::t('Misc', 'Are you sure you want to flush the cache?')));
}
$actions[] = array('label' => Yii::t('Menu', 'Update library'), 'url' => array('backend/updateLibrary'), 'linkOptions' => array('confirm' => Yii::t('Misc', "Are you sure you want to update the backend's library?")));
if (Yii::app()->powerOffManager->getAllowedActions()) {
コード例 #30
0
 /**
  * Renders the data cell content.
  * @param integer $row the row number (zero-based).
  * @param mixed $data the data associated with the row.
  */
 protected function renderDataCellContent($row, $data)
 {
     if (!Yii::app()->user->isAdmin) {
         echo TbHtml::linkButton(TbHtml::icon(TbHtml::ICON_EYE_OPEN), array('color' => TbHtml::BUTTON_COLOR_LINK, 'size' => TbHtml::BUTTON_SIZE_MINI, 'url' => array('view', 'id' => $data->{$this->idColumn}), 'htmlOptions' => array('rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'View'))));
     }
 }