Example #1
0
 /**
  * Return the "toggle visibility" button
  * @param array
  * @param string
  * @param string
  * @param string
  * @param string
  * @param string
  * @return string
  */
 public function toggleIcon($row, $href, $label, $title, $icon, $attributes)
 {
     $objMember = \MemberModel::findByPk($row['id']);
     $href .= '&id=' . $row['id'];
     $arrDB = \Database::getInstance()->prepare("SELECT * FROM tl_abo as a, tl_abo_order as o WHERE o.memberId = ? and o.aboId = a.id")->execute($row['id'])->fetchAssoc();
     if ($arrDB) {
         $icon = 'system/modules/abonnement/html/abo.png';
         $title = "Abo: " . $arrDB['title'] . '<br>';
     } else {
         $icon = 'system/modules/abonnement/html/abo_none.png';
         $title = 'Derzeit kein Abo laufen!<br>';
     }
     foreach (deserialize($objMember->groups, true) as $intGroupId) {
         $objGroup = MemberGroupModel::findByPk($intGroupId);
         $title .= "<br>" . $objGroup->name;
     }
     return '<a href="' . $this->addToUrl('do=member&' . $href) . '" title="' . specialchars($title) . '"' . $attributes . '>' . $this->generateImage($icon, $label) . '</a> ';
 }