Exemplo n.º 1
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     global $step;
     $steps = array('visible' => true);
     if ($step && bouncer($step, $steps) && has_privs(ps('origin'))) {
         $this->{$step}();
     }
 }
Exemplo n.º 2
0
 * Configuration variables.
 *
 * A list of HTTP POST variables.
 *
 * @global array $vars
 */
$vars = array('import_tool', 'import_section', 'import_status', 'import_comments_invite', 'import_blog_id', 'importdb', 'importdblogin', 'importdbpass', 'importdbhost', 'wpdbprefix', 'wpdbcharset');
/**
 * Importing options.
 *
 * These are named after the files in ./import directory.
 *
 * @global array $tools
 */
$tools = array('' => '', 'mt' => 'Movable Type (File)', 'mtdb' => 'Movable Type (MySQL DB)', 'blogger' => 'Blogger', 'b2' => 'b2', 'wp' => 'WordPress');
if (!$step or !bouncer($step, array('switch_tool' => false, 'start_import' => true))) {
    $step = 'switch_tool';
}
$step();
/**
 * Renders a panel for selecting the import tool.
 *
 * Lets users select the tool and provide required
 * configuration options.
 */
function switch_tool()
{
    global $vars, $event, $step, $tools;
    extract(gpsa($vars));
    pagetop(gTxt('txp_import'), '');
    echo hed(gTxt('tab_import'), 1, array('class' => 'txp-heading'));
Exemplo n.º 3
0
 * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Languages panel.
 *
 * @package Admin\Lang
 * @since   4.6.0
 */
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
include_once txpath . '/lib/txplib_update.php';
if ($event == 'lang') {
    require_privs('lang');
    $available_steps = array('get_language' => true, 'get_textpack' => true, 'remove_language' => true, 'save_language' => true, 'list_languages' => false);
    if ($step && bouncer($step, $available_steps)) {
        $step();
    } else {
        list_languages();
    }
}
/**
 * Generate a &lt;select&gt; element of installed languages.
 *
 * @param  string $name The HTML name and ID to assign to the select control
 * @param  string $val  The currently active language identifier (en-gb, fr-fr, ...)
 * @return string HTML
 */
function languages($name, $val)
{
    $installed_langs = safe_column("lang", 'txp_lang', "1 = 1 GROUP BY lang");
Exemplo n.º 4
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Preferences panel user interface and interaction.
 *
 * @package Admin\Prefs
 */
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
if ($event == 'prefs') {
    require_privs('prefs');
    bouncer($step, array('prefs_save' => true, 'prefs_list' => false));
    switch (strtolower($step)) {
        case "":
        case "prefs_list":
            prefs_list();
            break;
        case "prefs_save":
            prefs_save();
            break;
    }
}
/**
 * Commits prefs to the database.
 */
function prefs_save()
{
Exemplo n.º 5
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Pages panel.
 *
 * @package Admin\Page
 */
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
if ($event == 'page') {
    require_privs('page');
    bouncer($step, array('page_edit' => false, 'page_save' => true, 'page_delete' => true));
    switch (strtolower($step)) {
        case '':
            page_edit();
            break;
        case 'page_edit':
            page_edit();
            break;
        case 'page_save':
            page_save();
            break;
        case 'page_delete':
            page_delete();
            break;
        case 'page_new':
            page_new();
Exemplo n.º 6
0
}
$statuses = status_list();
if (!empty($event) and $event == 'article') {
    require_privs('article');
    $save = gps('save');
    if ($save) {
        $step = 'save';
    }
    $publish = gps('publish');
    if ($publish) {
        $step = 'publish';
    }
    if (empty($step)) {
        $step = 'create';
    }
    bouncer($step, array('create' => false, 'publish' => true, 'edit' => false, 'save' => true));
    switch ($step) {
        case 'create':
            article_edit();
            break;
        case 'publish':
            article_post();
            break;
        case 'edit':
            article_edit();
            break;
        case 'save':
            article_save();
            break;
    }
}
Exemplo n.º 7
0
/*
	This is Textpattern
	Copyright 2005 by Dean Allen
	www.textpattern.com
	All rights reserved
	Use of this software indicates acceptance ofthe Textpattern license agreement
$HeadURL$
$LastChangedRevision$
*/
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
if ($event == 'section') {
    require_privs('section');
    $available_steps = array('sec_section_list' => false, 'section_create' => true, 'section_delete' => true, 'section_save' => true);
    if (!$step or !bouncer($step, $available_steps)) {
        $step = 'sec_section_list';
    }
    $step();
}
// -------------------------------------------------------------
function sec_section_list($message = '')
{
    global $wlink, $event;
    pagetop(gTxt('sections'), $message);
    $default = safe_row('page, css, name', 'txp_section', "name = 'default'");
    echo n . '<div id="' . $event . '_container" class="txp-container txp-list">';
    echo n . n . startTable('list') . n . n . tr(tda(n . n . hed(gTxt('section_head') . sp . popHelp('section_category'), 2) . n . '<div id="' . $event . '_control" class="txp-control-panel">' . n . n . form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('create'), 'smallerbox') . eInput('section') . sInput('section_create'), '', '', 'post', 'edit-form', '', 'section_create') . n . '</div>', ' colspan="3"')) . n . n . tr(td(gTxt('default'), '', 'label') . n . td(section_detail_partial($default)) . n . td(), ' class="section default"');
    $rs = safe_rows_start('*', 'txp_section', "name != 'default' order by name");
    if ($rs) {
        $ctr = 1;
Exemplo n.º 8
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Styles panel.
 *
 * @package Admin\CSS
 */
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
if ($event == 'css') {
    require_privs('css');
    bouncer($step, array('pour' => false, 'css_save' => true, 'css_delete' => true, 'css_edit' => false));
    switch (strtolower($step)) {
        case '':
            css_edit();
            break;
        case 'pour':
            css_edit();
            break;
        case 'css_save':
            css_save();
            break;
        case 'css_delete':
            css_delete();
            break;
        case 'css_edit':
            css_edit();
Exemplo n.º 9
0
	www.textpattern.com
	All rights reserved
	Use of this software indicates acceptance of the Textpattern license agreement
$HeadURL$
$LastChangedRevision$
*/
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
global $vars;
$vars = array('Form', 'type', 'name', 'savenew', 'oldname');
$essential_forms = array('comments', 'comments_display', 'comment_form', 'default', 'plainlinks', 'files');
$form_types = array('article' => gTxt('article'), 'misc' => gTxt('misc'), 'comment' => gTxt('comment'), 'category' => gTxt('category'), 'file' => gTxt('file'), 'link' => gTxt('link'), 'section' => gTxt('section'));
if ($event == 'form') {
    require_privs('form');
    bouncer($step, array('form_edit' => false, 'form_create' => false, 'form_delete' => true, 'form_multi_edit' => true, 'form_save' => true, 'save_pane_state' => true));
    switch (strtolower($step)) {
        case "":
            form_edit();
            break;
        case "form_edit":
            form_edit();
            break;
        case "form_create":
            form_create();
            break;
        case "form_delete":
            form_delete();
            break;
        case "form_multi_edit":
            form_multi_edit();
 /**
  * cbe_rand_content_router - Admin-side: Entry point
  *
  * @param   string $event admin event
  * @param   string $step  admin step
  * @return  void
  */
 function cbe_rand_content_router($event, $step)
 {
     global $step, $event;
     require_privs($event);
     ${CBE_RNDC_SPFX . 'message'} = '';
     ${CBE_RNDC_SPFX . 'html'} = '';
     $available_steps = array(CBE_RNDC_SPFX . 'initiate' => false, CBE_RNDC_SPFX . 'pop_art' => true, CBE_RNDC_SPFX . 'pop_com' => true);
     if (!$step) {
         $step = CBE_RNDC_SPFX . 'initiate';
     }
     while ($step && bouncer($step, $available_steps) && is_callable($func = "_{$step}")) {
         $step = $func(${CBE_RNDC_SPFX . 'message'}, ${CBE_RNDC_SPFX . 'html'});
     }
     pagetop(gTxt(CBE_RNDC_LPFX . 'tab_label'), ${CBE_RNDC_SPFX . 'message'});
     echo hed(gTxt(CBE_RNDC_LPFX . 'tab_label'), '1', ' class="txp-heading"') . tag(${CBE_RNDC_SPFX . 'html'}, 'div', ' class="text-column"');
     return;
 }
 /**
  * Entry point for requests
  * @param  string $event 	the event being called
  * @param  string $request  the step being called
  */
 public function handle_request($event, $request)
 {
     $requests = array('js' => false, 'css' => false, 'swf' => false);
     if (!$request || !bouncer($request, $requests)) {
         return;
     }
     switch ($request) {
         default:
             $this->{'render_' . $request}();
             break;
     }
 }
Exemplo n.º 12
0
/*
	This is Textpattern
	Copyright 2005 by Dean Allen
 	All rights reserved.
	Use of this software indicates acceptance of the Textpattern license agreement
$HeadURL$
$LastChangedRevision$
*/
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
global $statuses;
$statuses = array(1 => gTxt('draft'), 2 => gTxt('hidden'), 3 => gTxt('pending'), 4 => gTxt('live'), 5 => gTxt('sticky'));
if ($event == 'list') {
    require_privs('article');
    if (!$step or !bouncer($step, array('list_list' => false, 'list_change_pageby' => true, 'list_multi_edit' => true))) {
        $step = 'list_list';
    }
    $step();
}
//--------------------------------------------------------------
function list_list($message = '', $post = '')
{
    global $statuses, $comments_disabled_after, $step, $txp_user, $article_list_pageby, $event;
    pagetop(gTxt('tab_list'), $message);
    extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
    if ($sort === '') {
        $sort = get_pref('article_sort_column', 'posted');
    }
    if ($dir === '') {
        $dir = get_pref('article_sort_dir', 'desc');
Exemplo n.º 13
0
 /**
  * Private callback hook endpoint.
  */
 public function sync()
 {
     if (txpinterface === 'admin' && gps('rah_blobin_sync') && has_privs('rah_blobin_sync') && bouncer('sync', array('sync' => true))) {
         $this->import();
     }
 }
Exemplo n.º 14
0
function smd_ebook_dispatcher($evt, $stp)
{
    global $smd_ebook_event;
    $available_steps = array('smd_ebook' => false, 'smd_ebook_prefs' => false, 'smd_ebook_create' => true, 'smd_ebook_generate' => true, 'smd_ebook_loadfile' => true, 'smd_ebook_savefile' => true, 'smd_ebook_viewfile' => true, 'smd_ebook_viewimage' => true, 'smd_ebook_test' => true, 'smd_ebook_tidy' => false, 'save_pane_state' => true);
    if ($stp === 'save_pane_state') {
        smd_ebook_save_pane_state();
    } elseif ($stp and bouncer($stp, $available_steps)) {
        $stp();
    } else {
        $smd_ebook_event();
    }
}