Icon erstellen

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • Icon erstellen

      Habe versucht ein Icon (relais) nach der Anleitung von Dieterwo anzulegen.
      Zuvor habe ich ein Relaisbild mit Dateityp jpg und einer Grösse von ca. 18KB besorgt.
      Dann habe ich mit IconFX die Datei angepasst, jetzt hat es eine Grösse von 32x32 und 1,8 KB.
      Nach einhaltung der Anleitung kann ich leider nicht das Icon von Schaltelement ändern.
      Es erscheint nur eine weisse Weboberflache nach drücken auf bearbeiten.
      Nach rückgängig machen der Anleitung habe ich wieder Zugriff auf Bearbeiten.

      Quellcode

      1. Also als erstes entwirfst du dein Icon und legst das unter /shc/inc/img/switchables mit einem sinnvollen Namen ab. Ich würde ich dort an die Namenkonventionen halten.
      2. Dann in der /shc/inc/style/web/all/9-icons.css
      3. einen span-Abschnitt hinzufügen von z.B. für Schaltbare Elemente
      4. unter /* Icons fuer Schaltbare Elemente */
      5. [code=php]span.shc-icon-myicon{
      6. background-image: url(../../../img/switchables/myicon.png);
      7. }
      8. [/php]
      9. Dann in der /shc/shc/lib/form/formelements/iconchooser.class.php
      10. das array um eine Zeile erweitern:
      11. [code=php]'shc-icon-myicon' => array('shc-icon-myicon', ($icon == 'shc-icon-myicon' ? 1: 0))
      12. [/php]
      13. je nach dem, wo du die Zeile einfügst mußt noch am Ende, oder in der Zeile davor am Ende ein Komma setzen.
      14. Vielleicht machst du dir vorher von den Dateien eine Sicherheitskopie. Und ggf. im Browser reload/aktualisieren nicht vergessen
      Alles anzeigen
    • So sah es in iconchooser aus.
      Zeile 50

      PHP-Quellcode

      1. <?php
      2. namespace SHC\Form\FormElements;
      3. //Imports
      4. use RWF\Form\FormElements\Select;
      5. use SHC\Core\SHC;
      6. /**
      7. * Auswahlfeld des Icons
      8. *
      9. * @author Oliver Kleditzsch
      10. * @copyright Copyright (c) 2014, Oliver Kleditzsch
      11. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
      12. * @since 2.0.0-0
      13. * @version 2.0.0-0
      14. */
      15. class IconChooser extends Select {
      16. public function __construct($name, $icon = null) {
      17. //Allgemeine Daten
      18. $this->setName($name);
      19. $this->setOptions(array('grouped' => true));
      20. //Gruppen anmelden
      21. $values = array(
      22. SHC::getLanguage()->get('acp.switchableManagement.switchables') => array(
      23. 'shc-icon-lamp' => array('shc-icon-lamp', ($icon == 'shc-icon-lamp' ? 1 : 0)),
      24. 'shc-icon-flashlight' => array('shc-icon-flashlight', ($icon == 'shc-icon-flashlight' ? 1 : 0)),
      25. 'shc-icon-power' => array('shc-icon-power', ($icon == 'shc-icon-power' ? 1 : 0)),
      26. 'shc-icon-socket' => array('shc-icon-socket', ($icon == 'shc-icon-socket' ? 1 : 0)),
      27. 'shc-icon-countdown' => array('shc-icon-countdown', ($icon == 'shc-icon-countdown' ? 1 : 0)),
      28. 'shc-icon-chip' => array('shc-icon-chip', ($icon == 'shc-icon-chip' ? 1 : 0)),
      29. 'shc-icon-clock' => array('shc-icon-clock', ($icon == 'shc-icon-clock' ? 1 : 0)),
      30. 'shc-icon-monitor' => array('shc-icon-monitor', ($icon == 'shc-icon-monitor' ? 1 : 0)),
      31. 'shc-icon-nas' => array('shc-icon-nas', ($icon == 'shc-icon-nas' ? 1 : 0)),
      32. 'shc-icon-printer' => array('shc-icon-printer', ($icon == 'shc-icon-printer' ? 1 : 0)),
      33. 'shc-icon-tv' => array('shc-icon-tv', ($icon == 'shc-icon-tv' ? 1 : 0)),
      34. 'shc-icon-waterBoiler' => array('shc-icon-waterBoiler', ($icon == 'shc-icon-waterBoiler' ? 1 : 0)),
      35. 'shc-icon-coffee' => array('shc-icon-coffee', ($icon == 'shc-icon-coffee' ? 1 : 0)),
      36. 'shc-icon-rhythmbox' => array('shc-icon-rhythmbox', ($icon == 'shc-icon-rhythmbox' ? 1 : 0)),
      37. 'shc-icon-christmasTree' => array('shc-icon-christmasTree', ($icon == 'shc-icon-christmasTree' ? 1 : 0)),
      38. 'shc-icon-candles' => array('shc-icon-candles', ($icon == 'shc-icon-candles' ? 1 : 0)),
      39. 'shc-icon-christmasLights' => array('shc-icon-christmasLights', ($icon == 'shc-icon-christmasLights' ? 1 : 0)),
      40. 'shc-icon-star' => array('shc-icon-star', ($icon == 'shc-icon-star' ? 1 : 0)),
      41. 'shc-icon-rollo' => array('shc-icon-rollo', ($icon == 'shc-icon-rollo' ? 1 : 0)),
      42. 'shc-icon-camera' => array('shc-icon-camera', ($icon == 'shc-icon-camera' ? 1 : 0)),
      43. 'shc-icon-camera2' => array('shc-icon-camera2', ($icon == 'shc-icon-camera2' ? 1 : 0))
      44. 'shc-icon-relais' => array('shc-icon-relais', ($icon == 'shc-icon-relais' ? 1 : 0))
      45. ),
      46. SHC::getLanguage()->get('acp.switchableManagement.sensors') => array(
      47. 'shc-icon-ds18x20' => array('shc-icon-ds18x20', ($icon == 'shc-icon-ds18x20' ? 1 : 0)),
      48. 'shc-icon-dht' => array('shc-icon-dht', ($icon == 'shc-icon-dht' ? 1 : 0)),
      49. 'shc-icon-bmp' => array('shc-icon-bmp', ($icon == 'shc-icon-bmp' ? 1 : 0)),
      50. 'shc-icon-rain' => array('shc-icon-rain', ($icon == 'shc-icon-rain' ? 1 : 0)),
      51. 'shc-icon-hygrometer' => array('shc-icon-hygrometer', ($icon == 'shc-icon-hygrometer' ? 1 : 0)),
      52. 'shc-icon-ldr' => array('shc-icon-ldr', ($icon == 'shc-icon-ldr' ? 1 : 0)),
      53. 'shc-icon-avmPowerSensor' => array('shc-icon-avmPowerSensor', ($icon == 'shc-icon-avmPowerSensor' ? 1 : 0)),
      54. 'shc-icon-edimaxPowerSensor' => array('shc-icon-edimaxPowerSensor', ($icon == 'shc-icon-edimaxPowerSensor' ? 1 : 0)),
      55. 'shc-icon-gasmeter' => array('shc-icon-gasmeter', ($icon == 'shc-icon-gasmeter' ? 1 : 0)),
      56. 'shc-icon-hcsr04' => array('shc-icon-hcsr04', ($icon == 'shc-icon-hcsr04' ? 1 : 0)),
      57. 'shc-icon-sct013' => array('shc-icon-sct013', ($icon == 'shc-icon-sct013' ? 1 : 0)),
      58. 'shc-icon-cometThermostat' => array('shc-icon-cometThermostat', ($icon == 'shc-icon-cometThermostat' ? 1 : 0)),
      59. 'shc-icon-watermeter' => array('shc-icon-watermeter', ($icon == 'shc-icon-watermeter' ? 1 : 0))
      60. )
      61. );
      62. $this->setValues($values);
      63. }
      64. }
      Alles anzeigen