当前位置: 首页>>代码示例>>PHP>>正文


PHP rex_view::warning方法代码示例

本文整理汇总了PHP中rex_view::warning方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_view::warning方法的具体用法?PHP rex_view::warning怎么用?PHP rex_view::warning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rex_view的用法示例。


在下文中一共展示了rex_view::warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getEntriesByTimeline

 public static function getEntriesByTimeline()
 {
     //Start - get all timelines from the database
     $sql = rex_sql::factory();
     $timelines = $sql->getArray('SELECT `user_id` FROM `' . rex::getTablePrefix() . 'socialhub_facebook_timeline`');
     unset($sql);
     if (empty($timelines)) {
         return false;
     }
     //End - get all timelines from the database
     //Start - get all accounts from the database
     $sql = rex_sql::factory();
     $accounts = $sql->getArray('SELECT * FROM `' . rex::getTablePrefix() . 'socialhub_facebook_account` ORDER BY `id` ASC');
     unset($sql);
     if (empty($accounts)) {
         return false;
     }
     //End - get all accounts from the database
     //Start - get entries by timeline from twitter
     foreach ($timelines as $timeline) {
         $fb = new Facebook\Facebook(['app_id' => $accounts[0]['app_id'], 'app_secret' => $accounts[0]['app_secret'], 'default_graph_version' => 'v2.5', 'default_access_token' => $accounts[0]['app_id'] . '|' . $accounts[0]['app_secret']]);
         try {
             $response = $fb->get('/' . $timeline['user_id'] . '/posts');
         } catch (Facebook\Exceptions\FacebookResponseException $e) {
             echo rex_view::error('Graph returned an error: ' . $e->getMessage());
         } catch (Facebook\Exceptions\FacebookSDKException $e) {
             echo rex_view::error('Facebook SDK returned an error: ' . $e->getMessage());
         }
         if (empty($response)) {
             return;
         }
         $response = json_decode($response->getBody(), true);
         foreach ($response['data'] as $post) {
             list($userID, $postID) = explode('_', $post['id']);
             $newPost = rex_sql::factory();
             $newPost->setTable(rex::getTablePrefix() . 'socialhub_entry_timeline');
             $newPost->setWhere(['post_id' => $postID]);
             $newPost->select();
             if ($newPost->getRows() === 0) {
                 $newPost->reset();
                 $newPost->setTable(rex::getTablePrefix() . 'socialhub_entry_timeline');
                 $newPost->setValue('source', 'facebook');
                 $newPost->setValue('post_id', $postID);
                 $newPost->setValue('message', $post['message']);
                 $newPost->setValue('author_id', $userID);
                 $newPost->setValue('created_time', date('Y-m-d H:i:s', strtotime($post['created_time'])));
                 $newPost->setValue('query', '/' . $timeline['user_id'] . '/posts');
                 try {
                     $newPost->insert();
                 } catch (rex_sql_exception $e) {
                     echo rex_view::warning($e->getMessage());
                 }
             }
         }
     }
     //End - get entries by timeline from twitter
 }
开发者ID:phoebusryan,项目名称:rex_socialhub,代码行数:57,代码来源:class.rex_socialhub_facebook.php

示例2: getEntriesByHashtag

 public static function getEntriesByHashtag()
 {
     //Start - get all hashtags from the database
     $sql = rex_sql::factory();
     $hashtags = $sql->getArray('SELECT `hashtag`, `twitter_next_id` FROM `' . rex::getTablePrefix() . 'socialhub_twitter_hashtag`');
     unset($sql);
     if (empty($hashtags)) {
         return false;
     }
     //End - get all hashtags from the database
     //Start - get all accounts from the database
     $sql = rex_sql::factory();
     $accounts = $sql->getArray('SELECT * FROM `' . rex::getTablePrefix() . 'socialhub_twitter_account` ORDER BY `id` ASC');
     unset($sql);
     if (empty($accounts)) {
         return false;
     }
     //End - get all accounts from the database
     //Start - get entries by hashtag from twitter
     foreach ($hashtags as $hashtag) {
         $connection = new Abraham\TwitterOAuth\TwitterOAuth($accounts[0]['consumer_token'], $accounts[0]['consumer_secret_token'], $accounts[0]['access_token'], $accounts[0]['secret_token']);
         if ($hashtag['twitter_next_id'] != 0) {
             $response = $connection->get("search/tweets", ['q' => '#' . $hashtag['hashtag'], 'since_id' => $hashtag['twitter_next_id']]);
         } else {
             $response = $connection->get("search/tweets", ['q' => '#' . $hashtag['hashtag']]);
         }
         foreach ($response->statuses as $data) {
             $lastId = $data->id;
             if (empty($data->retweeted_status)) {
                 $sql = rex_sql::factory();
                 $sql->setTable(rex::getTablePrefix() . 'socialhub_entry_hashtag');
                 $sql->setValue('source', 'twitter');
                 $sql->setValue('source_id', $data->id);
                 $sql->setValue('caption', urlencode($data->text ? addslashes($data->text) : ''));
                 if (!empty($data->entities->media)) {
                     $sql->setValue('image', $data->entities->media[0]->media_url);
                 }
                 $sql->setValue('created_time', date('Y-m-d H:i:s', strtotime($data->created_at)));
                 $sql->setValue('author_id', $data->user->id);
                 $sql->setValue('author_name', $data->user->screen_name);
                 $sql->setValue('query', $hashtag['hashtag']);
                 try {
                     $sql->insert();
                 } catch (rex_sql_exception $e) {
                     echo rex_view::warning($e->getMessage());
                 }
                 unset($sql);
             }
         }
         //Start - update next_id
         $sql = rex_sql::factory();
         $sql->setTable(rex::getTablePrefix() . 'socialhub_twitter_hashtag');
         $sql->setWhere('hashtag = "' . addslashes($hashtag['hashtag']) . '"');
         $sql->setValue('twitter_next_id', $lastId);
         try {
             $sql->update();
         } catch (rex_sql_exception $e) {
             echo rex_view::warning($e->getMessage());
         }
         unset($sql);
         //End - update next_id
     }
     //End - get entries by hashtag from twitter
 }
开发者ID:phoebusryan,项目名称:rex_socialhub,代码行数:64,代码来源:rex_socialhub_twitter.php

示例3: getEntriesByHashtag

 public static function getEntriesByHashtag()
 {
     //Start - get all hashtags from the database
     $sql = rex_sql::factory();
     $hashtags = $sql->getArray('SELECT `hashtag`, `instagram_next_id` FROM `' . rex::getTablePrefix() . 'socialhub_instagram_hashtag`');
     unset($sql);
     if (empty($hashtags)) {
         return false;
     }
     //End - get all hashtags from the database
     //Start - get all accounts from the database
     $sql = rex_sql::factory();
     $accounts = $sql->getArray('SELECT * FROM `' . rex::getTablePrefix() . 'socialhub_instagram_account` ORDER BY `id` ASC');
     unset($sql);
     if (empty($accounts)) {
         return false;
     }
     //End - get all accounts from the database
     //Start - get entries by hashtag from instagram
     foreach ($hashtags as $hashtag) {
         if ($hashtag['instagram_next_id'] != 0) {
             $url = 'https://api.instagram.com/v1/tags/' . $hashtag['hashtag'] . '/media/recent?count=100&client_id=' . $accounts[0]['client_id'] . '&min_tag_id=' . $hashtag['instagram_next_id'];
         } else {
             $url = 'https://api.instagram.com/v1/tags/' . $hashtag['hashtag'] . '/media/recent?count=100&client_id=' . $accounts[0]['client_id'];
         }
         $response = self::curlURL($url);
         $response = json_decode($response);
         foreach ($response->data as $data) {
             $sql = rex_sql::factory();
             $sql->setTable(rex::getTablePrefix() . 'socialhub_entry_hashtag');
             $sql->setValue('source', 'instagram');
             $sql->setValue('source_id', $data->id);
             $sql->setValue('caption', urlencode($data->caption->text));
             if (!empty($data->images->standard_resolution->url)) {
                 $sql->setValue('image', $data->images->standard_resolution->url);
             }
             $sql->setValue('created_time', date('Y-m-d H:i:s', $data->created_time));
             $sql->setValue('author_id', $data->user->id);
             $sql->setValue('author_name', $data->user->username);
             $sql->setValue('query', $hashtag['hashtag']);
             try {
                 $sql->insert();
             } catch (rex_sql_exception $e) {
                 echo rex_view::warning($e->getMessage());
             }
             unset($sql);
         }
         //Start - update next_id
         $sql = rex_sql::factory();
         $sql->setTable(rex::getTablePrefix() . 'socialhub_instagram_hashtag');
         $sql->setWhere('hashtag = "' . addslashes($hashtag['hashtag']) . '"');
         $sql->setValue('instagram_next_id', $response->pagination->min_tag_id);
         try {
             $sql->update();
         } catch (rex_sql_exception $e) {
             echo rex_view::warning($e->getMessage());
         }
         unset($sql);
         //End - update next_id
     }
     //End - get entries by hashtag from instagram
 }
开发者ID:phoebusryan,项目名称:rex_socialhub,代码行数:62,代码来源:class.rex_socialhub_instagram.php

示例4: catch

    //  $sql->setDebug();
    $sql->setTable(rex::getTablePrefix() . 'media_manager_type_effect');
    $sql->setWhere(['id' => $effect_id]);
    try {
        $sql->delete();
        $info = rex_i18n::msg('media_manager_effect_deleted');
    } catch (rex_sql_exception $e) {
        $warning = $sql->getError();
    }
    $func = '';
}
if ($info != '') {
    echo rex_view::info($info);
}
if ($warning != '') {
    echo rex_view::warning($warning);
}
if ($func == '' && $type_id > 0) {
    echo rex_view::info(rex_i18n::msg('media_manager_effect_list_header', htmlspecialchars($typeName)));
    $query = 'SELECT * FROM ' . rex::getTablePrefix() . 'media_manager_type_effect WHERE type_id=' . $type_id . ' ORDER BY priority';
    $list = rex_list::factory($query);
    $list->addTableAttribute('class', 'table-striped');
    $list->addParam('effects', 1);
    $list->setNoRowsMessage(rex_i18n::msg('media_manager_effect_no_effects'));
    $list->removeColumn('id');
    $list->removeColumn('type_id');
    $list->removeColumn('parameters');
    $list->removeColumn('updatedate');
    $list->removeColumn('updateuser');
    $list->removeColumn('createdate');
    $list->removeColumn('createuser');
开发者ID:staabm,项目名称:redaxo,代码行数:31,代码来源:effects.php

示例5: get

 /**
  * Erstellt den Tabellen Quellcode.
  *
  * @return string
  */
 public function get()
 {
     $s = "\n";
     // Form vars
     $this->addFormAttribute('action', $this->getUrl());
     $this->addFormAttribute('method', 'post');
     // Table vars
     $caption = $this->getCaption();
     $tableColumnGroups = $this->getTableColumnGroups();
     $class = 'table';
     if (isset($this->tableAttributes['class'])) {
         $class .= ' ' . $this->tableAttributes['class'];
     }
     $this->addTableAttribute('class', $class);
     // Columns vars
     $columnFormates = [];
     $columnNames = [];
     foreach ($this->getColumnNames() as $columnName) {
         if (!in_array($columnName, $this->columnDisabled)) {
             $columnNames[] = $columnName;
         }
     }
     // List vars
     $sortColumn = $this->getSortColumn();
     $sortType = $this->getSortType();
     $warning = $this->getWarning();
     $message = $this->getMessage();
     $nbRows = $this->getRows();
     $header = $this->getHeader();
     $footer = $this->getFooter();
     if ($warning != '') {
         $s .= rex_view::warning($warning) . "\n";
     } elseif ($message != '') {
         $s .= rex_view::info($message) . "\n";
     }
     if ($header != '') {
         $s .= $header . "\n";
     }
     $s .= '<form' . $this->_getAttributeString($this->getFormAttributes()) . '>' . "\n";
     $s .= '    <table' . $this->_getAttributeString($this->getTableAttributes()) . '>' . "\n";
     if ($caption != '') {
         $s .= '        <caption>' . htmlspecialchars($caption) . '</caption>' . "\n";
     }
     if (count($tableColumnGroups) > 0) {
         foreach ($tableColumnGroups as $tableColumnGroup) {
             $tableColumns = $tableColumnGroup['columns'];
             unset($tableColumnGroup['columns']);
             $s .= '        <colgroup' . $this->_getAttributeString($tableColumnGroup) . '>' . "\n";
             foreach ($tableColumns as $tableColumn) {
                 $s .= '            <col' . $this->_getAttributeString($tableColumn) . ' />' . "\n";
             }
             $s .= '        </colgroup>' . "\n";
         }
     }
     $s .= '        <thead>' . "\n";
     $s .= '            <tr>' . "\n";
     foreach ($columnNames as $columnName) {
         $columnHead = $this->getColumnLabel($columnName);
         if ($this->hasColumnOption($columnName, REX_LIST_OPT_SORT)) {
             if ($columnName == $sortColumn) {
                 $columnSortType = $sortType == 'desc' ? 'asc' : 'desc';
             } else {
                 $columnSortType = $this->getColumnOption($columnName, REX_LIST_OPT_SORT_DIRECTION, 'asc');
             }
             $columnHead = '<a href="' . $this->getUrl(['start' => $this->pager->getCursor(), 'sort' => $columnName, 'sorttype' => $columnSortType]) . '">' . $columnHead . '</a>';
         }
         $layout = $this->getColumnLayout($columnName);
         $s .= '        ' . str_replace('###VALUE###', $columnHead, $layout[0]) . "\n";
         // Formatierungen hier holen, da diese Schleife jede Spalte nur einmal durchläuft
         $columnFormates[$columnName] = $this->getColumnFormat($columnName);
     }
     $s .= '            </tr>' . "\n";
     $s .= '        </thead>' . "\n";
     if ($footer != '') {
         $s .= '        <tfoot>' . "\n";
         $s .= $footer;
         $s .= '        </tfoot>' . "\n";
     }
     if ($nbRows > 0) {
         $maxRows = $nbRows - $this->pager->getCursor();
         $s .= '        <tbody>' . "\n";
         for ($i = 0; $i < $this->pager->getRowsPerPage() && $i < $maxRows; ++$i) {
             $s .= '            <tr>' . "\n";
             foreach ($columnNames as $columnName) {
                 $columnValue = $this->formatValue($this->getValue($columnName), $columnFormates[$columnName], !isset($this->customColumns[$columnName]), $columnName);
                 if (!$this->isCustomFormat($columnFormates[$columnName]) && $this->hasColumnParams($columnName)) {
                     $columnValue = $this->getColumnLink($columnName, $columnValue);
                 }
                 $layout = $this->getColumnLayout($columnName);
                 $columnValue = str_replace('###VALUE###', $columnValue, $layout[1]);
                 $columnValue = $this->replaceVariables($columnValue);
                 $s .= '        ' . $columnValue . "\n";
             }
             $s .= '            </tr>' . "\n";
             $this->sql->next();
//.........这里部分代码省略.........
开发者ID:skerbis,项目名称:redaxo,代码行数:101,代码来源:list.php

示例6: addSlice

 public static function addSlice()
 {
     $article_id = rex_request('article_id', 'int');
     $function = rex_request('page', 'string');
     $cut_slice_id = $slice_id = $_SESSION['slice_ui']['slice_id'];
     $module_id = $_SESSION['slice_ui']['module_id'];
     $clang = rex_get('clang');
     $ctype = rex_get('ctype');
     $category_id = rex_get('category_id');
     if (!self::checkPermissions(array('article_id' => $article_id, 'clang' => $clang, 'ctype' => $ctype, 'module_id' => $module_id))) {
         // Alle OBs schließen
         while (@ob_end_clean()) {
         }
         header("Location: " . rex_url::backendController() . '?article_id=' . $article_id . '&clang=' . $clang . '&page=content/edit&ctype=' . $ctype);
         exit;
     }
     $slice_revision = 0;
     $template_attributes = [];
     $newsql = rex_sql::factory();
     // $newsql->setDebug();
     $sliceTable = rex::getTablePrefix() . 'article_slice';
     $newsql->setTable($sliceTable);
     if (strpos($function, 'content/paste') !== false && !empty($_SESSION['slice_ui'])) {
         $priority = '0';
         // $prevSlice->setDebug();
         if ($function === 'content/paste') {
             $priority = 1;
         } else {
             $prevSlice = rex_sql::factory();
             $prevSlice->setTable($sliceTable);
             $prevSlice->setWhere(array('id' => rex_get('slice_id')));
             $prevSlice->select();
             $priority = $prevSlice->getValue('priority') + 1;
         }
         $copiedSlice = rex_sql::factory();
         $copiedSlice->setTable($sliceTable);
         $copiedSlice->setWhere(array('id' => $cut_slice_id));
         $copiedSlice->select();
         $exclude = array('id', 'createdate', 'updatedate', 'createuser', 'updateuser', 'priority');
         // print_r($copiedSlice->getRow());
         foreach ($copiedSlice->getRow() as $key => $value) {
             if (empty($value)) {
                 continue;
             }
             $field = end(explode('.', $key));
             if (in_array($field, $exclude)) {
                 continue;
             }
             $newsql->setValue($field, $value);
         }
         $newsql->setValue('article_id', $article_id);
         $newsql->setValue('module_id', $module_id);
         $newsql->setValue('clang_id', $clang);
         $newsql->setValue('ctype_id', $ctype);
         $newsql->setValue('revision', $slice_revision);
         $newsql->setValue('priority', $priority);
         $newsql->addGlobalUpdateFields();
         $newsql->addGlobalCreateFields();
         try {
             $newsql->insert();
             $slice_id = $newsql->getLastId();
             if ($slice_id !== 0) {
                 $_SESSION['slice_ui']['new_slice_id'] = $slice_id;
             }
             rex_sql_util::organizePriorities(rex::getTable('article_slice'), 'priority', 'article_id=' . $article_id . ' AND clang_id=' . $clang . ' AND ctype_id=' . $ctype . ' AND revision=' . $slice_revision, 'priority, updatedate DESC');
             $function = '';
             // ----- EXTENSION POINT
             rex_extension::registerPoint(new rex_extension_point('SLICE_PASTED', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'module_id' => $module_id, 'article_revision' => 0, 'slice_revision' => 0]));
             if ($_SESSION['slice_ui']['cut'] == 1) {
                 $curr = rex_sql::factory();
                 $curr->setDebug();
                 $curr->setTable($sliceTable);
                 $curr->setWhere(array('id' => $cut_slice_id));
                 $curr->delete();
                 rex_sql_util::organizePriorities(rex::getTable('article_slice'), 'priority', 'article_id=' . $_SESSION['slice_ui']['article_id'] . ' AND clang_id=' . $clang . ' AND ctype_id=' . $ctype . ' AND revision=' . $slice_revision, 'priority, updatedate DESC');
             }
         } catch (rex_sql_exception $e) {
             echo rex_view::warning($e->getMessage());
         }
         // die();
         // Alle OBs schließen
         while (@ob_end_clean()) {
         }
         header("Location: " . rex_url::backendController() . '?article_id=' . $article_id . '&clang=' . $clang . '&page=content/edit&ctype=' . $ctype);
         exit;
     }
 }
开发者ID:nilsology,项目名称:slice_ui,代码行数:87,代码来源:slice_ui.php

示例7: get

 /**
  * @return string
  */
 public function get()
 {
     $this->init();
     $this->setApplyUrl($this->getUrl(['func' => ''], false));
     if (($controlElement = $this->getControlElement()) !== null) {
         if ($controlElement->saved()) {
             $this->processPostValues();
             // speichern und umleiten
             // Nachricht in der Liste anzeigen
             if (($result = $this->validate()) === true && ($result = $this->save()) === true) {
                 $this->redirect(rex_i18n::msg('form_saved'));
             } elseif (is_int($result) && isset($this->errorMessages[$result])) {
                 $this->setWarning($this->errorMessages[$result]);
             } elseif (is_string($result) && $result != '') {
                 $this->setWarning($result);
             } else {
                 $this->setWarning(rex_i18n::msg('form_save_error'));
             }
         } elseif ($controlElement->applied()) {
             $this->processPostValues();
             // speichern und wiederanzeigen
             // Nachricht im Formular anzeigen
             if (($result = $this->validate()) === true && ($result = $this->save()) === true) {
                 $this->setMessage(rex_i18n::msg('form_applied'));
             } elseif (is_int($result) && isset($this->errorMessages[$result])) {
                 $this->setWarning($this->errorMessages[$result]);
             } elseif (is_string($result) && $result != '') {
                 $this->setWarning($result);
             } else {
                 $this->setWarning(rex_i18n::msg('form_save_error'));
             }
         } elseif ($controlElement->deleted()) {
             // speichern und wiederanzeigen
             // Nachricht in der Liste anzeigen
             if (($result = $this->delete()) === true) {
                 $this->redirect(rex_i18n::msg('form_deleted'));
             } elseif (is_string($result) && $result != '') {
                 $this->setWarning($result);
             } else {
                 $this->setWarning(rex_i18n::msg('form_delete_error'));
             }
         } elseif ($controlElement->resetted()) {
             // verwerfen und wiederanzeigen
             // Nachricht im Formular anzeigen
             $this->setMessage(rex_i18n::msg('form_resetted'));
         } elseif ($controlElement->aborted()) {
             // verwerfen und umleiten
             // Nachricht in der Liste anzeigen
             $this->redirect(rex_i18n::msg('form_resetted'));
         }
     }
     $actionParams = [];
     if ('get' == strtolower($this->method)) {
         // Parameter dem Formular hinzufügen
         foreach ($this->getParams() as $name => $value) {
             $this->addHiddenField($name, $value, ['internal::useArraySyntax' => 'none']);
         }
     } else {
         $actionParams = $this->getParams();
     }
     $s = "\n";
     $warning = $this->getWarning();
     $message = $this->getMessage();
     if ($warning != '') {
         $s .= '  ' . rex_view::warning($warning) . "\n";
     } elseif ($message != '') {
         $s .= '  ' . rex_view::info($message) . "\n";
     }
     $i = 0;
     $addHeaders = true;
     $fieldsets = $this->getFieldsetElements();
     $last = count($fieldsets);
     $s .= '<form id="' . $this->divId . '" action="' . rex_url::backendController($actionParams) . '" method="' . $this->method . '">' . "\n";
     foreach ($fieldsets as $fieldsetName => $fieldsetElements) {
         $s .= '<fieldset>' . "\n";
         if ($fieldsetName != '') {
             $s .= '<legend>' . htmlspecialchars($fieldsetName) . '</legend>' . "\n";
         }
         // Die HeaderElemente nur im 1. Fieldset ganz am Anfang einfügen
         if ($i == 0 && $addHeaders) {
             foreach ($this->getHeaderElements() as $element) {
                 // Callback
                 $element->setValue($this->preView($fieldsetName, $element->getFieldName(), $element->getValue()));
                 // HeaderElemente immer ohne <p>
                 $s .= $element->formatElement();
             }
             $addHeaders = false;
         }
         foreach ($fieldsetElements as $element) {
             // Callback
             $element->setValue($this->preView($fieldsetName, $element->getFieldName(), $element->getValue()));
             $s .= $element->get();
         }
         // Die FooterElemente nur innerhalb des letzten Fieldsets
         if ($i + 1 == $last) {
             foreach ($this->getFooterElements() as $element) {
                 // Callback
//.........这里部分代码省略.........
开发者ID:skerbis,项目名称:redaxo,代码行数:101,代码来源:form.php

示例8: catch

<?php

$newCron = rex_sql::factory();
$newCron->setTable(REX_CRONJOB_TABLE);
$newCron->setWhere(array('name' => 'Update Instagram-Timelines'));
try {
    $newCron->delete();
} catch (rex_sql_exception $e) {
    echo rex_view::warning($e->getMessage());
}
$newCron = rex_sql::factory();
$newCron->setTable(REX_CRONJOB_TABLE);
$newCron->setWhere(array('name' => 'Update Instagram-Hashtags'));
try {
    $newCron->delete();
} catch (rex_sql_exception $e) {
    echo rex_view::warning($e->getMessage());
}
开发者ID:phoebusryan,项目名称:rex_socialhub,代码行数:18,代码来源:uninstall.php

示例9: rex_request

<?php

/** @var rex_addon $this */
$core = rex_request('core', 'boolean');
$addonkey = rex_request('addonkey', 'string');
$coreVersions = [];
$addons = [];
$message = rex_api_function::getMessage();
try {
    $coreVersions = rex_api_install_core_update::getVersions();
    $addons = rex_install_packages::getUpdatePackages();
} catch (rex_functional_exception $e) {
    $message .= rex_view::warning($e->getMessage());
    $addonkey = '';
}
if ($core && !empty($coreVersions)) {
    $panel = '
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th class="rex-table-icon">&nbsp;</th>
                <th>' . $this->i18n('version') . '</th>
                <th>' . $this->i18n('description') . '</th>
                <th class="rex-table-action"></th>
            </tr>
            </thead>
            <tbody>';
    foreach ($coreVersions as $id => $version) {
        $panel .= '
                <tr>
                    <td class="rex-table-icon"><i class="rex-icon rex-icon-package"></i></td>
开发者ID:eaCe,项目名称:redaxo,代码行数:31,代码来源:packages.update.php

示例10: ob_start

ob_start();
$addon = rex_addon::get('yrewrite');
$article_id = $params['article_id'];
$clang = $params['clang'];
$ctype = $params['ctype'];
// $yrewrite_url = stripslashes(rex_request('yrewrite_url'));
$domain = rex_yrewrite::getDomainByArticleId($article_id, $clang);
$isStartarticle = rex_yrewrite::isDomainStartArticle($article_id, $clang);
$autoUrl = rex_getUrl();
if (0 === strpos($autoUrl, $domain->getUrl())) {
    $autoUrl = substr($autoUrl, strlen($domain->getUrl()));
} else {
    $autoUrl = substr($autoUrl, strlen($domain->getPath()));
}
if ($isStartarticle) {
    echo rex_view::warning($addon->i18n('startarticleisalways', $domain->getName()));
} else {
    $yform = new rex_yform();
    $yform->setObjectparams('form_action', rex_url::backendController(['page' => 'content/edit', 'article_id' => $article_id, 'clang' => $clang, 'ctype' => $ctype], false));
    $yform->setObjectparams('form_id', 'yrewrite-url');
    $yform->setObjectparams('form_name', 'yrewrite-url');
    $yform->setHiddenField('yrewrite_func', 'url');
    $yform->setObjectparams('form_showformafterupdate', 1);
    $yform->setObjectparams('main_table', rex::getTable('article'));
    $yform->setObjectparams('main_id', $article_id);
    $yform->setObjectparams('main_where', 'id=' . $article_id . ' and clang_id=' . $clang);
    $yform->setObjectparams('getdata', true);
    $yform->setValueField('text', ['yrewrite_url', $addon->i18n('customurl'), 'notice' => $autoUrl]);
    $yform->setValidateField('customfunction', ['name' => 'yrewrite_url', 'function' => function ($func, $yrewrite_url) {
        return substr($yrewrite_url, 0, 1) == '/' || substr($yrewrite_url, -1) == '/';
    }, 'params' => [], 'message' => rex_i18n::msg('yrewrite_warning_noslash')]);
开发者ID:VIEWSION,项目名称:redaxo_yrewrite,代码行数:31,代码来源:content.yrewrite_url.php

示例11: htmlspecialchars

            $warnings[] = rex_i18n::msg('user_login_exists');
        }
        if (!$userlogin) {
            $warnings[] = rex_i18n::msg('user_missing_login');
        }
        if (!$userpsw) {
            $warnings[] = rex_i18n::msg('user_missing_password');
        }
    }
}
// ---------------------------------- ERR MSG
if ($info != '') {
    $message .= rex_view::info($info);
}
if (!empty($warnings)) {
    $message .= rex_view::warning(implode('<br/>', $warnings));
}
// --------------------------------- FORMS
$SHOW = true;
if ($FUNC_ADD != '' || $user_id > 0) {
    $SHOW = false;
    if ($FUNC_ADD != '') {
        $statuschecked = 'checked="checked"';
    }
    $buttons = '';
    if ($user_id > 0) {
        // User Edit
        $form_label = rex_i18n::msg('edit_user');
        $add_hidden = '<input type="hidden" name="user_id" value="' . $user_id . '" />';
        $add_user_login = '<p class="form-control-static">' . htmlspecialchars($sql->getValue(rex::getTablePrefix() . 'user.login')) . '</p>';
        $formElements = [];
开发者ID:staabm,项目名称:redaxo,代码行数:31,代码来源:users.php

示例12: rex_extension_point

                            } else {
                                $dcounter++;
                                echo rex_view::warning(rex_i18n::msg('yform_manager_import_error_dataimport', $error));
                            }
                        }
                    }
                }
                $show_list = true;
            }
            rex_extension::registerPoint(new rex_extension_point('yform_DATASET_IMPORTED', '', array('divider' => $div, 'table' => $this->table, 'filename' => $filename, 'replacefield' => $replacefield, 'missing_columns' => $missing_columns, 'debug' => $debug, 'data_imported' => $counter, 'data_not_imported' => $dcounter, 'data_empty_rows' => $ecounter, 'data_replaced' => $rcounter, 'data_inserted' => $icounter, 'data_errors' => $errorcounter)));
            echo rex_view::info(rex_i18n::msg('yform_manager_import_error_dataimport', $icounter + $rcounter, $icounter, $rcounter));
        } else {
            echo rex_view::info(rex_i18n::msg('yform_manager_import_error_not_started'));
        }
        if ($dcounter > 0) {
            echo rex_view::warning(rex_i18n::msg('yform_manager_import_info_data_imported', $dcounter));
        }
    }
}
if ($show_importform) {
    ?>
    <div class="rex-addon-output"><h3 class="rex-hl2"><?php 
    echo rex_i18n::msg('yform_manager_import_csv');
    ?>
</h3><div class="rex-addon-content"><div id="rex-yform-import" class="yform">

    <form action="index.php" method="post" enctype="multipart/form-data">

            <p class="rex-tx1"><?php 
    echo rex_i18n::msg('yform_manager_import_csv_info');
    ?>
开发者ID:xong,项目名称:redaxo_yform,代码行数:31,代码来源:data_import.php

示例13: rex_request

    try {
        $table_names = rex_request("table_names");
        $return = rex_yform_manager_table_api::exportTablesets($table_names);
        $file_name = 'yform_manager_tableset_export_tables_' . date("YmdHis") . '.json';
        ob_end_clean();
        header('Content-Type: application/json');
        header('Charset: UTF-8');
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private", false);
        header('Content-Disposition: attachment; filename="' . basename($file_name) . '"');
        header('Content-Length: ' . strlen($return));
        header('Pragma: public');
        header('Expires: 0');
        header('Content-Transfer-Encoding: binary');
        echo $return;
        exit;
    } catch (Exception $e) {
        echo rex_view::warning($this->msg('table_export_failed', '', $e->getMessage()));
    }
} else {
    if ($yform->objparams['send']) {
        echo rex_view::warning(rex_i18n::msg('yform_manager_export_error_empty'));
    }
}
$fragment = new rex_fragment();
$fragment->setVar('class', 'edit', false);
$fragment->setVar('title', rex_i18n::msg('yform_manager_tableset_export'));
$fragment->setVar('body', $form, false);
// $fragment->setVar('buttons', $buttons, false);
$form = $fragment->parse('core/page/section.php');
echo $form;
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:31,代码来源:tableset_export.php

示例14: rex_request

 */
echo rex_view::title(rex_i18n::msg('yform'));
$page = rex_request('page', 'string', '');
$yform = new rex_yform();
$yform->setHiddenField('page', $page);
$yform->setObjectparams('real_field_names', true);
$yform->setObjectparams('hide_top_warning_messages', true);
$yform->setObjectparams('form_showformafterupdate', 1);
$yform->setValueField('upload', array('name' => 'importfile', 'label' => rex_i18n::msg('yform_manager_tableset_import_jsonimportfile'), 'max_size' => '1000', 'types' => '.json', 'required' => 1, 'messages' => array(rex_i18n::msg('yform_manager_table_importset_warning_min'), rex_i18n::msg('yform_manager_table_importset_warning_max'), rex_i18n::msg('yform_manager_table_importset_warning_type'), rex_i18n::msg('yform_manager_table_importset_warning_selectfile')), 'modus' => 'no_save', 'no_db' => 'no_db'));
$form = $yform->getForm();
if ($yform->objparams['actions_executed']) {
    try {
        $content = file_get_contents(rex_path::addonData('yform', 'uploads/' . $yform->objparams['value_pool']['email']['importfile']));
        rex_yform_manager_table_api::importTablesets($content);
        echo rex_view::success(rex_i18n::msg('yform_manager_tableset_import_success'));
    } catch (Exception $e) {
        echo rex_view::warning(rex_i18n::msg('yform_manager_tableset_import_failed', '', $e->getMessage()));
    }
    rex_file::delete(rex_path::addonData('yform', 'uploads/' . $yform->objparams['value_pool']['email']['importfile']));
} else {
    if ($yform->objparams['send']) {
        echo rex_view::warning(rex_i18n::msg('yform_manager_tableset_import_warning_selectfile'));
    }
}
$fragment = new rex_fragment();
$fragment->setVar('class', 'edit', false);
$fragment->setVar('title', rex_i18n::msg('yform_manager_tableset_import'));
$fragment->setVar('body', $form, false);
// $fragment->setVar('buttons', $buttons, false);
$form = $fragment->parse('core/page/section.php');
echo $form;
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:31,代码来源:tableset_import.php

示例15:

 $fragment->setVar('id', 'rex-js-structure-content-nav', false);
 $fragment->setVar('left', $content_navi_left, false);
 $fragment->setVar('right', $content_navi_right, false);
 $contentMain = $fragment->parse('core/navigations/content.php');
 // ------------------------------------------ END: CONTENT HEAD MENUE
 // ------------------------------------------ WARNING
 if ($global_warning != '') {
     $contentMain .= rex_view::warning($global_warning);
 }
 if ($global_info != '') {
     $contentMain .= rex_view::success($global_info);
 }
 // --------------------------------------------- API MESSAGES
 $contentMain .= rex_api_function::getMessage();
 if ($warning != '') {
     $contentMain .= rex_view::warning($warning);
 }
 if ($info != '') {
     $contentMain .= rex_view::success($info);
 }
 // ----- EXTENSION POINT
 $contentMain .= rex_extension::registerPoint(new rex_extension_point('STRUCTURE_CONTENT_BEFORE_SLICES', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'article_revision' => &$article_revision, 'slice_revision' => &$slice_revision]));
 // ------------------------------------------ START: MODULE EDITIEREN/ADDEN ETC.
 $contentMain .= (include rex_be_controller::getCurrentPageObject()->getSubPath());
 // ------------------------------------------ END: AUSGABE
 // ----- EXTENSION POINT
 $contentMain .= rex_extension::registerPoint(new rex_extension_point('STRUCTURE_CONTENT_AFTER_SLICES', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'article_revision' => &$article_revision, 'slice_revision' => &$slice_revision]));
 // ----- EXTENSION POINT
 $contentSidebar = rex_extension::registerPoint(new rex_extension_point('STRUCTURE_CONTENT_SIDEBAR', '', ['article_id' => $article_id, 'clang' => $clang, 'function' => $function, 'slice_id' => $slice_id, 'page' => rex_be_controller::getCurrentPage(), 'ctype' => $ctype, 'category_id' => $category_id, 'article_revision' => &$article_revision, 'slice_revision' => &$slice_revision]));
 $fragment = new rex_fragment();
 $fragment->setVar('content', $contentMain, false);
开发者ID:alsahh,项目名称:redaxo,代码行数:31,代码来源:content.php


注:本文中的rex_view::warning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。