Exemple #1
0
 /**
  * @inheritdoc
  */
 public function clientLink($client, $text = null, array $htmlOptions = array())
 {
     $viewOptions = $client->getViewOptions();
     if (isset($viewOptions['widget'])) {
         parent::clientLink($client, $text, $htmlOptions);
         return;
     }
     if (isset($viewOptions['buttonBackgroundColor'])) {
         $textColor = isset($viewOptions['buttonColor']) ? $viewOptions['buttonColor'] : '#FFF';
         $btnStyle = Html::cssStyleFromArray(['color' => $textColor . '!important', 'background-color' => $viewOptions['buttonBackgroundColor'] . '!important']);
         $btnClasses = '.btn-ac-' . $client->getName() . ', .btn-ac-' . $client->getName() . ':hover, .btn-ac-' . $client->getName() . ':active, .btn-ac-' . $client->getName() . ':visited';
         if ($this->showButtonColors) {
             echo Html::style($btnClasses . ' {' . $btnStyle . '}');
         }
     }
     if (!isset($htmlOptions['class'])) {
         $htmlOption['class'] = '';
     }
     $htmlOptions['class'] .= ' ' . 'btn btn-default btn-ac-' . $client->getName();
     $icon = isset($viewOptions['cssIcon']) ? '<i class="' . $viewOptions['cssIcon'] . '" aria-hidden="true"></i>' : '';
     echo parent::clientLink($client, $icon . $client->getTitle(), $htmlOptions);
     return;
     parent::clientLink($client, $text, $htmlOptions);
 }