function reject($vcid) { return CHtml::ajaxLink('Reject', Yii::app()->createAbsoluteUrl('videoConference/reject/' . $vcid), array('type' => 'get', 'data' => array('id' => $vcid, 'type' => 'get'), 'update' => 'message', 'success' => 'function(response) { $(".message").html(response); location.reload(); }'), array('confirm' => 'Are you sure you want to reject this invitation?', 'role' => "button", "class" => "btn btn-danger")); }
public function init() { $assetFolder = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets'; $publishedAssetsPath = Yii::app()->assetManager->publish($assetFolder); if ($this->position == 'left') { Yii::app()->clientScript->registerCssFile($publishedAssetsPath . '/css/leftsidebar.css'); Yii::app()->clientScript->registerScriptFile($publishedAssetsPath . '/js/leftsidebar.js', CClientScript::POS_END); $js = $this->collapsed ? 'left_menu.setStartStatus(false);' : 'left_menu.setStartStatus(true);'; Yii::app()->clientScript->registerScript('leftMenu', $js, CClientScript::POS_LOAD); echo '<div class="left_menu" id="leftmenu" style="width: 180px;">'; echo '<div class="title">'; echo CHtml::encode($this->title); echo CHtml::ajaxLink('>>', '', false, array('id' => 'toggle_left_menu')); echo '</div>'; } else { Yii::app()->clientScript->registerCssFile($publishedAssetsPath . '/css/rightsidebar.css'); Yii::app()->clientScript->registerScriptFile($publishedAssetsPath . '/js/rightsidebar.js', CClientScript::POS_END); $js = $this->collapsed ? 'right_menu.setStartStatus(false);' : 'right_menu.setStartStatus(true);'; Yii::app()->clientScript->registerScript('rightMenu', $js, CClientScript::POS_LOAD); echo '<div class="right_menu" id="rightmenu" style="width: 180px;">'; echo '<div class="title">'; echo CHtml::encode($this->title); echo CHtml::ajaxLink('>>', '', false, array('id' => 'toggle_right_menu')); echo '</div>'; } parent::init(); }
/** * attributeToggler * * For CGridView * * @param CActiveRecord $model * @param string $attribute * @param array $values - ("On", "Off") or ("Yes", "No") etc. * @return CHtml::ajaxLink */ public static function attributeToggler($model, $attribute, $values = array('On', 'Off')) { if ($model->{$attribute} == 1) { return CHtml::ajaxLink("<span class='label label-success'>" . $values[0] . "</span>", array('toggleState', 'id' => $model->id, 'attribute' => $attribute, 'value' => 0), array('success' => "reloadGrid")); } else { return CHtml::ajaxLink("<span class='label label-warning'>" . $values[1] . "</span>", array('toggleState', 'id' => $model->id, 'attribute' => $attribute, 'value' => 1), array('success' => "reloadGrid")); } }
function createEditButton($model, $item) { echo CHtml::ajaxLink(Yii::t('global', 'Edit'), array('wishlist/edititem'), array('type' => 'POST', 'dataType' => 'json', 'success' => 'js:function(data){ $("#WishlistEditForm_qty").val(data.qty); $("#WishlistEditForm_qty_received").val(data.qty_received); $("#WishlistEditForm_priority").val(data.priority); $("#WishlistEditForm_comment").val(data.comment); $("#WishlistEditForm_code").val(data.code); $("#WishlistEditForm_id").val(data.id); $("#WishitemEdit").dialog("open"); }', 'data' => array('code' => $model->gift_code, 'id' => $item->id)), array('id' => 'editItem' . $item->id, 'class' => 'editwish')); }
public function run() { $val = $this->model->{$this->attribute}; if (!$this->model->isNewRecord && $val) { $id = $this->id . get_class($this); $files_data = $this->model->uploadFiles(); $attribute_data = $files_data[$this->attribute]; $directory = trim($attribute_data['dir'], '/'); $preview = ImageHelper::thumb($directory, $val, array('width' => null, 'height' => 128)); $preview .= CHtml::ajaxLink('X', array('/main/helpAdmin/saveAttribute'), array('type' => 'post', 'data' => array('model' => get_class($this->model), 'id' => $this->model->primaryKey, 'attribute' => $this->attribute, 'value' => '', 'unlink_file' => $directory . '/' . $val), 'success' => 'js:function() {$("#' . $id . '").remove();}'), array('class' => 'btn btn-danger delete-img')); echo CHtml::tag('div', array('id' => $id), $preview); } echo CHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions); }
/** * Fixes the default yii ajaxLink with unregistering onClick Handlers first, before set new one. * * @param type $text * @param type $url * @param type $ajaxOptions * @param type $htmlOptions * @return type */ public static function ajaxLink($text, $url, $ajaxOptions = array(), $htmlOptions = array()) { // Auto set csrf token if (isset($ajaxOptions['data']) && is_array($ajaxOptions['data']) && !isset($ajaxOptions['data'][Yii::app()->request->csrfTokenName])) { $ajaxOptions['data'][Yii::app()->request->csrfTokenName] = Yii::app()->request->csrfToken; } if (isset($htmlOptions['id'])) { $id = $htmlOptions['id']; $cs = Yii::app()->getClientScript(); $cs->registerScript('Yii.HHtml.#' . $id, "jQuery('body').off('click','#{$id}');"); } else { $htmlOptions['id'] = Helpers::GetUniqeId(); } return parent::ajaxLink($text, $url, $ajaxOptions, $htmlOptions); }
public function renderContent() { $criteria1 = new CDbCriteria(array('condition' => 'status=1')); $all = (int) Teacher::model()->count($criteria1); if ($all > 5) { $offset = rand(0, $all - 5); } else { $offset = rand(0, $all); } $criteria = new CDbCriteria(array('condition' => 'status=1', 'order' => 'RAND()', 'limit' => '5,' . $offset)); //echo $all; $teachers = Teacher::model()->findAll($criteria); if ($teachers) { echo CHtml::openTag("ul"); foreach ($teachers as $teacher) { $img = ''; if ($teacher->picture) { Yii::import('application.extensions.image.Image'); $thumbImage = new Image(Yii::getPathOfAlias('webroot') . $teacher->picture); $img_url = $thumbImage->createThumb(70, 60); /*$thumbImage->resize(70, 60, Image::WIDTH); $arr = explode("/",$teacher->picture); $file_name = $arr[count($arr)-1]; $thumb = Yii::getPathOfAlias('webroot') . '/resources/images/85x72/' . $file_name; $thumbImage->save($thumb);*/ $img = '<img src="' . $img_url . '" />'; } echo CHtml::openTag("li", array('class' => 'clearfix')); echo CHtml::openTag("div", array('class' => 'avatar')); echo CHtml::link($img, Yii::app()->createUrl('/teacher/view', array('id' => $teacher->id, 'title' => Lnt::safeTitle($teacher->name)))); echo "<div>Giảng viên</div>"; echo CHtml::closeTag("div"); echo CHtml::openTag("div", array('class' => 'title')); echo CHtml::link($teacher->name, Yii::app()->createUrl('/teacher/view', array('id' => $teacher->id, 'title' => Lnt::safeTitle($teacher->name)))); echo CHtml::closeTag("div"); echo CHtml::openTag("div", array('style' => 'margin-top:10px;float:left;width:80px;height:14px;background:#ce1f46;color:#fff;padding:8px 0px;text-align:center')); echo "5.1232"; echo CHtml::closeTag("div"); echo CHtml::openTag("div", array('style' => 'float:right;text-align:left;width:127px;margin-top:10px;font-weight:bold;color:#a8a8a8;')); echo $teacher->videoCount . " bài giảng | " . $teacher->likeTeachersCount . " " . CHtml::ajaxLink(CHtml::image(Yii::app()->baseUrl . '/images/tim_03.jpg', 'Like', array('title' => 'Yêu thích')), Yii::app()->createUrl('/teacher/like', array('id' => $teacher->id)), array('success' => 'js:function(res){alert(res.msg);}'), array('class' => 'teacher_like')); echo CHtml::closeTag("div"); echo CHtml::closeTag("li"); } echo CHtml::closeTag("ul"); } }
/** * render buttons to style clistviewitems, like square or list */ public function renderItemstyle() { $class = ''; if (Yii::app()->session->get('view', 'list') == 'list') { $class = $this->class; } echo CHtml::ajaxLink('<i class="prod_list_style"></i>', Yii::app()->createUrl('ajax/changeView'), array('data' => array('type' => 'list'), 'method' => 'POST', 'complete' => 'function() { $.fn.yiiListView.update("catalog-products"); $("#list").addClass("active"); $("#square").removeClass("active"); }'), array('class' => $class, 'id' => 'list')); $class = ''; if (Yii::app()->session->get('view', 'list') == 'square') { $class = $this->class; } echo CHtml::ajaxLink('<i class="prod_cards_style"></i>', Yii::app()->createUrl('ajax/changeView'), array('data' => array('type' => 'square'), 'method' => 'POST', 'complete' => 'function() { $.fn.yiiListView.update("catalog-products"); $("#square").addClass("active"); $("#list").removeClass("active"); }'), array('class' => $class, 'id' => 'square')); }
/** * @see CMenu::renderMenuItem() */ protected function renderMenuItem($item) { // raise the item counter $this->_itemCounter++; if (isset($item['url'])) { // sets the link label $label = $this->linkLabelWrapper === null ? $item['label'] : '<' . $this->linkLabelWrapper . '>' . $item['label'] . '</' . $this->linkLabelWrapper . '>'; // creates the ajax link if (($this->ajax && (!isset($item['ajax']) || (isset($item['ajax']) && $item['ajax'] !== false))) || (isset($item['ajax']) && $item['ajax'])) { // set the new id if randomID is true if ($this->randomID) $item['linkOptions']['id'] = isset($item['linkOptions']['id']) ? $item['linkOptions']['id'] . rand() : 'am' . uniqid(); else $item['linkOptions']['id'] = isset($item['linkOptions']['id']) ? $item['linkOptions']['id'] : 'am-' . $this->_itemCounter; // set the ajax options $ajax = isset($item['ajax']) ? $item['ajax'] : $this->ajax; $ajax_options = $ajax; if (isset($ajax['success']) == FALSE){ if (isset($ajax['update'])) $jquery_method = '$("' . $ajax['update'] . '").html(data);'; elseif (isset($ajax['replace'])) $jquery_method = '$("' . $ajax['replace'] . '").replaceWith(data);'; else $jquery_method = NULL; $ajax_options['success'] = 'js: function(data) { $("#' . $this->id . ' li").removeClass("' . $this->activeCssClass . '"); $("#' . $item['linkOptions']['id'] . '").parent().addClass("' . $this->activeCssClass . '");' . $jquery_method . ' }'; } // creates the ajax link. $item['linkOptions'] should come 2nd in the array_merge. $linkHtmlOptions = (isset($item['linkOptions']) ? array_merge(array('live'=>false), $item['linkOptions']) : array('live'=>false)); return CHtml::ajaxLink($label, $item['url'], $ajax_options, $linkHtmlOptions); } else return CHtml::link($label, $item['url'], isset($item['linkOptions']) ? $item['linkOptions'] : array()); } else return CHtml::tag('span', isset($item['linkOptions']) ? $item['linkOptions'] : array(), $item['label']); }
</td> <td rowspan="2" class="withborder"> <p> <?php echo CHtml::link('Tyhjennä muokkaustila', array('image/basketDelete'), array('class' => 'linkbutton', 'confirm' => 'Poistetaanko kuvat kuvien muokkaustilasta?')); ?> </p> <br /> <br /> <br /> <br /> <br /> <p> <?php echo CHtml::ajaxLink('Sijoita kaikkiin kuviin', array('image/fastSave'), array('type' => 'POST'), array('class' => 'linkbutton', 'confirm' => 'Sijoitetaanko syötetty metadata kaikkiin kuviin?')); ?> </p> </td> </tr> <tr> <td class="withborder"> <div class="row"> <?php echo CHtml::activeLabel($model, 'valokuvaaja'); ?> <br /> <?php
<li class="address-block address-block-pickable"> <p class="webstore-label"> <?php echo $objAddress->formattedblockcountry; ?> <span class="controls"> <?php echo CHtml::link(Yii::t('checkout', 'Edit Address'), Yii::app()->createUrl('/checkout/editaddress', array('id' => $objAddress->id, 'type' => 'billing'))); ?> <?php echo Yii::t('checkout', 'or'); ?> <?php echo CHtml::ajaxLink(Yii::t('checkout', 'Remove'), Yii::app()->createUrl('myaccount/removeaddress'), array('type' => 'POST', 'data' => array('CustomerAddressId' => $objAddress->id, 'YII_CSRF_TOKEN' => Yii::app()->request->csrfToken), 'success' => 'function(data) { var addressBlock = $(this).parents(".address-block")[0]; $(addressBlock).remove(); }.bind(this)'), array('class' => 'delete')); ?> </span> </p> <div class="buttons"> <?php echo CHtml::htmlButton(Yii::t('checkout', $objAddress->id == $model->intShippingAddress ? 'Use shipping address' : 'Use this address'), array('type' => 'submit', 'class' => $objAddress->id == $model->intBillingAddress ? 'small default' : 'small', 'name' => 'BillingAddress', 'id' => 'BillingAddress', 'onclick' => '$("form").removeClass("error").end().find(".required").remove().end().find(".form-error").remove().end()', 'value' => $objAddress->id)); ?> </div> </li> <?php } ?> <?php }
<li> <?php echo CHtml::ajaxLink(Yii::t('timetable', 'Set Timetable') . '<span>' . Yii::t('timetable', 'Timetable For The Batch') . '</span>', array('/site/explorer', 'widget' => '2', 'rurl' => 'timetable/weekdays/timetable'), array('update' => '#explorer_handler'), array('id' => 'explorer_timetable', 'class' => 'sbook_ico', 'active' => Yii::app()->controller->id == 'weekdays')); ?> </li> <li> <?php echo CHtml::ajaxLink(Yii::t('timetable', 'Set Weekdays') . '<span>' . Yii::t('timetable', 'Weekdays For The Batch') . '</span>', array('/site/explorer', 'widget' => '2', 'rurl' => 'timetable/weekdays'), array('update' => '#explorer_handler'), array('id' => 'explorer_weekdays', 'class' => 'lbook_ico', 'active' => Yii::app()->controller->id == 'weekdays')); ?> </li> <li> <?php echo CHtml::ajaxLink(Yii::t('timetable', 'Set Class Timing') . '<span>' . Yii::t('timetable', 'Class Timing For The Batch') . '</span>', array('/site/explorer', 'widget' => '2', 'rurl' => 'timetable/classTiming'), array('update' => '#explorer_handler'), array('id' => 'explorer_classTiming', 'class' => 'abook_ico', 'active' => Yii::app()->controller->id == 'classTiming')); ?> </li> <?php if (Yii::app()->controller->id == 'weekdays') { ?> <li class="list_active"> <?php echo CHtml::link(Yii::t('timetable', 'Set Default Weekdays') . '<span>' . Yii::t('timetable', 'Default Weekdays For The Institution') . '</span>', array('/timetable/weekdays', 'type' => 'default'), array('class' => 'abook_ico')); ?> </li> <?php } else { ?> <li>
/** * Creates the button element. * @return string the created button. */ protected function createButton() { switch ($this->buttonType) { case self::BUTTON_BUTTON: return CHtml::htmlButton($this->label, $this->htmlOptions); case self::BUTTON_SUBMIT: $this->htmlOptions['type'] = 'submit'; return CHtml::htmlButton($this->label, $this->htmlOptions); case self::BUTTON_RESET: $this->htmlOptions['type'] = 'reset'; return CHtml::htmlButton($this->label, $this->htmlOptions); case self::BUTTON_SUBMITLINK: return CHtml::linkButton($this->label, $this->htmlOptions); case self::BUTTON_AJAXLINK: return CHtml::ajaxLink($this->label, $this->url, $this->ajaxOptions, $this->htmlOptions); case self::BUTTON_AJAXBUTTON: $this->ajaxOptions['url'] = $this->url; $this->htmlOptions['ajax'] = $this->ajaxOptions; return CHtml::htmlButton($this->label, $this->htmlOptions); case self::BUTTON_AJAXSUBMIT: $this->ajaxOptions['type'] = 'POST'; $this->ajaxOptions['url'] = $this->url; $this->htmlOptions['type'] = 'submit'; $this->htmlOptions['ajax'] = $this->ajaxOptions; return CHtml::htmlButton($this->label, $this->htmlOptions); default: case self::BUTTON_LINK: return CHtml::link($this->label, $this->url, $this->htmlOptions); } }
private function ajaxDialog($label, $url, $title = null, $type = 'link', $ajaxOptions = array()) { $id = self::ID . '-dialog'; $ajaxOptions = array_merge(array('update' => '#' . $id, 'type' => 'post', 'complete' => "function(){ \$('#{$id}').dialog('option', 'position', 'center').dialog('open');}"), $ajaxOptions); $url = Yii::app()->getController()->createUrl($url); if ($type === 'button') { $content = CHtml::ajaxButton($label, $url, $ajaxOptions); } else { $content = CHtml::ajaxLink($label, $url, $ajaxOptions); } $content .= Yii::app()->getController()->widget('zii.widgets.jui.CJuiDialog', array('options' => array_merge($this->dialogOptions, array('title' => $title)), 'id' => $id), true); return $content; }
/** * Created by PhpStorm. * User: Admin * Date: 21.08.14 * Time: 16:03 */ ?> <section class="postOneBloger"> <?= CHtml::link(Yii::t('main', 'Редагувати'), array('/blog/cabinet/update', 'id'=>$data->id)); ?> <?= CHtml::ajaxLink(Yii::t('main', 'Видалити'), array('/blog/cabinet/delete', 'id'=>$data->id), array( //'update'=>'#req_res_loading', 'beforeSend' => 'function() { $("#maindiv").addClass("loading"); }', 'complete'=>'function(data){ $.fn.yiiListView.update("userList"); }', ), array('confirm' => Yii::t('main', 'Ви дійсно хочете видалити пост?'), 'id'=>'post_id_'.$data->id, )); ?> <p> <i class="fa fa-bookmark "></i> <?= CHtml::link($data->title, array('/blog/default/post', 'id'=>$data->id)); ?> <?= CHtml::link('Автор: '.$data->author->name, array('/blog/default/bloger', 'id'=>$data->author->id)); ?> </p> </section>
if ($element->getUserDate($issueId)) { echo "</br><p style='background-color:rgb(220,220,220);font-size:small; display:none; padding:4px; border-radius:3px;' class='info'>" . $element->getUserDate($issueId) . "</p>"; } echo "</div"; } break; case 2: $file = $element->getFile($issueId); if ($file) { if ($file->image) { echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/files/' . $file->link), Yii::app()->request->baseUrl . '/files/' . $file->link, array('target' => '_blank')); } else { echo CHtml::link($file->fileSelected, Yii::app()->request->baseUrl . '/files/' . $file->link, array('target' => '_blank')); } if ($issueId && $this->uniqueid == "result") { echo " - " . CHtml::ajaxLink(Yii::t('default', 'delete'), Yii::app()->createUrl('/file/delete', array('id' => $file->id, 'ajax' => 'delete')), array('type' => 'POST', 'success' => "function( ){window.location.reload(true);}")); } echo "<br><p style='background-color:rgb(220,220,220); display:none; font-size:small; padding:4px; border-radius:3px;' class='info'>" . $element->getUserDate($issueId) . "</p>"; } else { echo CHtml::fileField("File[elementid][{$element->id}]"); } break; case 4: echo "<div title='" . $element->getUserDate($issueId) . "'>"; $this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => "Result[elementid][{$element->id}]", 'value' => $element->getResult($issueId), 'options' => array('showAnim' => 'fold', 'dateFormat' => 'HH:mm dd/mm/yy'), 'htmlOptions' => array('style' => 'height:20px;', 'readonly' => true))); $url = Yii::app()->request->baseUrl . "/index.php/step/excelComp/" . $issueId . "?" . "elementId=" . $element->id; //funciona echo "</div><div class='exceltools' style='display:none'><input class='Excel' type='button' value='Excel Chart' onclick=location.href='" . $url . "';></div>"; if ($element->getUserDate($issueId)) { echo "</br><p style='background-color:rgb(220,220,220);font-size:small; display:none; padding:4px; border-radius:3px;' class='info'>" . $element->getUserDate($issueId) . "</p>"; }
<div class="edit_bttns" style="width:350px; top:30px; right:50px;"> <ul> <li> <?php echo CHtml::ajaxLink('<span>Student Attendance</span>', array('/site/explorer', 'widget' => 's_a', 'rurl' => 'attendance/studentAttentance'), array('update' => '#explorer_handler'), array('id' => 'explorer_change', 'class' => 'addbttn', 'style' => 'right:120px;')); ?> </li> </ul> </div> <?php if (Yii::app()->controller->id == 'employeeLeaveTypes') { echo CHtml::link('<span>' . Yii::t('attendance', 'Employee Attendance') . '</span>', array('/attendance/employeeAttendances'), array('class' => 'sb_but', 'style' => 'right:60px; width:180px; top:30px;')); } else { echo CHtml::link('<span>' . Yii::t('attendance', 'Employee Leave Types') . '</span>', array('/attendance/employeeLeaveTypes'), array('class' => 'sb_but', 'style' => 'right:60px; width:180px; top:30px;')); } ?> <?php echo CHtml::link('<span>close</span>', array('/attendance'), array('class' => 'sb_but_close', 'style' => 'right:25px;top:30px;')); ?>
</div><!-- demo box --> <?php Yii::app()->sc->renderSourceBox(); ?> <!-- Example2: Ajax Link Example with a loading image --> <a name="ajaxLinkLoadingImage"></a> <div class="example_title">Example2: Ajax request using ajaxLink with loading image</div> <div class="demo_box"> <?php Yii::app()->sc->setStart(__LINE__); echo CHtml::ajaxLink('Test request', array('ajax/reqTest01Loading'), array('update' => '#req_res_loading', 'beforeSend' => 'function() { $("#maindiv").addClass("loading"); }', 'complete' => 'function() { $("#maindiv").removeClass("loading"); }')); ?> <div id="req_res_loading">...</div> <?php Yii::app()->sc->collect('php', Yii::app()->sc->getSourceToLine(__LINE__, __FILE__)); Yii::app()->sc->collect('php', Yii::app()->sc->getFunctionFromFile('public function actionReqTest01Loading', 'protected/modules/AjaxModule/controllers/AjaxController.php'), false, true); ?> </div><!-- demo box --> <?php Yii::app()->sc->renderSourceBox(); ?>
} else { ?> <ul> <li> <span>City<span class="required">*</span></span> <?php $cityid = ''; $cityList = CHtml::listData(GeoCity::model()->findAll(), 'id', 'city', 'state.state'); // echo $form->dropdownList($locationCity,'city_id',$cityList,array('empty'=>'Select')); echo CHtml::dropdownList('city_id[]', $cityid, $cityList, array('empty' => 'Select', 'class' => 'slctbox med')); ?> </li> <li> <?php echo CHtml::ajaxLink('Add More', array('Agent/addMoreCity'), array('replace' => '#city_content_more')); ?> </li> </ul> <div id="city_content_more"></div> <?php } ?> <ul><li class="error_message"><?php echo $form->error($requirementCities, 'city_id'); ?> </li></ul> </fieldset> <fieldset><legend>Property Features</legend> <ul> <li class="error_message"><?php
<div> <?php $img = CHtml::image(Yii::app()->baseUrl . "/" . DxdUtil::xImage($data->face, 40, 40), $data->name, array('style' => 'width:40px;height:40px;')); echo CHtml::link($img . " {$data->name}", $data->user->pageUrl, array('class' => 'dxd-name', 'data-userId' => $data->userId), array('style' => 'width:40px;height:50px;')); // echo CHtml::link(,array('u/index','id'=>$data->userId),array('class'=>'dxd-name','data-userId'=>$data->userId,'style'=>'margin-top:5px;')); echo " " . $data->introduction; echo CHtml::ajaxLink(Yii::t('app', '剔出小组'), array('groupMember/delete', 'groupid' => $group->id, 'userId' => $data->userId), array('success' => 'js:function(data){window.location.reload();}'), array('class' => 'btn pull-right')); ?> <div class="clearfix"></div> </div>
<td class="td"><div class="name"><?php echo Yii::t('weekdays', 'SAT'); ?> </div></td> <td class="td-blank"></td> <?php for ($i = 0; $i < $count_timing; $i++) { echo ' <td class="td"> <div onclick="" style="position: relative; "> <div class="tt-subject"> <div class="subject">'; $set = TimetableEntries::model()->findByAttributes(array('batch_id' => $_REQUEST['id'], 'weekday_id' => $weekdays[6]['weekday'], 'class_timing_id' => $timing[$i]['id'])); if (count($set) == 0) { $is_break = ClassTimings::model()->findByAttributes(array('id' => $timing[$i]['id'], 'is_break' => 1)); if ($is_break == NULL) { echo CHtml::ajaxLink(Yii::t('weekdays', 'Assign'), $this->createUrl('TimetableEntries/settime'), array('onclick' => '$("#jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'] . '").dialog("open"); return false;', 'update' => '#jobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'], 'type' => 'GET', 'data' => array('batch_id' => $_REQUEST['id'], 'weekday_id' => $weekdays[6]['weekday'], 'class_timing_id' => $timing[$i]['id']), 'dataType' => 'text'), array('id' => 'showJobDialog' . $timing[$i]['id'] . $weekdays[6]['weekday'])); } else { echo Yii::t('weekdays', 'Break'); } } else { $time_sub = Subjects::model()->findByAttributes(array('id' => $set->subject_id)); if ($time_sub != NULL) { echo $time_sub->name . '<br>'; } $time_emp = Employees::model()->findByAttributes(array('id' => $set->employee_id)); if ($time_emp != NULL) { echo '<div class="employee">' . $time_emp->first_name . '</div>'; } echo CHtml::link('', array('timetableEntries/remove', 'id' => $set->id, 'batch_id' => $_REQUEST['id']), array('confirm' => 'Are you sure?', 'class' => 'delete')); } echo '</div>
<?php $favorite = Yii::app()->favorite->getPositions(); $inFavorite = key_exists($model->getId(), $favorite); echo CHtml::ajaxLink('в избранном', Yii::app()->createUrl('catalog/catalog/remove_from_favorite', array('id' => $model->id)), array('context' => 'js:this', 'success' => 'js:function(data,status){ if(data.result) { $(".fav_lnk").toggle(); updateFavAndWatchedWidget(); } }'), array('id' => 'remove_fav_' . $model->id, 'class' => 'fav_lnk active', 'style' => !$inFavorite ? 'display: none' : '')); echo CHtml::ajaxLink('в избранное', Yii::app()->createUrl('catalog/catalog/add_to_favorite', array('id' => $model->id)), array('context' => 'this', 'success' => 'js:function(response,status){ if(response.result) { $(".fav_lnk").toggle(); updateFavAndWatchedWidget(); } }'), array('id' => 'add_fav_' . $model->id, 'class' => 'fav_lnk', 'style' => $inFavorite ? 'display: none' : ''));
<div class="col-sm-4"> <?php echo $form->checkBox($model, 'rememberMe'); ?> <?php echo $form->label($model, 'rememberMe', array('class' => 'rememberMe')); ?> <?php echo $form->error($model, 'rememberMe'); ?> </div> <div class="col-sm-4"> <?php echo CHtml::ajaxLink(Yii::t('global', 'Forgot Password?'), $this->createUrl('site/forgotpassword'), array('type' => "POST", 'data' => 'js:jQuery($("#login-form")).serialize()', 'dataType' => 'json', 'success' => 'js:function(data) { if (data.status=="success") { alert(data.message); $.ajax({url:data.url}); } else alert(data.message); }'), array('class' => 'forgotpassword')); ?> </div> </div> <div class="row shortrow buttons"> <div class="col-sm-12"> <?php echo CHtml::SubmitButton(Yii::t('global', 'Login'), array('site/login'), array('id' => 'btnModalLogin', 'name' => 'btnModalLogin')); ?> </div> </div>
/** * Creates a button the of given type. * @param string $type the button type. * @param string $label the button label. * @param array $htmlOptions additional HTML attributes. * @return string the button. * @throws CException if the button type is valid. */ protected static function createButton($type, $label, $htmlOptions) { $url = TbArray::popValue('url', $htmlOptions, '#'); $ajaxOptions = TbArray::popValue('ajaxOptions', $htmlOptions, array()); switch ($type) { case self::BUTTON_TYPE_HTML: return parent::htmlButton($label, $htmlOptions); case self::BUTTON_TYPE_SUBMIT: $htmlOptions['type'] = 'submit'; return parent::htmlButton($label, $htmlOptions); case self::BUTTON_TYPE_RESET: $htmlOptions['type'] = 'reset'; return parent::htmlButton($label, $htmlOptions); case self::BUTTON_TYPE_IMAGE: return parent::imageButton($label, $htmlOptions); case self::BUTTON_TYPE_LINKBUTTON: return parent::linkButton($label, $htmlOptions); case self::BUTTON_TYPE_AJAXLINK: return parent::ajaxLink($label, $url, $ajaxOptions, $htmlOptions); case self::BUTTON_TYPE_AJAXBUTTON: $htmlOptions['ajax'] = $ajaxOptions; return parent::htmlButton($label, $htmlOptions); case self::BUTTON_TYPE_INPUTBUTTON: return parent::button($label, $htmlOptions); case self::BUTTON_TYPE_INPUTSUBMIT: $htmlOptions['type'] = 'submit'; return parent::button($label, $htmlOptions); case self::BUTTON_TYPE_LINK: return self::link($label, $url, $htmlOptions); default: throw new CException('Invalid button type "' . $type . '".'); } }
<span class="fa fa-eye"></span> <?php echo Yii::t('main', 'Переглядів'); ?> : <?php echo CHtml::encode($data->views); ?> </p> <h4> <?php echo CHtml::link($data->title, array('/blog/default/post', 'id' => $data->id)); ?> </h4> <?php if (Yii::app()->user->role == 'admin') { ?> <div class="delBlogersAdmin"> <?php echo CHtml::link(Yii::t('main', 'Редагувати') . '<span class="fa fa-pencil"></span>', array('/blog/cabinet/update', 'id' => $data->id)); ?> <?php echo CHtml::ajaxLink(Yii::t('main', 'Видалити') . '<span class="fa fa-trash"></span>', array('/blog/cabinet/delete', 'id' => $data->id), array('beforeSend' => 'function() { $("#maindiv").addClass("loading"); }', 'complete' => 'function(data){ $.fn.yiiListView.update("userList"); }'), array('confirm' => Yii::t('main', 'Ви дійсно хочете видалити пост?'), 'id' => 'post_id_' . $data->id)); ?> </div> <?php } ?> </div>
echo CHtml::checkBox($filterName, $filter, array('onChange' => "toggleCalendarFilter('{$filterName}', {$checked});", 'title' => $title, 'class' => $class)); $filterDisplayName = ucwords($filterName); // capitalize filter name for label echo "<label for=\"{$filterName}\" class=\"{$class}\" title=\"{$title}\">" . Yii::t('calendar', $filterDisplayName) . "</label>"; echo "</li>\n"; } echo "</ul>\n"; $this->endWidget(); } // Group Calendars if (isset($this->groupCalendars) && $this->groupCalendars !== null) { // actionTogglePortletVisible is defined in calendar controller $toggleGroupCalendarsVisibleUrl = $this->createUrl('togglePortletVisible', array('portlet' => 'groupCalendars')); $visible = Yii::app()->params->profile->groupCalendarsVisible; $minimizeLink = CHtml::ajaxLink($visible ? '[–]' : '[+]', $toggleGroupCalendarsVisibleUrl, array('success' => 'function(response) { x2.LayoutManager.togglePortletVisible($("#group-calendar"), response); }')); $this->beginWidget('LeftWidget', array('widgetLabel' => Yii::t('calendar', 'Group {calendars}', array('{calendars}' => Modules::displayName() . "s")), 'widgetName' => 'GroupCalendars', 'id' => 'group-calendar')); $showGroupCalendars = $showCalendars['groupCalendars']; echo '<ul style="font-size: 0.8em; font-weight: bold; color: black;">'; foreach ($this->groupCalendars as $groupId => $groupName) { echo "<li>\n"; // checkbox for each user; current user and Anyone are set to checked echo CHtml::checkBox($groupId, in_array($groupId, $showGroupCalendars), array('onChange' => "toggleGroupCalendarSource(this.name, this.checked);")); echo "<label for=\"{$groupId}\">" . CHtml::encode($groupName) . "</label>\n"; echo "</li>"; } echo "</ul>\n"; $this->endWidget(); if (!$visible) { Yii::app()->clientScript->registerScript('hideGroupCalendars', "\n \$(function() {\n \$('#group-calendar .portlet-content').hide();\n });", CClientScript::POS_HEAD);
echo CHtml::ajaxLink($i, $url, array('update' => $this->ajaxElementId)); ?> </li> <?php } //end for middle number ?> <!--end middle number--> <!--last number--> <?php if ($totalPage > 1) { $selected = $currentPage == $totalPage ? 'class="selected"' : ''; $url = CHtml::encode(Yii::app()->request->baseUrl . '/' . $this->urlPaginator . $totalPage); ?> <li <?php echo $selected; ?> > <?php echo CHtml::ajaxLink($totalPage, $url, array('update' => $this->ajaxElementId)); ?> </li> <?php } ?> <!--end last number--> </ul> </div> <?php }
echo $formInputBaru->error($barang, 'rak_id', array('class' => 'error')); ?> </div> </div> <div class="row"> <div class="span-12 columns"> <?php echo CHtml::ajaxLink('Simpan (Alt+m)', $this->createUrl('tambahbarangbaru', array( 'id' => $pembelianModel->id,)), array( 'type' => 'POST', 'success' => "function (data) { if (data.sukses){ $('#input-barang-baru').slideUp(500); updateFormDetail(data); bersihkanInputBarangBaru(); } else { $('#input-barang-baru h5').html(data.msg); } }" ), array( 'id' => 'tombol-tambah-barang-baru', 'class' => 'tiny bigfont button', 'accesskey' => 'm' )); ?> <a class="tiny bigfont button" id="tombol-batal" href="#" accesskey="l" onclick="$('#input-barang-baru').slideUp(500); bersihkanInputBarangBaru();">Bata<span class="ak">l</span> </a> </div> </div> </div>
/* @var $data SegScheduledTours */ ?> <div class="row" > <div class="col-md-3 col-sm-5 bordered"> <?php $first_cell = CHtml::image(Yii::app()->request->baseUrl . "/image/guide/" . $data->user_ob->guidepic, "User Image", array("class" => "img-circle")) . "<div><div>" . CHtml::encode($data->user_ob->guidename) . "</div><div>"; if ($data->language_id == null) { foreach ($data->user_ob->languages as $value) { $first_cell .= CHtml::image(Yii::app()->request->baseUrl . "/img/lan/" . $value['flagpic'], "Language", array("class" => "img-circle")); } } else { $first_cell .= CHtml::image(Yii::app()->request->baseUrl . "/img/lan/" . $data->language_ob->flagpic, "Language", array("class" => "img-circle")); } $first_cell .= "</div></div>"; echo CHtml::ajaxLink($first_cell, $url = array('ajaxGuide'), $ajaxOptions = array('data' => array('id' => 'js:$(this).attr("href")'), 'type' => 'POST', 'dataType' => 'json', 'success' => "function(data) { \r\n\t\t\t\t if (data.status == 'failure')\r\n {\r\n \$('#modal-data').html(data.div);\r\n }\r\n else\r\n {\r\n \$('#modal-title').html(data.status);\r\n \$('#modal-data').html(data.div);\r\n }\r\n\r\n\t\t\t\t \$('#guideModal').modal(); }"), $htmlOptions = array('href' => 'gid=' . $data->user_ob->id . ';', "class" => "guideclick", "data-toggle" => "modal", "data-target" => "#guideModal")); // echo CHtml::link($first_cell, 'js:gid='.$data->user_ob->id.';', array("class"=>"guideclick", "data-toggle"=>"modal", "data-target"=>"#guideModal")); ?> </div> <div class="col-md-4 cl-sm-7 bordered item-dates"> <div> <?php echo CHtml::image(Yii::app()->request->baseUrl . '/img/svg/svg-export_calendar.svg', 'calendar', array('style' => 'height: 35px;margin:5px 0 5px;')); echo '<div style="padding-top:5px; display:inline-block;">' . CHtml::encode(date('l, d F Y', $data->date_now)) . "</div>"; ?> </div> <div> <?php echo CHtml::image(Yii::app()->request->baseUrl . '/img/svg/svg-export_time.svg', 'time', array('style' => 'height: 35px;')); echo CHtml::encode(substr_replace($data->starttime, '', 5)); ?>
echo date("F j", strtotime($practica->practica->FechaVencimientoPlaza)); ?> </li> </ul> <p><?php echo substr(ucwords(strtolower($practica->practica->ObjetivoDelCargo)), 0, 105) . "..."; ?> </p> <ul class="list-inline block-grid-v1-add pull-right "> <?php if (!Yii::app()->user->isGuest) { ?> <li><?php echo CHtml::ajaxLink($text = '<i class="fa fa-eye"></i> Agregar', $url = array('UsuarioEstudiante/AgregarPracticaAEscritorio'), $ajaxOptions = array('type' => 'POST', 'data' => array('idPractica' => $practica->practica->IdPracticaProfesional)), $htmlOptions = array()); ?> </li> <?php } ?> <li><a href="#"><i class="fa fa-thumbs-o-up"></i> Like</a></li> </ul> </div> </div> </li>