Example #1
0
 /**
  * Count required tab separator elements.
  *
  * @param \Database\Result $model  Current row.
  * @param Helper           $helper Wrapper helper.
  *
  * @return int
  */
 public function countRequiredTabSeparators(\Database\Result $model, Helper $helper)
 {
     if (!$helper->isTypeOf(Helper::TYPE_START)) {
         $model = \ContentModel::findByPk($model->bootstrap_parentId);
     }
     $tabs = array();
     if ($model->bootstrap_tabs) {
         $tabs = deserialize($model->bootstrap_tabs, true);
     } elseif (\Input::post('bootstrap_tabs')) {
         $tabs = \Input::post('bootstrap_tabs');
     }
     $count = 0;
     foreach ($tabs as $tab) {
         if ($tab['type'] != 'dropdown') {
             $count++;
         }
     }
     return $count > 0 ? $count - 1 : 0;
 }