Commits

Sam Stenvall committed e278876 Merge

Merge with 1.0.0-wip

  • Participants
  • Parent commits 92e62dd, 127be88
  • Branches BootWysiwyg

Comments (0)

Files changed (10)

demo/protected/extensions/facebook/components/FacebookConnect.php

 	/**
 	 * Calls the Facebook API.
 	 * @param string $query the query to send.
-	 * @param array $params the query paramters.
+	 * @param array $params the query parameters.
 	 * @return array the response.
 	 */
 	public function api($query, $params=array())
 
 	/**
 	 * Returns the Facebook application instance.
-	 * @return Facebook the instance
+	 * @return Facebook the instance.
 	 */
 	public function getFacebook()
 	{

demo/protected/views/site/index.php

 	<h2>Modals</h2>
 
 	<?php $this->beginWidget('bootstrap.widgets.BootModal', array(
-		'id'=>'modal',
+		'id'=>'myModal',
 		'events'=>array(
 			'show'=>"js:function() { console.log('Modal show.'); }",
 			'shown'=>"js:function() { console.log('Modal shown.'); }",
 	<?php $this->endWidget(); ?>
 
 	<div class="well">
-		<?php echo CHtml::link('Click me','#modal', array(
+		<?php echo CHtml::link('Click me','#myModal', array(
 			'class'=>'btn btn-primary',
 			'data-toggle'=>'modal',
 		)); ?>
 
 	<h4>Source code</h4>
 
-<?php echo $phpLighter->highlight("<?php \$this->beginWidget('bootstrap.widgets.BootModal', array('id'=>'modal')); ?>
+<?php echo $phpLighter->highlight("<?php \$this->beginWidget('bootstrap.widgets.BootModal', array('id'=>'myModal')); ?>
 
 <div class=\"modal-header\">
 	<a class=\"close\" data-dismiss=\"modal\">&times;</a>
 
 <?php \$this->endWidget(); ?>
 
-<?php echo CHtml::link('Click me','#modal', array('class'=>'btn btn-primary', 'data-toggle'=>'modal')); ?>"); ?>
+<?php echo CHtml::link('Click me','#myModal', array('class'=>'btn btn-primary', 'data-toggle'=>'modal')); ?>"); ?>
 
 	<a class="top" href="#top">Back to top &uarr;</a>
 

gii/bootstrap/templates/default/_form.php

 		)); ?>\n"; ?>
 	</div>
 
-<?php echo "<?php \$this->endWidget(); ?>\n"; ?>
+<?php echo "<?php \$this->endWidget(); ?>\n"; ?>

widgets/BootDropdown.php

 				continue;
 			}
 
+			if (!is_array($item)) {
+				continue;
+			}
+
 			if (!isset($item['label']))
 				$item['label'] = '';
 

widgets/BootMenu.php

 				continue;
 			}
 
+			if (!is_array($item)) {
+				continue;
+			}
+
 			if (!isset($item['label']))
 				$item['label'] = '';
 

widgets/BootNavbar.php

 	 */
 	public $items = array();
 	/**
-	 * @var string fix location of the navbar if applicable. Valid values are 'top' and 'bottom'. Defaults to 'top'.
+	 * @var mixed fix location of the navbar if applicable.
+	 * Valid values are 'top' and 'bottom'. Defaults to 'top'.
+	 * Setting the value to false will make the navbar static.
 	 * @since 0.9.8
 	 */
 	public $fixed = self::FIXED_TOP;
 	{
 		$classes = array('navbar');
 
-		$validFixes = array(self::FIXED_TOP, self::FIXED_BOTTOM);
-
-		if (in_array($this->fixed, $validFixes))
-			$classes[] = 'navbar-fixed-'.$this->fixed;
+		if ($this->fixed !== false)
+		{
+			$validFixes = array(self::FIXED_TOP, self::FIXED_BOTTOM);
+			if (in_array($this->fixed, $validFixes))
+				$classes[] = 'navbar-fixed-'.$this->fixed;
+		}
 
 		$classes = implode(' ', $classes);
 		if (isset($this->htmlOptions['class']))

widgets/input/BootInput.php

 	 */
 	protected function getContainerCssClass()
 	{
-		if ($this->model->hasErrors($this->attribute))
+		if ($this->model->hasErrors(CHtml::resolveName($this->model, $this->attribute)))
 			return CHtml::$errorCss;
 		else
 			return '';

widgets/input/BootInputHorizontal.php

 	 */
 	protected function checkBox()
 	{
+		$attribute = $this->attribute;
 		echo '<div class="controls">';
-		echo '<label class="checkbox" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $this->attribute)).'">';
-		echo $this->form->checkBox($this->model, $this->attribute, $this->htmlOptions).PHP_EOL;
-		echo $this->model->getAttributeLabel($this->attribute);
+		echo '<label class="checkbox" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $attribute)).'">';
+		echo $this->form->checkBox($this->model, $attribute, $this->htmlOptions).PHP_EOL;
+		echo $this->model->getAttributeLabel($attribute);
 		echo $this->getError().$this->getHint();
 		echo '</label></div>';
 	}
 	{
 		echo $this->getLabel();
 		echo '<div class="controls">';
+		echo $this->getPrepend();
 		echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions);
+		echo $this->getAppend();
 		echo $this->getError().$this->getHint();
 		echo '</div>';
 	}
 	 */
 	protected function radioButton()
 	{
+		$attribute = $this->attribute;
 		echo '<div class="controls">';
-		echo '<label class="radio" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $this->attribute)).'">';
-		echo $this->form->radioButton($this->model, $this->attribute, $this->htmlOptions).PHP_EOL;
-		echo $this->model->getAttributeLabel($this->attribute);
+		echo '<label class="radio" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $attribute)).'">';
+		echo $this->form->radioButton($this->model, $attribute, $this->htmlOptions).PHP_EOL;
+		echo $this->model->getAttributeLabel($attribute);
 		echo $this->getError().$this->getHint();
 		echo '</label></div>';
 	}

widgets/input/BootInputSearch.php

 	 */
 	protected function textField()
 	{
+		$classes = 'search-query';
 		if (isset($this->htmlOptions['class']))
-			$this->htmlOptions['class'] .= ' search-query';
+			$this->htmlOptions['class'] .= ' '.$classes;
 		else
-			$this->htmlOptions['class'] = 'search-query';
+			$this->htmlOptions['class'] = $classes;
 
 		$this->htmlOptions['placeholder'] = $this->model->getAttributeLabel($this->attribute);
 		echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);

widgets/input/BootInputVertical.php

 	 */
 	protected function checkBox()
 	{
-		echo '<label class="checkbox" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $this->attribute)).'">';
+		$attribute = $this->attribute;
+		echo '<label class="checkbox" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $attribute)).'">';
 		echo $this->form->checkBox($this->model, $this->attribute, $this->htmlOptions).PHP_EOL;
-		echo $this->model->getAttributeLabel($this->attribute);
+		echo $this->model->getAttributeLabel($attribute);
 		echo $this->getError().$this->getHint();
 		echo '</label>';
 	}
 	protected function passwordField()
 	{
 		echo $this->getLabel();
+		echo $this->getPrepend();
 		echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions);
+		echo $this->getAppend();
 		echo $this->getError().$this->getHint();
 	}
 
 	 */
 	protected function radioButton()
 	{
-		echo '<label class="radio" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $this->attribute)).'">';
+		$attribute = $this->attribute;
+		echo '<label class="radio" for="'.CHtml::getIdByName(CHtml::resolveName($this->model, $attribute)).'">';
 		echo $this->form->radioButton($this->model, $this->attribute, $this->htmlOptions).PHP_EOL;
-		echo $this->model->getAttributeLabel($this->attribute);
+		echo $this->model->getAttributeLabel($attribute);
 		echo $this->getError().$this->getHint();
 		echo '</label>';
 	}