コード例 #1
0
ファイル: smartblog.php プロジェクト: johnulist/smartblog
    public function getContent()
    {
        $feed_url = _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/smartblog/rss.php';
        $feed_url_html = '<div class="row">
		<div class="alert alert-info"><strong>Feed URL: </strong>' . $feed_url . '</div>
	</div>';
        $html = '';
        $this->autoregisterhook('moduleRoutes', 'smartblog');
        $this->autoregisterhook('vcBeforeInit', 'smartlegendaaddons');
        if (Tools::isSubmit('savesmartblog')) {
            Configuration::updateValue('smartblogmetatitle', Tools::getvalue('smartblogmetatitle'));
            Configuration::updateValue('smartenablecomment', Tools::getvalue('smartenablecomment'));
            Configuration::updateValue('smartenableguestcomment', Tools::getvalue('smartenableguestcomment'));
            Configuration::updateValue('smartblogmetakeyword', Tools::getvalue('smartblogmetakeyword'));
            Configuration::updateValue('smartblogmetadescrip', Tools::getvalue('smartblogmetadescrip'));
            Configuration::updateValue('smartpostperpage', Tools::getvalue('smartpostperpage'));
            Configuration::updateValue('smartblogurlpattern', Tools::getvalue('smartblogurlpattern'));
            Configuration::updateValue('smartacceptcomment', Tools::getvalue('smartacceptcomment'));
            Configuration::updateValue('smartcaptchaoption', Tools::getvalue('smartcaptchaoption'));
            Configuration::updateValue('smartshowviewed', Tools::getvalue('smartshowviewed'));
            Configuration::updateValue('smartdisablecatimg', Tools::getvalue('smartdisablecatimg'));
            Configuration::updateValue('smartshowauthorstyle', Tools::getvalue('smartshowauthorstyle'));
            Configuration::updateValue('smartshowauthor', Tools::getvalue('smartshowauthor'));
            Configuration::updateValue('smartshowcolumn', Tools::getvalue('smartshowcolumn'));
            Configuration::updateValue('smartmainblogurl', Tools::getvalue('smartmainblogurl'));
            Configuration::updateValue('smartusehtml', Tools::getvalue('smartusehtml'));
            Configuration::updateValue('smartshownoimg', Tools::getvalue('smartshownoimg'));
            Configuration::updateValue('smartdataformat', Tools::getvalue('smartdataformat'));
            Configuration::updateValue('smartcustomcss', Tools::getvalue('smartcustomcss'), true);
            Configuration::updateValue('smartshowhomepost', Tools::getvalue('smartshowhomepost'));
            Configuration::updateValue('smartshowrelatedproduct', Tools::getvalue('smartshowrelatedproduct'));
            Configuration::updateValue('smartshowrelatedproductpost', Tools::getvalue('smartshowrelatedproductpost'));
            Configuration::updateValue('smart_update_period', Tools::getvalue('smart_update_period'));
            Configuration::updateValue('smart_update_frequency', Tools::getvalue('smart_update_frequency'));
            Configuration::updateValue('smartshowrelatedpost', Tools::getvalue('smartshowrelatedpost'));
            Configuration::updateValue('sort_category_by', Tools::getvalue('sort_category_by'));
            Configuration::updateValue('latestnews_sort_by', Tools::getvalue('latestnews_sort_by'));
            $this->processImageUpload($_FILES);
            $html = $this->displayConfirmation($this->l('The settings have been updated successfully.'));
            $helper = $this->SettingForm();
            $html .= $feed_url_html;
            $html .= $helper->generateForm($this->fields_form);
            $helper = $this->regenerateform();
            $html .= $helper->generateForm($this->fields_form);
            $auc = new AdminAboutUsController();
            return $html;
        } elseif (Tools::isSubmit('generateimage')) {
            if (Tools::getvalue('isdeleteoldthumblr') != 1) {
                BlogImageType::ImageGenerate();
                $html = $this->displayConfirmation($this->l('Generate New Thumblr Succesfully.'));
                $helper = $this->SettingForm();
                $html .= $helper->generateForm($this->fields_form);
                $helper = $this->regenerateform();
                $html .= $helper->generateForm($this->fields_form);
                $auc = new AdminAboutUsController();
                return $html;
            } else {
                BlogImageType::ImageDelete();
                BlogImageType::ImageGenerate();
                $html = $this->displayConfirmation($this->l('Delete Old Image and Generate New Thumblr Succesfully.'));
                $helper = $this->SettingForm();
                $html .= $helper->generateForm($this->fields_form);
                $helper = $this->regenerateform();
                $html .= $helper->generateForm($this->fields_form);
                $auc = new AdminAboutUsController();
                return $html;
            }
        } else {
            $helper = $this->SettingForm();
            $html .= $helper->generateForm($this->fields_form);
            $helper = $this->regenerateform();
            $html .= $helper->generateForm($this->fields_form);
            $auc = new AdminAboutUsController();
            return $html;
        }
    }
コード例 #2
0
ファイル: smartblog.php プロジェクト: Beattle/perrino-shop
    public function getContent()
    {
        $html = '';
        if (Tools::isSubmit('savesmartblog')) {
            Configuration::updateValue('smartblogmetatitle', Tools::getvalue('smartblogmetatitle'));
            Configuration::updateValue('smartenablecomment', Tools::getvalue('smartenablecomment'));
            Configuration::updateValue('smartblogmetakeyword', Tools::getvalue('smartblogmetakeyword'));
            Configuration::updateValue('smartblogmetadescrip', Tools::getvalue('smartblogmetadescrip'));
            Configuration::updateValue('smartpostperpage', Tools::getvalue('smartpostperpage'));
            Configuration::updateValue('smartacceptcomment', Tools::getvalue('smartacceptcomment'));
            Configuration::updateValue('smartcaptchaoption', Tools::getvalue('smartcaptchaoption'));
            Configuration::updateValue('smartshowviewed', Tools::getvalue('smartshowviewed'));
            Configuration::updateValue('smartdisablecatimg', Tools::getvalue('smartdisablecatimg'));
            Configuration::updateValue('smartshowauthorstyle', Tools::getvalue('smartshowauthorstyle'));
            Configuration::updateValue('smartshowauthor', Tools::getvalue('smartshowauthor'));
            Configuration::updateValue('smartshowcolumn', Tools::getvalue('smartshowcolumn'));
            Configuration::updateValue('smartmainblogurl', Tools::getvalue('smartmainblogurl'));
            Configuration::updateValue('smartusehtml', Tools::getvalue('smartusehtml'));
            Configuration::updateValue('smartshownoimg', Tools::getvalue('smartshownoimg'));
            Configuration::updateValue('smartcustomcss', Tools::getvalue('smartcustomcss'), true);
            $this->processImageUpload($_FILES);
            $html = $this->displayConfirmation($this->l('The settings have been updated successfully.'));
            $helper = $this->SettingForm();
            $html .= $helper->generateForm($this->fields_form);
            $helper = $this->regenerateform();
            $html .= $helper->generateForm($this->fields_form);
            $auc = new AdminAboutUsController();
            $html .= '<fieldset class="width3" id="smartdatasoft-content">
   <style>               
    #smartdatasoft-content { 
        padding: 0;
        width: 99%;
        padding-left: 1.3em;
        background: white;
    }
</style></fieldset>
<script type="text/javascript">
        $.post(
            "ajax-tab.php",
            {
                tab: \'AdminAboutUs\',
                token: \'' . $auc->token . '\',
                ajax: \'1\',
                action:\'GetSmartThemes\',
                page:\'themes\'
            }, function(a){
                $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a);
            });
    </script>';
            return $html;
        } elseif (Tools::isSubmit('generateimage')) {
            if (Tools::getvalue('isdeleteoldthumblr') != 1) {
                BlogImageType::ImageGenerate();
                $html = $this->displayConfirmation($this->l('Generate New Thumblr Succesfully.'));
                $helper = $this->SettingForm();
                $html .= $helper->generateForm($this->fields_form);
                $helper = $this->regenerateform();
                $html .= $helper->generateForm($this->fields_form);
                $auc = new AdminAboutUsController();
                $html .= '<fieldset class="width3" id="smartdatasoft-content">
                  
   <style>               
    #smartdatasoft-content { 
        padding: 0;
        width: 99%;
        padding-left: 1.3em;
        background: white;
    }
</style></fieldset>
<script type="text/javascript">
        $.post(
            "ajax-tab.php",
            {
                tab: \'AdminAboutUs\',
                token: \'' . $auc->token . '\',
                ajax: \'1\',
                action:\'GetSmartThemes\',
                page:\'themes\'
            }, function(a){
                $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a);
            });
    </script>';
                return $html;
            } else {
                BlogImageType::ImageDelete();
                BlogImageType::ImageGenerate();
                $html = $this->displayConfirmation($this->l('Delete Old Image and Generate New Thumblr Succesfully.'));
                $helper = $this->SettingForm();
                $html .= $helper->generateForm($this->fields_form);
                $helper = $this->regenerateform();
                $html .= $helper->generateForm($this->fields_form);
                $auc = new AdminAboutUsController();
                $html .= '<fieldset class="width3" id="smartdatasoft-content">
                  
   <style>               
    #smartdatasoft-content { 
        padding: 0;
        width: 99%;
        padding-left: 1.3em;
        background: white;
    }
</style></fieldset>
<script type="text/javascript">
        $.post(
            "ajax-tab.php",
            {
                tab: \'AdminAboutUs\',
                token: \'' . $auc->token . '\',
                ajax: \'1\',
                action:\'GetSmartThemes\',
                page:\'themes\'
            }, function(a){
                $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a);
            });
    </script>';
                return $html;
            }
        } else {
            $helper = $this->SettingForm();
            $html .= $helper->generateForm($this->fields_form);
            $helper = $this->regenerateform();
            $html .= $helper->generateForm($this->fields_form);
            $auc = new AdminAboutUsController();
            $html .= '<fieldset class="width3" id="smartdatasoft-content">
                  
   <style>               
    #smartdatasoft-content { 
        padding: 0;
        width: 99%;
        padding-left: 1.3em;
        background: white;
    }
</style></fieldset>
<script type="text/javascript">
        $.post(
            "ajax-tab.php",
            {
                tab: \'AdminAboutUs\',
                token: \'' . $auc->token . '\',
                ajax: \'1\',
                action:\'GetSmartThemes\',
                page:\'themes\'
            }, function(a){
                $("#smartdatasoft-content").html("<legend><img src=\'../img/admin/prestastore.gif\' class=\'middle\' />Live from SmartDataSoft Addons!</legend>"+a);
            });
    </script>';
            return $html;
        }
    }