Explorar el Código

#2642 FontAwesome: display version in module settings

Alex Trofimov hace 6 años
padre
commit
6546a936fe

+ 36 - 0
modules/boonex/fontawesome/classes/BxFontAwesomeStudioPage.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    FontAwesome Font Awesome Pro integration
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFontAwesomeStudioPage extends BxTemplStudioModule
+{
+    function __construct($sModule = "", $sPage = "")
+    {
+        parent::__construct($sModule, $sPage);
+
+        $this->aMenuItems = array(
+            array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
+        );
+    }
+    
+    function getSettings ()
+    {
+        $sHtml = '';
+        $oModule = BxDolModule::getInstance('bx_fontawesome');
+        if ($oModule) {
+            $s = file_get_contents(BX_DIRECTORY_PATH_MODULES . 'boonex/fontawesome/template/css/icons.css');
+            if (preg_match('/(Font.+?\d+\.\d+.\d+)/', $s, $m))
+                $sHtml = $oModule->_oTemplate->parsePageByName('ver.html', array('ver' => $m[1]));
+        }
+        return $sHtml . parent::getSettings ();
+    }
+}
+
+/** @} */

+ 1 - 0
modules/boonex/fontawesome/template/ver.html

@@ -0,0 +1 @@
+<div class="bx-def-font-small bx-def-font-grayed bx-def-margin-sec-bottom">__ver__</div>