public function gui($url)
 {
     $bls = $this->getServers();
     if (isset($_POST['bls'])) {
         try {
             $this->core->blog->settings->setNameSpace('antispam');
             $this->core->blog->settings->put('antispam_dnsbls', $_POST['bls'], 'string', 'Antispam DNSBL servers', true, false);
             http::redirect($url . '&upd=1');
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     $res = '';
     $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('IP Lookup servers') . '</legend>' . '<p>' . __('Add here a coma separated list of servers.') . '</p>' . '<p>' . form::textarea('bls', 40, 3, html::escapeHTML($bls), 'maximal') . '</p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $this->core->formNonce() . '</p>' . '</fieldset>' . '</form>';
     return $res;
 }
 public function gui($url)
 {
     $bls = $this->getServers();
     if (isset($_POST['bls'])) {
         try {
             $this->core->blog->settings->addNamespace('antispam');
             $this->core->blog->settings->antispam->put('antispam_dnsbls', $_POST['bls'], 'string', 'Antispam DNSBL servers', true, false);
             dcPage::addSuccessNotice(__('The list of DNSBL servers has been succesfully updated.'));
             http::redirect($url);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     $res = dcPage::notices();
     $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<h3>' . __('IP Lookup servers') . '</h3>' . '<p><label for="bls">' . __('Add here a coma separated list of servers.') . '</label>' . form::textarea('bls', 40, 3, html::escapeHTML($bls), 'maximal') . '</p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $this->core->formNonce() . '</p>' . '</form>';
     return $res;
 }
 public function gui($url)
 {
     $core =& $this->core;
     # Create list
     if (!empty($_POST['createlist'])) {
         try {
             $this->defaultWordsList();
             http::redirect($url . '&list=1');
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     # Adding a word
     if (!empty($_POST['swa'])) {
         $globalsw = !empty($_POST['globalsw']) && $core->auth->isSuperAdmin();
         try {
             $this->addRule($_POST['swa'], $globalsw);
             http::redirect($url . '&added=1');
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     # Removing spamwords
     if (!empty($_POST['swd']) && is_array($_POST['swd'])) {
         try {
             $this->removeRule($_POST['swd']);
             http::redirect($url . '&removed=1');
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     $res = '';
     if (!empty($_GET['list'])) {
         $res .= '<p class="message">' . __('Words have been successfully added.') . '</p>';
     }
     if (!empty($_GET['added'])) {
         $res .= '<p class="message">' . __('Word has been successfully added.') . '</p>';
     }
     if (!empty($_GET['removed'])) {
         $res .= '<p class="message">' . __('Words have been successfully removed.') . '</p>';
     }
     $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('Add a word') . '</legend>' . '<p>' . form::field('swa', 20, 128) . ' ';
     if ($core->auth->isSuperAdmin()) {
         $res .= '<label class="classic">' . form::checkbox('globalsw', 1) . ' ' . __('Global word') . '</label> ';
     }
     $res .= $core->formNonce() . '<input type="submit" value="' . __('Add') . '"/></p>' . '</fieldset>' . '</form>';
     $rs = $this->getRules();
     if ($rs->isEmpty()) {
         $res .= '<p><strong>' . __('No word in list.') . '</strong></p>';
     } else {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('List') . '</legend>' . '<div style="' . $this->style_list . '">';
         while ($rs->fetch()) {
             $disabled_word = false;
             $p_style = $this->style_p;
             if (!$rs->blog_id) {
                 $disabled_word = !$core->auth->isSuperAdmin();
                 $p_style .= $this->style_global;
             }
             $res .= '<p style="' . $p_style . '"><label class="classic">' . form::checkbox(array('swd[]'), $rs->rule_id, false, '', '', $disabled_word) . ' ' . html::escapeHTML($rs->rule_content) . '</label></p>';
         }
         $res .= '</div>' . '<p>' . form::hidden(array('spamwords'), 1) . $core->formNonce() . '<input class="submit" type="submit" value="' . __('Delete selected words') . '"/></p>' . '</fieldset></form>';
     }
     if ($core->auth->isSuperAdmin()) {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><input type="submit" value="' . __('Create default wordlist') . '" />' . form::hidden(array('spamwords'), 1) . form::hidden(array('createlist'), 1) . $core->formNonce() . '</p>' . '</form>';
     }
     return $res;
 }
Example #4
0
        echo '<form action="comments_actions.php" method="post">';
    }
    echo '<h3>' . __('Trackbacks') . '</h3>';
    if (!$trackbacks->isEmpty()) {
        showComments($trackbacks, $has_action);
    } else {
        echo '<p>' . __('No trackback') . '</p>';
    }
    echo '<h3>' . __('Comments') . '</h3>';
    if (!$comments->isEmpty()) {
        showComments($comments, $has_action);
    } else {
        echo '<p>' . __('No comment') . '</p>';
    }
    if ($has_action) {
        echo '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right">' . __('Selected comments action:') . ' ' . form::combo('action', $combo_action) . form::hidden('redir', html::escapeURL($redir_url) . '&amp;id=' . $post_id . '&amp;co=1') . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . '</div>' . '</form>';
    }
    echo '</div>';
}
/* Add a comment
-------------------------------------------------------- */
if ($post_id) {
    echo '<div class="multi-part" id="add-comment" title="' . __('Add a comment') . '">' . '<h3>' . __('Add a comment') . '</h3>' . '<form action="comment.php" method="post" id="comment-form">' . '<fieldset class="constrained">' . '<p><label class="required" title="' . __('Required field') . '">' . __('Name:') . form::field('comment_author', 30, 255, html::escapeHTML($core->auth->getInfo('user_cn'))) . '</label></p>' . '<p><label>' . __('Email:') . form::field('comment_email', 30, 255, html::escapeHTML($core->auth->getInfo('user_email'))) . '</label></p>' . '<p><label>' . __('Web site:') . form::field('comment_site', 30, 255, html::escapeHTML($core->auth->getInfo('user_url'))) . '</label></p>' . '<p class="area"><label for="comment_content" class="required" title="' . __('Required field') . '">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 8, html::escapeHTML('')) . '</p>' . '<p>' . form::hidden('post_id', $post_id) . $core->formNonce() . '<input type="submit" name="add" value="' . __('save') . '" /></p>' . '</fieldset>' . '</form>' . '</div>';
}
# Show comments or trackbacks
function showComments(&$rs, $has_action)
{
    echo '<table class="comments-list"><tr>' . '<th colspan="2">' . __('Author') . '</th>' . '<th>' . __('Date') . '</th>' . '<th class="nowrap">' . __('IP address') . '</th>' . '<th>' . __('Status') . '</th>' . '<th>&nbsp;</th>' . '</tr>';
    while ($rs->fetch()) {
        $comment_url = 'comment.php?id=' . $rs->comment_id;
        $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
Example #5
0
 private static function debugInfo()
 {
     $global_vars = implode(', ', array_keys($GLOBALS));
     $res = '<div id="debug"><div>' . '<p>memory usage: ' . memory_get_usage() . ' (' . files::size(memory_get_usage()) . ')</p>';
     if (function_exists('xdebug_get_profiler_filename')) {
         $res .= '<p>Elapsed time: ' . xdebug_time_index() . ' seconds</p>';
         $prof_file = xdebug_get_profiler_filename();
         if ($prof_file) {
             $res .= '<p>Profiler file : ' . xdebug_get_profiler_filename() . '</p>';
         } else {
             $prof_url = http::getSelfURI();
             $prof_url .= strpos($prof_url, '?') === false ? '?' : '&';
             $prof_url .= 'XDEBUG_PROFILE';
             $res .= '<p><a href="' . html::escapeURL($prof_url) . '">Trigger profiler</a></p>';
         }
         /* xdebug configuration:
         			zend_extension = /.../xdebug.so
         			xdebug.auto_trace = On
         			xdebug.trace_format = 0
         			xdebug.trace_options = 1
         			xdebug.show_mem_delta = On
         			xdebug.profiler_enable = 0
         			xdebug.profiler_enable_trigger = 1
         			xdebug.profiler_output_dir = /tmp
         			xdebug.profiler_append = 0
         			xdebug.profiler_output_name = timestamp
         			*/
     }
     $res .= '<p>Global vars: ' . $global_vars . '</p>' . '</div></div>';
     return $res;
 }
Example #6
0
function mediaItemLine($f, $i)
{
    global $core, $page_url, $popup, $post_id;
    $fname = $f->basename;
    if ($f->d) {
        $link = html::escapeURL($page_url) . '&amp;d=' . html::sanitizeURL($f->relname);
        if ($f->parent) {
            $fname = '..';
        }
    } else {
        $link = 'media_item.php?id=' . $f->media_id . '&amp;popup=' . $popup . '&amp;post_id=' . $post_id;
    }
    $class = 'media-item media-col-' . $i % 2;
    $res = '<div class="' . $class . '"><a class="media-icon media-link" href="' . $link . '">' . '<img src="' . $f->media_icon . '" alt="" /></a>' . '<ul>' . '<li><a class="media-link" href="' . $link . '">' . $fname . '</a></li>';
    if (!$f->d) {
        $res .= '<li>' . $f->media_title . '</li>' . '<li>' . $f->media_dtstr . ' - ' . files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>' . '</li>';
    }
    $res .= '<li class="media-action">&nbsp;';
    if ($post_id && !$f->d) {
        $res .= '<form action="post_media.php" method="post">' . '<input type="image" src="images/plus.png" alt="' . __('Attach this file to entry') . '" ' . 'title="' . __('Attach this file to entry') . '" /> ' . form::hidden('media_id', $f->media_id) . form::hidden('post_id', $post_id) . form::hidden('attach', 1) . $core->formNonce() . '</form>';
    }
    if ($popup && !$f->d) {
        $res .= '<a href="' . $link . '"><img src="images/plus.png" alt="' . __('Insert this file into entry') . '" ' . 'title="' . __('Insert this file into entry') . '" /></a> ';
    }
    if ($f->del) {
        $res .= '<a class="media-remove" ' . 'href="' . html::escapeURL($page_url) . '&amp;d=' . rawurlencode($GLOBALS['d']) . '&amp;remove=' . rawurlencode($f->basename) . '">' . '<img src="images/trash.png" alt="' . __('delete') . '" title="' . __('delete') . '" /></a>';
    }
    $res .= '</li>';
    if ($f->type == 'audio/mpeg3') {
        $res .= '<li>' . dcMedia::mp3player($f->file_url, 'index.php?pf=player_mp3.swf') . '</li>';
    }
    $res .= '</ul></div>';
    return $res;
}
 public function gui($url)
 {
     $blog =& $this->core->blog;
     $ak_key = $blog->settings->ak_key;
     $ak_verified = null;
     if (isset($_POST['ak_key'])) {
         try {
             $ak_key = $_POST['ak_key'];
             $blog->settings->setNameSpace('akismet');
             $blog->settings->put('ak_key', $ak_key, 'string');
             http::redirect($url . '&up=1');
         } catch (Exception $e) {
             $this->core->error->add($e->getMessage());
         }
     }
     if ($blog->settings->ak_key) {
         try {
             $ak = new akismet($blog->url, $blog->settings->ak_key);
             $ak_verified = $ak->verify();
         } catch (Exception $e) {
             $this->core->error->add($e->getMessage());
         }
     }
     $res = '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><label class="classic">' . __('Akismet API key:') . ' ' . form::field('ak_key', 12, 128, $ak_key) . '</label>';
     if ($ak_verified !== null) {
         if ($ak_verified) {
             $res .= ' <img src="images/check-on.png" alt="" /> ' . __('API key verified');
         } else {
             $res .= ' <img src="images/check-off.png" alt="" /> ' . __('API key not verified');
         }
     }
     $res .= '</p>';
     $res .= '<p><a href="http://wordpress.com/api-keys/">' . __('Get your own API key') . '</a></p>' . '<p><input type="submit" value="' . __('save') . '" />' . $this->core->formNonce() . '</p>' . '</form>';
     return $res;
 }
Example #8
0
 private function displayForms($url, $type, $title)
 {
     $res = '<h3>' . $title . '</h3>' . '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_Add_IP_address') . '</legend><p>' . form::hidden(array('ip_type'), $type) . form::text(array('addip'), 18, 255) . ' ';
     $res .= adminPage::formtoken() . '<input type="submit" value="' . __('c_c_action_Add') . '"/></p>' . '</fieldset></form>';
     $rs = $this->getRules($type);
     if ($rs->isEmpty()) {
         $res .= '<p><strong>' . __('m_antispam_No_IP_address_in_list') . '</strong></p>';
     } else {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_IP_list') . '</legend>' . '<div style="' . $this->style_list . '">';
         while ($rs->fetch()) {
             $bits = explode(':', $rs->rule_content);
             $pattern = $bits[0];
             $ip = $bits[1];
             $bitmask = $bits[2];
             $p_style = $this->style_p;
             $res .= '<p style="' . $p_style . '"><label class="classic">' . form::checkbox(array('delip[]'), $rs->rule_id, false) . ' ' . html::escapeHTML($pattern) . '</label></p>';
         }
         $res .= '</div>' . '<p><input type="submit" value="' . __('c_c_action_Delete') . '"/>' . adminPage::formtoken() . form::hidden(array('ip_type'), $type) . '</p>' . '</fieldset></form>';
     }
     return $res;
 }
 public function gui($url)
 {
     $blog =& $this->core->blog;
     $blog->settings->addNamespace('akismet');
     $ak_key = $blog->settings->akismet->ak_key;
     $ak_verified = null;
     if (isset($_POST['ak_key'])) {
         try {
             $ak_key = $_POST['ak_key'];
             $blog->settings->akismet->put('ak_key', $ak_key, 'string');
             dcPage::addSuccessNotice(__('Filter configuration have been successfully saved.'));
             http::redirect($url);
         } catch (Exception $e) {
             $this->core->error->add($e->getMessage());
         }
     }
     if ($blog->settings->akismet->ak_key) {
         try {
             $ak = new akismet($blog->url, $blog->settings->akismet->ak_key);
             $ak_verified = $ak->verify();
         } catch (Exception $e) {
             $this->core->error->add($e->getMessage());
         }
     }
     $res = dcPage::notices();
     $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<p><label for="ak_key" class="classic">' . __('Akismet API key:') . '</label> ' . form::field('ak_key', 12, 128, $ak_key);
     if ($ak_verified !== null) {
         if ($ak_verified) {
             $res .= ' <img src="images/check-on.png" alt="" /> ' . __('API key verified');
         } else {
             $res .= ' <img src="images/check-off.png" alt="" /> ' . __('API key not verified');
         }
     }
     $res .= '</p>';
     $res .= '<p><a href="http://akismet.com/">' . __('Get your own API key') . '</a></p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $this->core->formNonce() . '</p>' . '</form>';
     return $res;
 }
Example #10
0
 public function gui($url)
 {
     $core =& $this->core;
     # Create list
     if (!empty($_POST['createlist'])) {
         try {
             $this->defaultWordsList();
             dcPage::addSuccessNotice(__('Words have been successfully added.'));
             http::redirect($url);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     # Adding a word
     if (!empty($_POST['swa'])) {
         $globalsw = !empty($_POST['globalsw']) && $core->auth->isSuperAdmin();
         try {
             $this->addRule($_POST['swa'], $globalsw);
             dcPage::addSuccessNotice(__('Word has been successfully added.'));
             http::redirect($url);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     # Removing spamwords
     if (!empty($_POST['swd']) && is_array($_POST['swd'])) {
         try {
             $this->removeRule($_POST['swd']);
             dcPage::addSuccessNotice(__('Words have been successfully removed.'));
             http::redirect($url);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     $res = dcPage::notices();
     $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<p><label class="classic" for="swa">' . __('Add a word ') . '</label> ' . form::field('swa', 20, 128);
     if ($core->auth->isSuperAdmin()) {
         $res .= '<label class="classic" for="globalsw">' . form::checkbox('globalsw', 1) . __('Global word (used for all blogs)') . '</label> ';
     }
     $res .= $core->formNonce() . '</p>' . '<p><input type="submit" value="' . __('Add') . '"/></p>' . '</form>';
     $rs = $this->getRules();
     if ($rs->isEmpty()) {
         $res .= '<p><strong>' . __('No word in list.') . '</strong></p>';
     } else {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<h3>' . __('List of bad words') . '</h3>' . '<div class="antispam">';
         $res_global = '';
         $res_local = '';
         while ($rs->fetch()) {
             $disabled_word = false;
             $p_style = '';
             if (!$rs->blog_id) {
                 $disabled_word = !$core->auth->isSuperAdmin();
                 $p_style .= ' global';
             }
             $item = '<p class="' . $p_style . '"><label class="classic" for="word-' . $rs->rule_id . '">' . form::checkbox(array('swd[]', 'word-' . $rs->rule_id), $rs->rule_id, false, '', '', $disabled_word) . ' ' . html::escapeHTML($rs->rule_content) . '</label></p>';
             if ($rs->blog_id) {
                 // local list
                 if ($res_local == '') {
                     $res_local = '<h4>' . __('Local words (used only for this blog)') . '</h4>';
                 }
                 $res_local .= $item;
             } else {
                 // global list
                 if ($res_global == '') {
                     $res_global = '<h4>' . __('Global words (used for all blogs)') . '</h4>';
                 }
                 $res_global .= $item;
             }
         }
         $res .= '<div class="local">' . $res_local . '</div>';
         $res .= '<div class="global">' . $res_global . '</div>';
         $res .= '</div>' . '<p>' . form::hidden(array('spamwords'), 1) . $core->formNonce() . '<input class="submit delete" type="submit" value="' . __('Delete selected words') . '"/></p>' . '</form>';
     }
     if ($core->auth->isSuperAdmin()) {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><input type="submit" value="' . __('Create default wordlist') . '" />' . form::hidden(array('spamwords'), 1) . form::hidden(array('createlist'), 1) . $core->formNonce() . '</p>' . '</form>';
     }
     return $res;
 }
Example #11
0
}
dcPage::open(__('Users'), dcPage::jsLoad('js/_users_actions.js') . $core->callBehavior('adminUsersActionsHeaders'), $breadcrumb);
if (!isset($action)) {
    dcPage::close();
    exit;
}
$hidden_fields = '';
foreach ($users as $u) {
    $hidden_fields .= form::hidden(array('users[]'), $u);
}
if (isset($_POST['redir']) && strpos($_POST['redir'], '://') === false) {
    $hidden_fields .= form::hidden(array('redir'), html::escapeURL($_POST['redir']));
} else {
    $hidden_fields .= form::hidden(array('q'), html::escapeHTML($_POST['q'])) . form::hidden(array('sortby'), $_POST['sortby']) . form::hidden(array('order'), $_POST['order']) . form::hidden(array('page'), $_POST['page']) . form::hidden(array('nb'), $_POST['nb']);
}
echo '<p><a class="back" href="' . html::escapeURL($redir) . '">' . __('Back to user profile') . '</a></p>';
# --BEHAVIOR-- adminUsersActionsContent
$core->callBehavior('adminUsersActionsContent', $core, $action, $hidden_fields);
# Blog list where to set permissions
if (!empty($users) && empty($blogs) && $action == 'blogs') {
    try {
        $rs = $core->getBlogs();
        $nb_blog = $rs->count();
    } catch (Exception $e) {
    }
    foreach ($users as $u) {
        $user_list[] = '<a href="' . $core->adminurl->get("admin.user", array('id' => $u)) . '">' . $u . '</a>';
    }
    echo '<p>' . sprintf(__('Choose one or more blogs to which you want to give permissions to users %s.'), implode(', ', $user_list)) . '</p>';
    if ($nb_blog == 0) {
        echo '<p><strong>' . __('No blog') . '</strong></p>';
Example #12
0
function mediaItemLine($f, $i, $query, $table = false)
{
    global $core, $page_url, $popup, $select, $post_id, $plugin_id, $page_url_params;
    $fname = $f->basename;
    $file = $query ? $f->relname : $f->basename;
    $class = $table ? '' : 'media-item media-col-' . $i % 2;
    if ($f->d) {
        // Folder
        $link = $core->adminurl->get('admin.media', array_merge($page_url_params, array('d' => html::sanitizeURL($f->relname))));
        if ($f->parent) {
            $fname = '..';
            $class .= ' media-folder-up';
        } else {
            $class .= ' media-folder';
        }
    } else {
        // Item
        $params = new ArrayObject(array('id' => $f->media_id, 'plugin_id' => $plugin_id, 'popup' => $popup, 'select' => $select, 'post_id' => $post_id));
        $core->callBehavior('adminMediaURLParams', $params);
        $params = (array) $params;
        $link = $core->adminurl->get('admin.media.item', $params);
    }
    $maxchars = 36;
    if (strlen($fname) > $maxchars) {
        $fname = substr($fname, 0, $maxchars - 4) . '...' . ($f->d ? '' : files::getExtension($fname));
    }
    $act = '';
    if (!$f->d) {
        if ($select > 0) {
            if ($select == 1) {
                // Single media selection button
                $act .= '<a href="' . $link . '"><img src="images/plus.png" alt="' . __('Select this file') . '" ' . 'title="' . __('Select this file') . '" /></a> ';
            } else {
                // Multiple media selection checkbox
                $act .= form::checkbox(array('medias[]', 'media_' . rawurlencode($file)), $file);
            }
        } else {
            // Item
            if ($post_id) {
                // Media attachment button
                $act .= '<a class="attach-media" title="' . __('Attach this file to entry') . '" href="' . $core->adminurl->get("admin.post.media", array('media_id' => $f->media_id, 'post_id' => $post_id, 'attach' => 1)) . '">' . '<img src="images/plus.png" alt="' . __('Attach this file to entry') . '"/>' . '</a>';
            }
            if ($popup) {
                // Media insertion button
                $act .= '<a href="' . $link . '"><img src="images/plus.png" alt="' . __('Insert this file into entry') . '" ' . 'title="' . __('Insert this file into entry') . '" /></a> ';
            }
        }
    }
    if ($f->del) {
        // Deletion button or checkbox
        if (!$popup && !$f->d) {
            if ($select < 2) {
                // Already set for multiple media selection
                $act .= form::checkbox(array('medias[]', 'media_' . rawurlencode($file)), $file);
            }
        } else {
            $act .= '<a class="media-remove" ' . 'href="' . html::escapeURL($page_url) . '&amp;plugin_id=' . $plugin_id . '&amp;d=' . rawurlencode($GLOBALS['d']) . '&amp;q=' . rawurlencode($GLOBALS['q']) . '&amp;remove=' . rawurlencode($file) . '">' . '<img src="images/trash.png" alt="' . __('Delete') . '" title="' . __('delete') . '" /></a>';
        }
    }
    // Render markup
    if (!$table) {
        $res = '<div class="' . $class . '"><p><a class="media-icon media-link" href="' . rawurldecode($link) . '">' . '<img src="' . $f->media_icon . '" alt="" />' . ($query ? $file : $fname) . '</a></p>';
        $lst = '';
        if (!$f->d) {
            $lst .= '<li>' . $f->media_title . '</li>' . '<li>' . $f->media_dtstr . ' - ' . files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>' . '</li>';
        }
        $lst .= $act != '' ? '<li class="media-action">&nbsp;' . $act . '</li>' : '';
        // Show player if relevant
        $file_type = explode('/', $f->type);
        if ($file_type[0] == 'audio') {
            $lst .= '<li>' . dcMedia::audioPlayer($f->type, $f->file_url, $core->adminurl->get("admin.home", array('pf' => 'player_mp3.swf')), null, $core->blog->settings->system->media_flash_fallback) . '</li>';
        }
        $res .= $lst != '' ? '<ul>' . $lst . '</ul>' : '';
        $res .= '</div>';
    } else {
        $res = '<tr class="' . $class . '">';
        $res .= '<td class="media-action">' . $act . '</td>';
        $res .= '<td class="maximal" scope="row"><a class="media-flag media-link" href="' . rawurldecode($link) . '">' . '<img src="' . $f->media_icon . '" alt="" />' . ($query ? $file : $fname) . '</a>' . '<br />' . ($f->d ? '' : $f->media_title) . '</td>';
        $res .= '<td class="nowrap count">' . ($f->d ? '' : $f->media_dtstr) . '</td>';
        $res .= '<td class="nowrap count">' . ($f->d ? '' : files::size($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('open') . '</a>') . '</td>';
        $res .= '</tr>';
    }
    return $res;
}
Example #13
0
        }
        echo '</ul>';
    }
}
if ($file->type == 'image/jpeg') {
    echo '<h3>' . __('Image details') . '</h3>';
    if (count($file->media_meta) == 0) {
        echo '<p>' . __('No detail') . '</p>';
    } else {
        echo '<ul>';
        foreach ($file->media_meta as $k => $v) {
            if ((string) $v) {
                echo '<li><strong>' . $k . ':</strong> ' . html::escapeHTML($v) . '</li>';
            }
        }
        echo '</ul>';
    }
}
if ($file->editable && $core_media_writable) {
    if ($file->media_type == 'image') {
        echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Update thumbnails') . '</legend>' . '<p>' . __('This will create or update thumbnails for this image.') . '</p>' . '<p><input type="submit" name="thumbs" value="' . __('update thumbnails') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
    }
    if ($file->type == 'application/zip') {
        $inflate_combo = array(__('Extract in a new directory') => 'new', __('Extract in current directory') => 'current');
        echo '<form class="clear" id="file-unzip" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Extract archive') . '</legend>' . '<ul>' . '<li><strong>' . __('Extract in a new directory') . '</strong> : ' . __('This will extract archive in a new directory that should not exists yet.') . '</li>' . '<li><strong>' . __('Extract in current directory') . '</strong> : ' . __('This will extract archive in current directory and will overwrite existing files or directory.') . '</li>' . '</ul>' . '<p><label class="classic">' . __('Extract mode:') . ' ' . form::combo('inflate_mode', $inflate_combo, 'new') . '</label> ' . '<input type="submit" name="unzip" value="' . __('extract') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
    }
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Change media properties') . '</legend>' . '<p><label>' . __('File name:') . form::field('media_file', 30, 255, html::escapeHTML($file->basename)) . '</label></p>' . '<p><label>' . __('File title:') . form::field('media_title', 30, 255, html::escapeHTML($file->media_title)) . '</label></p>' . '<p><label>' . __('File date:') . form::field('media_dt', 16, 16, html::escapeHTML($file->media_dtstr)) . '</label></p>' . '<p><label class="classic">' . form::checkbox('media_private', 1, $file->media_priv) . ' ' . __('Private') . '</label></p>' . '<p><label>' . __('New directory:') . form::combo('media_path', $dirs_combo, dirname($file->relname)) . '</label></p>' . '<p><input type="submit" accesskey="s" value="' . __('save') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post" enctype="multipart/form-data">' . '<fieldset><legend>' . __('Change file') . '</legend>' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . '</div>' . '<p><label>' . __('Choose a file:') . ' (' . sprintf(__('Maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ') ' . '<input type="file" name="upfile" size="35" />' . '</label></p>' . '<p><input type="submit" value="' . __('send') . '" />' . form::hidden(array('id'), $id) . $core->formNonce() . '</p>' . '</fieldset></form>';
}
echo '</div>' . '</div>';
call_user_func($close_f);
Example #14
0
function mediaItemLine($f, $i)
{
    global $okt, $page_url, $popup;
    $fname = $f->basename;
    if ($f->d) {
        $link = html::escapeURL($page_url) . '&amp;d=' . html::sanitizeURL($f->relname);
        if ($f->parent) {
            $fname = '..';
        }
    } else {
        $link = 'module.php?m=media_manager&action=item&id=' . $f->media_id . '&amp;popup=' . $popup;
    }
    $class = 'media-item media-col-' . $i % 2;
    $res = '<div class="' . $class . '"><a class="media-icon media-link" href="' . $link . '">' . '<img src="' . $f->media_icon . '" alt="" /></a>' . '<ul>' . '<li><a class="media-link" href="' . $link . '">' . $fname . '</a></li>';
    if (!$f->d) {
        $res .= '<li>' . $f->media_title . '</li>' . '<li>' . $f->media_dtstr . ' - ' . util::l10nFileSize($f->size) . ' - ' . '<a href="' . $f->file_url . '">' . __('c_c_action_open') . '</a>' . '</li>';
    }
    $res .= '<li class="media-action">&nbsp;';
    if ($popup && !$f->d) {
        $res .= '<a href="' . $link . '"><img src="' . OKT_PUBLIC_URL . '/img/ico/plus.png" alt="' . __('Insert this file') . '" ' . 'title="' . __('Insert this file') . '" /></a> ';
    }
    if ($f->del) {
        $res .= '<a href="' . html::escapeURL($page_url) . '&amp;d=' . rawurlencode($GLOBALS['d']) . '&amp;remove=' . rawurlencode($f->basename) . '" class="icon delete">' . __('c_c_action_delete') . '</a>';
    }
    $res .= '</li>';
    if ($f->type == 'audio/mpeg3') {
        $res .= '<li>' . oktMedia::mp3player($f->file_url, 'index.php?pf=player_mp3.swf') . '</li>';
    }
    $res .= '</ul></div>';
    return $res;
}
Example #15
0
 private function displayForms($url, $type, $title)
 {
     $core =& $this->core;
     $res = '<div class="multi-part" id="tab_' . $type . '" title="' . $title . '">' . '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('Add an IP address') . '</legend><p>' . form::hidden(array('ip_type'), $type) . form::field(array('addip'), 18, 255) . ' ';
     if ($core->auth->isSuperAdmin()) {
         $res .= '<label class="classic">' . form::checkbox(array('globalip'), 1) . ' ' . __('Global IP') . '</label> ';
     }
     $res .= $core->formNonce() . '<input type="submit" value="' . __('Add') . '"/></p>' . '</fieldset></form>';
     $rs = $this->getRules($type);
     if ($rs->isEmpty()) {
         $res .= '<p><strong>' . __('No IP address in list.') . '</strong></p>';
     } else {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('IP list') . '</legend>' . '<div style="' . $this->style_list . '">';
         while ($rs->fetch()) {
             $bits = explode(':', $rs->rule_content);
             $pattern = $bits[0];
             $ip = $bits[1];
             $bitmask = $bits[2];
             $disabled_ip = false;
             $p_style = $this->style_p;
             if (!$rs->blog_id) {
                 $disabled_ip = !$core->auth->isSuperAdmin();
                 $p_style .= $this->style_global;
             }
             $res .= '<p style="' . $p_style . '"><label class="classic">' . form::checkbox(array('delip[]'), $rs->rule_id, false, '', '', $disabled_ip) . ' ' . html::escapeHTML($pattern) . '</label></p>';
         }
         $res .= '</div>' . '<p><input class="submit" type="submit" value="' . __('Delete') . '"/>' . $core->formNonce() . form::hidden(array('ip_type'), $type) . '</p>' . '</fieldset></form>';
     }
     $res .= '</div>';
     return $res;
 }
Example #16
0
    $limit = 1000;
    echo '<p>' . sprintf(__('Indexing entry %d to %d.'), $start, $start + $limit) . '</p>';
    $new_start = $core->indexAllPosts($start, $limit);
    if ($new_start) {
        $new_url = $p_url . '&action=index&indexposts=1&start=' . $new_start;
        echo '<script type="text/javascript">' . "\n" . "//<![CDATA\n" . "window.location = '" . $new_url . "'\n" . "//]]>\n" . '</script>' . '<noscript><p><a href="' . html::escapeURL($new_url) . '">' . __('next') . '</a></p></noscript>';
    } else {
        echo '<p class="message">' . __('Entries index done.') . '</p>';
        echo '<p><a class="back" href="' . $p_url . '">' . __('Back') . '</a></p>';
    }
} elseif ($action == 'index' && !empty($_GET['indexcomments'])) {
    $limit = 1000;
    echo '<p>' . sprintf(__('Indexing comment %d to %d.'), $start, $start + $limit) . '</p>';
    $new_start = $core->indexAllComments($start, $limit);
    if ($new_start) {
        $new_url = $p_url . '&action=index&indexcomments=1&start=' . $new_start;
        echo '<script type="text/javascript">' . "\n" . "//<![CDATA\n" . "window.location = '" . $new_url . "'\n" . "//]]>\n" . '</script>' . '<noscript><p><a href="' . html::escapeURL($new_url) . '">' . __('next') . '</a></p></noscript>';
    } else {
        echo '<p class="message">' . __('Comments index done.') . '</p>';
        echo '<p><a class="back" href="' . $p_url . '">' . __('Back') . '</a></p>';
    }
} else {
    echo '<h3>' . __('Optimize database room') . '</h3>' . '<form action="plugin.php" method="post">' . '<p><input type="submit" value="' . __('Vacuum tables') . '" /> ' . $core->formNonce() . form::hidden(array('action'), 'vacuum') . form::hidden(array('p'), 'maintenance') . '</p>' . '</form>';
    echo '<h3>' . __('Counters') . '</h3>' . '<form action="plugin.php" method="post">' . '<p><input type="submit" value="' . __('Reset comments and ping counters') . '" /> ' . $core->formNonce() . form::hidden(array('action'), 'commentscount') . form::hidden(array('p'), 'maintenance') . '</p>' . '</form>';
    echo '<h3>' . __('Search engine index') . ' (' . __('This may take a very long time') . ')</h3>' . '<form action="plugin.php" method="get">' . '<p><input type="submit" name="indexposts" value="' . __('Index all posts') . '" /> ' . '<input type="submit" name="indexcomments" value="' . __('Index all comments') . '" /> ' . form::hidden(array('action'), 'index') . form::hidden(array('p'), 'maintenance') . '</p>' . '</form>';
    echo '<h3>' . __('Empty templates cache directory') . '</h3>' . '<form action="plugin.php" method="post">' . '<p><input type="submit" value="' . __('Empty directory') . '" /> ' . $core->formNonce() . form::hidden(array('action'), 'empty_cache') . form::hidden(array('p'), 'maintenance') . '</p>' . '</form>';
}
?>

</body>
</html>
Example #17
0
         }
         if (preg_match('#<meta\\s+name="video_height"\\s+content="(\\d+?)"#ms', $content, $m)) {
             $h = $m[1];
         }
         if (preg_match('#<meta\\s+name="video_width"\\s+content="(\\d+?)"#ms', $content, $m)) {
             $w = $m[1];
         }
         $m_object = '<object type="application/x-shockwave-flash" data="' . $movie . '" width="' . $w . '" height="' . $h . '">' . "\n" . '  <param name="movie" value="' . $movie . '" />' . "\n" . '  <param name="wmode" value="transparent" />' . "\n" . '  <param name="FlashVars" value="autoplay=0&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1" />' . "\n" . '</object>';
     }
     break;
 case 'youtube':
     if (preg_match('#<input.+?\\s+name="embed_code".+?\\s+value="(.+?)"#ms', $content, $m)) {
         $cap = html::decodeEntities($m[1]);
         $movie = '';
         if (preg_match('#param\\s+name="movie"\\s+value="(.+?)"#s', $cap, $M)) {
             $movie = html::escapeURL($M[1]);
         }
         if (preg_match('#<title>Youtube\\s+-\\s+(.+?)</title>#si', $content, $M)) {
             $m_title = $M[1];
         }
         if ($movie) {
             $m_object = '<object type="application/x-shockwave-flash" data="' . $movie . '" width="425" height="350">' . "\n" . '  <param name="movie" value="' . $movie . '" />' . "\n" . '  <param name="wmode" value="transparent" />' . "\n" . '</object>';
         }
     }
     break;
 case 'jamendo':
     if (preg_match('#^http://(www.)?jamendo.com/[a-z]{2}/(playlist|album|track)/([0-9]+)#', $media_page, $m)) {
         $type = $m[2];
         $id = $m[3];
         $req = 'name';
         if ($type == 'track') {
Example #18
0
 public function gui($url)
 {
     # Create list
     if (!empty($_POST['createlist'])) {
         try {
             $this->defaultWordsList();
             http::redirect($url . '&list=1');
         } catch (Exception $e) {
             $this->okt->error->set($e->getMessage());
         }
     }
     # Adding a word
     if (!empty($_POST['swa'])) {
         try {
             $this->addRule($_POST['swa']);
             http::redirect($url . '&added=1');
         } catch (Exception $e) {
             $okt->error->add($e->getMessage());
         }
     }
     # Removing spamwords
     if (!empty($_POST['swd']) && is_array($_POST['swd'])) {
         try {
             $this->removeRule($_POST['swd']);
             http::redirect($url . '&removed=1');
         } catch (Exception $e) {
             $okt->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     global $okt;
     $okt->page->messages->success('list', __('m_antispam_Words_successfully_added'));
     $okt->page->messages->success('added', __('m_antispam_Word_successfully_added'));
     $okt->page->messages->success('removed', __('m_antispam_Words_successfully_removed'));
     $res = '';
     $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_Add_word') . '</legend>' . '<p>' . form::text('swa', 20, 128) . ' ';
     $res .= adminPage::formtoken() . '<input type="submit" value="' . __('c_c_action_Add') . '"/></p>' . '</fieldset>' . '</form>';
     $rs = $this->getRules();
     if ($rs->isEmpty()) {
         $res .= '<p><strong>' . __('m_antispam_No_word_in_list') . '</strong></p>';
     } else {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_List') . '</legend>' . '<div style="' . $this->style_list . '">';
         while ($rs->fetch()) {
             $disabled_word = false;
             $p_style = $this->style_p;
             $res .= '<p style="' . $p_style . '"><label class="classic">' . form::checkbox(array('swd[]'), $rs->rule_id, false) . ' ' . html::escapeHTML($rs->rule_content) . '</label></p>';
         }
         $res .= '</div>' . '<p>' . form::hidden(array('spamwords'), 1) . adminPage::formtoken() . '<input type="submit" value="' . __('m_antispam_Delete_selected_words') . '"/></p>' . '</fieldset></form>';
     }
     $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><input type="submit" value="' . __('m_antispam_Create_default_wordlist') . '" />' . form::hidden(array('spamwords'), 1) . form::hidden(array('createlist'), 1) . adminPage::formtoken() . '</p>' . '</form>';
     return $res;
 }
 public function getPostPublicURL($type, $post_url, $escaped = true)
 {
     if (!isset($this->post_types[$type])) {
         $type = 'post';
     }
     $url = sprintf($this->post_types[$type]['public_url'], $post_url);
     return $escaped ? html::escapeURL($url) : $url;
 }
Example #20
0
 private function displayForms($url, $type, $title)
 {
     $core =& $this->core;
     $res = '<div class="multi-part" id="tab_' . $type . '" title="' . $title . '">' . '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<p>' . form::hidden(array('ip_type'), $type) . '<label class="classic" for="addip_' . $type . '">' . __('Add an IP address: ') . '</label> ' . form::field(array('addip', 'addip_' . $type), 18, 255);
     if ($core->auth->isSuperAdmin()) {
         $res .= '<label class="classic" for="globalip_' . $type . '">' . form::checkbox(array('globalip', 'globalip_' . $type), 1) . ' ' . __('Global IP (used for all blogs)') . '</label> ';
     }
     $res .= $core->formNonce() . '</p>' . '<p><input type="submit" value="' . __('Add') . '"/></p>' . '</form>';
     $rs = $this->getRules($type);
     if ($rs->isEmpty()) {
         $res .= '<p><strong>' . __('No IP address in list.') . '</strong></p>';
     } else {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<h3>' . __('IP list') . '</h3>' . '<div class="antispam">';
         $res_global = '';
         $res_local = '';
         while ($rs->fetch()) {
             $bits = explode(':', $rs->rule_content);
             $pattern = $bits[0];
             $ip = $bits[1];
             $bitmask = $bits[2];
             $disabled_ip = false;
             $p_style = '';
             if (!$rs->blog_id) {
                 $disabled_ip = !$core->auth->isSuperAdmin();
                 $p_style .= ' global';
             }
             $item = '<p class="' . $p_style . '"><label class="classic" for="' . $type . '-ip-' . $rs->rule_id . '">' . form::checkbox(array('delip[]', $type . '-ip-' . $rs->rule_id), $rs->rule_id, false, '', '', $disabled_ip) . ' ' . html::escapeHTML($pattern) . '</label></p>';
             if ($rs->blog_id) {
                 // local list
                 if ($res_local == '') {
                     $res_local = '<h4>' . __('Local IPs (used only for this blog)') . '</h4>';
                 }
                 $res_local .= $item;
             } else {
                 // global list
                 if ($res_global == '') {
                     $res_global = '<h4>' . __('Global IPs (used for all blogs)') . '</h4>';
                 }
                 $res_global .= $item;
             }
         }
         $res .= $res_local . $res_global;
         $res .= '</div>' . '<p><input class="submit delete" type="submit" value="' . __('Delete') . '"/>' . $core->formNonce() . form::hidden(array('ip_type'), $type) . '</p>' . '</form>';
     }
     $res .= '</div>';
     return $res;
 }
Example #21
0
        echo '<p>' . __('No detail') . '</p>';
    } else {
        echo '<ul>';
        foreach ($file->media_meta as $k => $v) {
            if ((string) $v) {
                echo '<li><strong>' . $k . ':</strong> ' . html::escapeHTML($v) . '</li>';
            }
        }
        echo '</ul>';
    }
}
if ($file->editable && $core_media_writable) {
    if ($file->media_type == 'image') {
        echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Update thumbnails') . '</legend>' . '<p>' . __('This will create or update thumbnails for this image.') . '</p>' . '<p><input type="submit" name="thumbs" value="' . __('update thumbnails') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    }
    if ($file->type == 'application/zip') {
        $inflate_combo = array(__('Extract in a new directory') => 'new', __('Extract in current directory') => 'current');
        echo '<form class="clear" id="file-unzip" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Extract archive') . '</legend>' . '<ul>' . '<li><strong>' . __('Extract in a new directory') . '</strong> : ' . __('This will extract archive in a new directory that should not exists yet.') . '</li>' . '<li><strong>' . __('Extract in current directory') . '</strong> : ' . __('This will extract archive in current directory and will overwrite existing files or directory.') . '</li>' . '</ul>' . '<p><label class="classic">' . __('Extract mode:') . ' ' . form::select('inflate_mode', $inflate_combo, 'new') . '</label> ' . '<input type="submit" name="unzip" value="' . __('c_c_action_extract') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    }
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Change media properties') . '</legend>' . '<p class="field"><label>' . __('File name:') . '</label>' . form::text('media_file', 30, 255, html::escapeHTML($file->basename)) . '</p>' . '<p class="field"><label>' . __('File title:') . '</label>' . form::text('media_title', 30, 255, html::escapeHTML($file->media_title)) . '</p>' . '<p class="field"><label>' . __('File date:') . '</label>' . form::text('media_dt', 16, 16, html::escapeHTML($file->media_dtstr)) . '</p>' . '<p class="field"><label class="classic">' . form::checkbox('media_private', 1, $file->media_priv) . ' ' . __('Private') . '</label></p>' . '<p class="field"><label>' . __('New directory:') . '</label>' . form::select('media_path', $dirs_combo, dirname($file->relname)) . '</p>' . '<p><input type="submit" value="' . __('c_c_action_save') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post" enctype="multipart/form-data">' . '<fieldset><legend>' . __('Change file') . '</legend>' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), OKT_MAX_UPLOAD_SIZE) . '</div>' . '<p class="field"><label for="upfile">' . __('Choose a file:') . '</label>' . '<input type="file" id="upfile" name="upfile" size="35" /></p>' . '<p class="note">' . sprintf(__('c_c_maximum_file_size_%s'), util::l10nFileSize(OKT_MAX_UPLOAD_SIZE)) . '</p>' . '<p><input type="submit" value="' . __('c_c_action_send') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
}
echo '</div>';
echo '</div>';
echo '</div>';
# Pied-de-page
if ($popup) {
    require OKT_ADMIN_FOOTER_SIMPLE_FILE;
} else {
    require OKT_ADMIN_FOOTER_FILE;
}
Example #22
0
if (isset($_POST['redir']) && strpos($_POST['redir'], '://') === false) {
    $hidden_fields .= form::hidden(array('redir'), html::escapeURL($_POST['redir']));
} else {
    $hidden_fields .= form::hidden(array('user_id'), $_POST['user_id']) . form::hidden(array('cat_id'), $_POST['cat_id']) . form::hidden(array('status'), $_POST['status']) . form::hidden(array('selected'), $_POST['selected']) . form::hidden(array('month'), $_POST['month']) . form::hidden(array('lang'), $_POST['lang']) . form::hidden(array('sortby'), $_POST['sortby']) . form::hidden(array('order'), $_POST['order']) . form::hidden(array('page'), $_POST['page']) . form::hidden(array('nb'), $_POST['nb']);
}
if (isset($_POST['post_type'])) {
    $hidden_fields .= form::hidden(array('post_type'), $_POST['post_type']);
}
# --BEHAVIOR-- adminPostsActionsContent
$core->callBehavior('adminPostsActionsContent', $core, $action, $hidden_fields);
if ($action == 'category') {
    echo '<h2>' . __('Change category for entries') . '</h2>';
    # categories list
    # Getting categories
    $categories_combo = array('&nbsp;' => '');
    try {
        $categories = $core->blog->getCategories(array('post_type' => 'post'));
        while ($categories->fetch()) {
            $categories_combo[] = new formSelectOption(str_repeat('&nbsp;&nbsp;', $categories->level - 1) . '&bull; ' . html::escapeHTML($categories->cat_title), $categories->cat_id);
        }
    } catch (Exception $e) {
    }
    echo '<form action="posts_actions.php" method="post">' . '<p><label class="classic">' . __('Category:') . ' ' . form::combo('new_cat_id', $categories_combo, '') . '</label> ';
    echo $hidden_fields . $core->formNonce() . form::hidden(array('action'), 'category') . '<input type="submit" value="' . __('save') . '" /></p>' . '</form>';
} elseif ($action == 'author' && $core->auth->check('admin', $core->blog->id)) {
    echo '<h2>' . __('Change author for entries') . '</h2>';
    echo '<form action="posts_actions.php" method="post">' . '<p><label class="classic">' . __('Author ID:') . ' ' . form::field('new_auth_id', 20, 255) . '</label> ';
    echo $hidden_fields . $core->formNonce() . form::hidden(array('action'), 'author') . '<input type="submit" value="' . __('save') . '" /></p>' . '</form>';
}
echo '<p><a class="back" href="' . html::escapeURL($redir) . '">' . __('back') . '</a></p>';
dcPage::close();