How to add popovers tooltip in tagsinput? - bootstrap-tags-input

I am trying to add popovers tooltip in tagsinput text field. But its not working.
Here is my code:
<div class="form-group"><!-- form-group -->
<div class="col-lg-6" id="prefix_value_div_error" style="display:none">
<?php echo $form->labelEx($model,'prefix_value', array('class'=>'col-lg-4 control-label')); ?>
<div class="col-lg-7">
<?php echo $form->textField($model,'prefix_value',array('class'=>'form-control tagsinput popovers','id'=>'prefix_value',"data-placement"=>"top","data-content"=>Yii::t('app','model.callThresholdPlanMaster.prefix_value.desc') ,"data-trigger"=>"hover", "data-original-title"=>Yii::t('app','model.callThresholdPlanMaster.prefix_value'))); ?>
<div id="prefix_value_error">
<?php echo $form->error($model,'prefix_value'); ?>
</div>
</div>
</div>
</div>

Related

open dialog using CButtonColumn in yii 1.1

i have used CButtonColumn inside TbGridView.On click of button i want a dialog from where i want to send mail to recepient.
My admin.php code:
array(
'class'=>'CButtonColumn',
'template'=>'{dialog}',
'buttons'=>array(
'dialog' => array(
'label'=>'Email',
'imageUrl'=>Yii::app()->request->baseUrl.'/images/email_envelope.png',
'url'=>'Yii::app()->createUrl("todoList/OpenMailDialog", array("id"=>$data->to_do_id))',
'options'=>array(
'ajax'=>array(
'type'=>'POST',
'url'=>"js:$(this).attr('href')",
'update'=>'#dialog_id',
),
),
),
),
),
<div class="dialog_id" style="display:none;"></div>
My controller code is:
public function actionOpenMailDialog($id){
$model=$this->loadModel($id);
$this->render('createDialog',array('model'=>$model,));
}
My view code is:
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
'id'=>'mailDialog',
'options'=>array(
'title'=>'View Message #'. $model->id,
'autoOpen'=>true,
'modal'=>'true',
'width'=>'auto',
'height'=>'auto',
),
));
echo $this->renderPartial('_formDialog', array('model'=>$model)); ?>
<?php $this->endWidget('zii.widgets.jui.CJuiDialog');?>
My _formDialog:
<div class="form" id="mailDialogForm">
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row col2">
<?php echo $form->labelEx($model,'email_from'); ?>
<?php echo $form->textField($model,'email_from',array('size'=>50,'maxlength'=>50,'readonly'=>'readonly')); ?>
<?php echo $form->error($model,'email_from'); ?>
</div>
<div class="row col2">
<?php echo $form->labelEx($model,'email_to'); ?>
<?php echo $form->textField($model,'email_to',array('size'=>60,'maxlength'=>150)); ?>
<?php echo $form->error($model,'email_to'); ?>
</div>
<div style="clear:both"></div>
<div class="row col2">
<?php echo $form->labelEx($model,'subject'); ?>
<?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>250)); ?>
<?php echo $form->error($model,'subject'); ?>
</div>
<div style="clear:both"></div>
<div class="row">
<?php echo $form->labelEx($model,'message'); ?>
<?php echo $form->textArea($model,'message',array('rows'=>6, 'cols'=>50)); ?>
<?php echo $form->error($model,'message'); ?>
</div>
<div style="clear:both"></div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ?
'Send' :'Send',array('class' => 'btn')); ?>
</div>
I am not able to pop up dialog here.What is the solution?
i simply chaged my code like this and its working now.My admin.php code is like this:
array(
'class'=>'CButtonColumn',
'template'=>'{dialog}',
'buttons'=>array(
'dialog' => array(
'label'=>'Email',
'imageUrl'=>Yii::app()->request->baseUrl.'/images/email_envelope.png',
'visible'=>'$data->user_id===Yii::app()->user->id?false:true',
'url'=>'Yii::app()->createUrl("todoList/openMailDialog", array("id"=>$data->to_do_id))',
),
),
),
My _formDialog.php code:
<div id="mailDialogForm">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'mail-form',
'enableAjaxValidation'=>true,
));
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="rowcol">
<?php echo $form->labelEx($model,'email_from'); ?>
<?php echo $form->textField($model,'email_from',array('size'=>50,'maxlength'=>50,'readonly'=>'readonly')); ?>
<?php echo $form->error($model,'email_from'); ?>
</div>
<div class="rowcol">
<?php echo $form->labelEx($model,'email_to'); ?>
<?php echo $form->textField($model,'email_to',array('size'=>60,'maxlength'=>150,'readonly'=>'readonly')); ?>
<?php echo $form->error($model,'email_to'); ?>
</div>
<div style="clear:both"></div>
<div >
-----------------
</div>
<div class="rowbutton">
<?php echo CHtml::submitButton($model->isNewRecord ?
'Send' :'Send',array('class' => 'btn')); ?>
</div>
<?php $this->endWidget(); ?>
</div>

In Bootstrap can I create a data-target name on the fly?

I am new to Bootstrap and trying to create a unique data-target name for each record in my database. Can this be done in Bootstrap?
My code looks like this:
$i = 0;
while($row=mysql_fetch_array($result, MYSQL_ASSOC))
{
ob_start();
echo "
<div class='container'>
<div class='row features container-fluid'>
<div class='row'>
<div class='well-sm'>
<div class='thumbnail'>
<div class='caption'>
Name: $tempname</br>
<button type='button' class='btn btn-sm btn-info'
data-toggle='collapse' data-target='#demo[$i]'>
click for details</button>
<div id='demo[$i]' class='collapse'>$tempdescription</div>
</div>
</div>
</div>
</div>
</div>
</div>
";
$classdata = ob_get_contents();
ob_end_clean();
$i++;
?>
<div class="more-less">
<div class="more-block">
<?php echo $classdata ?>
</div>
</div>
<?php
}

Create sidebar in yii framework

how to create dynamic sidebar in yii framework:
<?php $this->beginContent('//layouts/main'); ?>
<div id="content">
<?php echo $content; ?>
</div><!-- content -->
<?php $this->endContent(); ?>
look like:
<?php $this->beginContent('//layouts/main'); ?>
<div id="content">
<?php echo $content; ?>
<div id="sidebar">
<?php echo $sidebar; ?>
</div>
</div><!-- content -->
<?php $this->endContent(); ?>
I don't know if this answer is actual, but maybe somebody will help http://www.yiiframework.com/wiki/127/dynamic-sidebar-using-cclipwidget/

CI Bonfire uploading in modules

Trying to have an upload button in one of my modules... First thing, the view in the browser is messed since cannot see the physical button...
Anyone done this to help out?
Below is my view code...
<?php echo form_open_multipart($this->uri->uri_string(), 'class="form-horizontal"'); ?>
<fieldset>
<div class="control-group <?php echo form_error('products_product_title') ? `enter code here`'error' : ''; ?>">
<?php echo form_label('Product Title'. lang('bf_form_label_required'), 'products_product_title', array('class' => "control-label") ); ?>
<div class='controls'>
<input id="products_product_title" type="text" name="products_product_title" maxlength="50" value="<?php echo set_value('products_product_title', isset($products['products_product_title']) ? $products['products_product_title'] : ''); ?>" />
<span class="help-inline"><?php echo form_error('products_product_title'); ?></span>
</div>
<div class="control-group <?php echo form_error('products_product_path') ? 'error' : ''; ?>">
<?php echo form_label('Upload Card'. lang('bf_form_label_required'), 'products_product_path', array('class' => "control-label") ); ?>
<div class='controls'>
<input id="products_product_path" type="submit" name="submit_form" value="<?php echo set_value('products_product_path', isset($products['products_product_path']) ? $products['products_product_path'] : ''); ?>" />
<span class="help-inline"><?php echo form_error('products_product_path'); ?></span>
</div>
</div>
<div class="form-actions">
<br/>
<input type="submit" name="save" class="btn btn-primary" value="Create products" />
or <?php echo anchor(SITE_AREA .'/developer/products', lang('products_cancel'), 'class="btn btn-warning"'); ?>
</div>
</fieldset>
<?php echo form_close(); ?>
You're missing a close near the top, which is probably affecting it.
<fieldset>
<div class="control-group <?php echo form_error('products_product_title') ? `enter code here`'error' : ''; ?>">
<?php echo form_label('Product Title'. lang('bf_form_label_required'), 'products_product_title', array('class' => "control-label") ); ?>
<div class='controls'>
<input id="products_product_title" type="text" name="products_product_title" maxlength="50" value="<?php echo set_value('products_product_title', isset($products['products_product_title']) ? $products['products_product_title'] : ''); ?>" />
<span class="help-inline"><?php echo form_error('products_product_title'); ?></span>
</div>
</div> <!-- this div needs to be added -->
You close each control-group, before adding another control.
In Bonfire Ajax call, you can simply use class='ajax-form' in the open tag of yout form. so it should be
<?php echo form_open_multipart($this->uri->uri_string(), 'class="ajax-form"'); ?>
reference:
AJAX in Bonfire

Randomise friend's list widget

i have been on this for a few hours,
I want to randomise the result and there has been not provision to do that from the backend.
<?php foreach( $this->friends as $membership ):
if( !isset($this->friendUsers[$membership->resource_id]) ) continue;
$member = $this->friendUsers[$membership->resource_id];
?>
<li id="user_friend_<?php echo $member->getIdentity() ?>">
<?php echo $this->htmlLink($member->getHref(), $this->itemPhoto($member, 'thumb.icon'), array('class' => 'profile_friends_icon')) ?>
<div class='profile_friends_body'>
<div class='profile_friends_status'>
<span>
<?php echo $this->htmlLink($member->getHref(), $member->getTitle()) ?>
</span>
<?php //echo $member->status; ?>
</div>
<?php if( $this->viewer()->isSelf($this->subject()) && Engine_Api::_()->getApi('settings', 'core')->getSetting('user.friends.lists')): // BEGIN LIST CODE ?>
<div class='profile_friends_lists' id='user_friend_lists_<?php echo $member->user_id ?>'>
<span class="pulldown" style="display:inline-block;" onClick="toggleFriendsPulldown(event, this, '<?php echo $member->user_id ?>');">
<div class="pulldown_contents_wrapper">
<div class="pulldown_contents">
<ul>
<?php foreach( $this->lists as $list ):
$inList = in_array($list->list_id, (array)#$this->listsByUser[$member->user_id]);
?>
<li class="<?php echo ( $inList !== false ? 'friend_list_joined' : 'friend_list_unjoined' ) ?> user_profile_friend_list_<?php echo $list->list_id ?>" onclick="handleFriendList(event, $(this), '<?php echo $member->user_id ?>', '<?php echo $list->list_id ?>');">
<span>
x
</span>
<div>
<?php echo $list->title ?>
</div>
</li>
<?php endforeach; ?>
<li>
<input type="text" title="<?php echo $this->translate('New list...') ?>" onclick="new Event(event).stop();" onkeypress="if( new Event(event).key == 'enter' ) { createFriendList(event, $(this), '<?php echo $member->user_id ?>'); }" />
</li>
</ul>
</div>
</div>
<?php echo $this->translate('add to list') ?>
</span>
</div>
<?php endif; // END LIST CODE ?>
</div>
<div class='profile_friends_options'>
<?php echo $this->userFriendship($member) ?>
</div>
</li>
and need to randomise the result..
I have tried using the
rand()
but that seem abortive.
Any help please