Esempio n. 1
0
 protected function _preBootstrap()
 {
     if (!$this->_pm->getAccess()->isHeartbeat() && $this->_pm->getAccess()->isAdmin()) {
         // load the framework translation
         require_once $this->_pm->getPathinfo()->getRootLib() . '/IfwPsn/Wp/Proxy.php';
         IfwPsn_Wp_Proxy::loadTextdomain('ifw', false, $this->_pm->getPathinfo()->getDirname() . '/lib/IfwPsn/Wp/Translation');
         if (is_dir($this->_pm->getPathinfo()->getRootLang())) {
             $langRelPath = $this->_pm->getPathinfo()->getDirname() . '/lang';
             $result = IfwPsn_Wp_Proxy::loadTextdomain($this->_pm->getEnv()->getTextDomain(), false, $langRelPath);
         }
     }
 }
Esempio n. 2
0
 /**
  * Deletes all options
  */
 public function reset()
 {
     IfwPsn_Wp_Proxy::deleteOption($this->_pageId);
 }
Esempio n. 3
0
 /**
  * @param $id
  * @return mixed|null
  */
 public function getOption($id)
 {
     if ($this->hasOption($id)) {
         $options = IfwPsn_Wp_Proxy::getOption($this->_pm->getOptions()->getPageId());
         return $options[$this->_pm->getOptions()->getOptionRealId($id)];
     }
     return null;
 }
Esempio n. 4
0
 /**
  * Checks if plugin translation files exist and inits the plugin textdomain
  *
  * @return bool
  */
 protected function _initTranslation()
 {
     $result = false;
     if ($this->_pathinfo->hasRootLang()) {
         $langRelPath = $this->_pm->getPathinfo()->getDirname() . '/modules/' . $this->_pathinfo->getDirname() . '/lang';
         $result = IfwPsn_Wp_Proxy::loadTextdomain($this->getTextDomain(), false, $langRelPath);
     }
     return $result;
 }
Esempio n. 5
0
    public function display()
    {
        $this->prepare_items();
        ?>
        <form id="<?php 
        echo $this->_id;
        ?>
" method="post" action="<?php 
        echo $this->_formAction;
        ?>
" class="ifw-listtable">

            <?php 
        if (isset($_REQUEST['page'])) {
            ?>
                <!-- if request has page value submit it for returning to current plugin page -->
                <input type="hidden" name="page" value="<?php 
            echo $_REQUEST['page'];
            ?>
" />
            <?php 
        }
        ?>
            <?php 
        if (isset($_REQUEST['appaction'])) {
            ?>
                <!-- if request has appaction value submit it for returning to current plugin page -->
                <input type="hidden" name="appaction" value="<?php 
            echo $_REQUEST['appaction'];
            ?>
" />
            <?php 
        }
        ?>
            <?php 
        if (isset($this->_options['hidden_fields'])) {
            foreach ($this->_options['hidden_fields'] as $field) {
                ?>
                    <input type="hidden" name="<?php 
                echo $field['name'];
                ?>
" value="<?php 
                echo $field['value'];
                ?>
" />
                <?php 
            }
        }
        ?>
            <?php 
        IfwPsn_Wp_Proxy::doAction($this->_wpActionPrefix . 'before_display', $this);
        echo parent::display();
        IfwPsn_Wp_Proxy::doAction($this->_wpActionPrefix . 'after_display', $this);
        ?>
        </form>
        <?php 
    }
Esempio n. 6
0
 /**
  * @param $to
  * @param $subject
  * @param $message
  * @param $headers
  * @param $attachments
  * @return bool
  */
 protected function _processEmail($to, $subject, $message, $headers, $attachments)
 {
     $result = true;
     $emailParams = array('to' => $to, 'subject' => $subject, 'message' => $message, 'headers' => $headers, 'attachments' => $attachments);
     // pass the email params to the filter which can decide if the sending process should be executed directly
     $process = IfwPsn_Wp_Proxy_Filter::apply('ifwpsn_callback_email_process', true, $emailParams, $this);
     if ($process) {
         IfwPsn_Wp_Proxy_Action::doAction('ifwpsn_callback_before_email_send', $emailParams, $this);
         $result = IfwPsn_Wp_Proxy::mail($to, $subject, $message, $headers, $attachments);
         IfwPsn_Wp_Proxy_Action::doAction('ifwpsn_callback_after_email_send', $result, $emailParams, $this);
     }
     return $result;
 }