File indexing completed on 2024-06-16 05:26:53

0001 <?php
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 class Backend_View_Helper_DatatableButtons extends Zend_View_Helper_Abstract
0023 {
0024 
0025     public function datatableButtons($id = "", $button = "", $path = "")
0026     {
0027         $button = trim($button);
0028 
0029         if ($path != "#") {
0030             $path = $path . $id;
0031         }
0032         switch ($button) {
0033             case 'preview':
0034                 $this->getPreviewButton($id);
0035                 break;
0036             case 'edit':
0037 
0038                 $this->getEditButton($id, $path);
0039                 break;
0040             case 'activate':
0041                 $this->getActivateButton($id);
0042                 break;
0043             case 'deactivate':
0044                 $this->getDeactivateButton($id);
0045                 break;
0046             case 'delete':
0047                 $this->getDeleteButton($id);
0048                 break;
0049             case 'add':
0050                 $this->getAddButton($id, $path);
0051                 break;
0052             case 'link':
0053                 $this->getTagButton($id, $path);
0054                 break;
0055             case 'wrench':
0056                 $this->getWrenchButton($id, $path);
0057                 break;
0058             case 'image':
0059                 $this->getImageButton($id, $path);
0060                 break;
0061             case 'newdate':
0062                 $this->getDateButton($id, $path);
0063                 break;
0064             case 'close':
0065                 $this->getCloseButton($id, $path);
0066                 break;
0067         }
0068 
0069     }
0070 
0071     function getPreviewButton($id)
0072     {
0073         print "<a href='#' title='vorschau' class='previewLink'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-document'></span></div></a>\n";
0074     }
0075 
0076     function getEditButton($id, $path = "#")
0077     {
0078         print "<a href='" . $path . "' title='bearbeiten'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-pencil'></span></div></a>\n";
0079     }
0080 
0081     function getActivateButton($id)
0082     {
0083         print "<a href='#' title='deaktivieren' style='display: none;'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-cancel'></span></div></a>\n";
0084         print "<a href='#' title='aktivieren'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-check'></span></div></a>\n";
0085     }
0086 
0087     function getDeactivateButton($id)
0088     {
0089         print "<a href='#' title='deaktivieren'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-cancel'></span></div></a>\n";
0090         print "<a href='#' title='aktivieren' style='display: none;'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-check'></span></div></a>\n";
0091     }
0092 
0093     function getDeleteButton($id)
0094     {
0095         print "<a href='#' title='l&ouml;schen'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-trash'></span></div></a>\n";
0096     }
0097 
0098     function getAddButton($id, $path = "#")
0099     {
0100         print "<a href='$path' title='hinzuf&uuml;gen'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plus'></span></div></a>\n";
0101     }
0102 
0103     function getTagButton($id, $path = "#")
0104     {
0105         print "<a href='$path' title='Mit Seite verknüpfen'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-link'></span></div></a>\n";
0106     }
0107 
0108     function getWrenchButton($id, $path = "#")
0109     {
0110         print "<a href='$path' title='Seitenverknüpfung ändern'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-wrench'></span></div></a>\n";
0111     }
0112 
0113     function getImageButton($id, $path = "#")
0114     {
0115         print "<a href='$path' title='bilder anzeigen'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-image'></span></div></a>\n";
0116     }
0117 
0118     function getDateButton($id, $path = "#")
0119     {
0120         print "<a href='$path' title='Neuen Termin eintragen'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-calendar'></span></div></a>\n";
0121     }
0122 
0123     function getCloseButton($id, $path = "#")
0124     {
0125         print "<a href='$path' title='Ist ausgebucht'><div id='" . $id . "' class='alexIcon ui-state-default ui-corner-all'><span class='ui-icon ui-icon-closethick'></span></div></a>\n";
0126     }
0127 
0128 }