Exemplo n.º 1
0
/**
 * Callback to make post type name depending on post type id
 */
function get_name_for_itemtype($ityp_ID, $name)
{
    global $admin_url, $edited_Item, $from_tab;
    $current = $edited_Item->ityp_ID == $ityp_ID ? ' ' . T_('(current)') : '';
    $from_tab_param = empty($from_tab) ? '' : '&from_tab=' . $from_tab;
    $duplicated_item_param = get_param('p') > 0 ? '&p=' . get_param('p') : '';
    return '<strong><a href="' . $admin_url . '?ctrl=items&amp;action=update_type&amp;post_ID=' . $edited_Item->ID . '&amp;ityp_ID=' . $ityp_ID . $from_tab_param . $duplicated_item_param . '&amp;' . url_crumb('item') . '">' . $name . '</a></strong>' . $current;
}
 /**
  * Get actions links for IP range
  *
  * @param integer IP range ID
  * @param string Current tab value
  * @return string HTML links to edit and delete IP range
  */
 function antispam_ipranges_actions($aipr_ID, $tab_param)
 {
     global $admin_url;
     // A link to edit IP range
     $r = action_icon(T_('Edit this IP range...'), 'properties', $admin_url . '?ctrl=antispam' . $tab_param . '&amp;tab3=ipranges&amp;iprange_ID=' . $aipr_ID . '&amp;action=iprange_edit');
     // A link to delete IP range
     $r .= action_icon(T_('Delete this IP range!'), 'delete', regenerate_url('iprange_ID,action', 'iprange_ID=' . $aipr_ID . '&amp;action=iprange_delete&amp;' . url_crumb('iprange')));
     return $r;
 }
 function edit_actions($ID)
 {
     global $locked_IDs, $GenericElementCache;
     $r = action_icon(T_('Duplicate...'), 'copy', regenerate_url('action,' . $GenericElementCache->dbIDname, $GenericElementCache->dbIDname . '=' . $ID . '&amp;action=copy'));
     if (empty($locked_IDs) || !in_array($ID, $locked_IDs)) {
         // This element is NOT locked:
         $r = action_icon(T_('Edit...'), 'edit', regenerate_url('action,' . $GenericElementCache->dbIDname, $GenericElementCache->dbIDname . '=' . $ID . '&amp;action=edit')) . $r . action_icon(T_('Delete!'), 'delete', regenerate_url('action,' . $GenericElementCache->dbIDname, $GenericElementCache->dbIDname . '=' . $ID . '&amp;action=delete&amp;' . url_crumb('element')));
     }
     return $r;
 }
Exemplo n.º 4
0
function td_file_properties_link($File, $link_text)
{
    global $current_User;
    if (is_object($File) && $current_User->check_perm('files', 'edit_allowed', false, $File->get_FileRoot())) {
        // Check if File object is correct and current user has an access
        return '<a href="' . url_add_param($File->get_linkedit_url(), 'action=edit_properties&amp;fm_selected[]=' . rawurlencode($File->get_rdfp_rel_path()) . '&amp;' . url_crumb('file')) . '">' . $link_text . '</a>';
    } else {
        return $link_text;
    }
}
Exemplo n.º 5
0
/**
 * Callback to build possible actions depending on item type id
 *
 */
function get_actions_for_itemtype($id)
{
    global $reserved_ids;
    $action = action_icon(T_('Duplicate this item type...'), 'copy', regenerate_url('action', 'ptyp_ID=' . $id . '&amp;action=new'));
    if ($id < $reserved_ids[0] || $id > $reserved_ids[1]) {
        // not reserved id
        $action = action_icon(T_('Edit this item type...'), 'edit', regenerate_url('action', 'ptyp_ID=' . $id . '&amp;action=edit')) . $action . action_icon(T_('Delete this item type!'), 'delete', regenerate_url('action', 'ptyp_ID=' . $id . '&amp;action=delete&amp;' . url_crumb('itemtype') . ''));
    }
    return $action;
}
Exemplo n.º 6
0
 function tagitem_edit_actions($Item)
 {
     global $current_User, $edited_ItemTag;
     // Display the edit icon if current user has the rights:
     $r = $Item->get_edit_link(array('before' => '', 'after' => ' ', 'text' => get_icon('edit'), 'title' => '#', 'class' => ''));
     if ($current_User->check_perm('item_post!CURSTATUS', 'edit', false, $Item)) {
         // Display the unlink icon if current user has the rights:
         $r .= action_icon(T_('Unlink this tag from post!'), 'unlink', regenerate_url('tag_ID,action,tag_filter', 'tag_ID=' . $edited_ItemTag->ID . '&amp;item_ID=' . $Item->ID . '&amp;action=unlink&amp;' . url_crumb('tag')), NULL, NULL, NULL, array('onclick' => 'return confirm(\'' . format_to_output(sprintf(TS_('Are you sure you want to remove the tag "%s" from "%s"?'), $edited_ItemTag->dget('name'), $Item->dget('title')) . '\');', 'htmlattr')));
     }
     return $r;
 }
Exemplo n.º 7
0
function curr_td_actions($curr_enabled, $curr_ID)
{
    global $dispatcher;
    $r = '';
    if ($curr_enabled == true) {
        $r .= action_icon(T_('Disable the currency!'), 'deactivate', regenerate_url('action', 'action=disable_currency&amp;curr_ID=' . $curr_ID . '&amp;' . url_crumb('currency')));
    } else {
        $r .= action_icon(T_('Enable the currency!'), 'activate', regenerate_url('action', 'action=enable_currency&amp;curr_ID=' . $curr_ID . '&amp;' . url_crumb('currency')));
    }
    $r .= action_icon(T_('Edit this currency...'), 'edit', regenerate_url('action', 'curr_ID=' . $curr_ID . '&amp;action=edit'));
    $r .= action_icon(T_('Duplicate this currency...'), 'copy', regenerate_url('action', 'curr_ID=' . $curr_ID . '&amp;action=new'));
    $r .= action_icon(T_('Delete this currency!'), 'delete', regenerate_url('action', 'curr_ID=' . $curr_ID . '&amp;action=delete&amp;' . url_crumb('currency')));
    return $r;
}
Exemplo n.º 8
0
function grp_actions(&$row)
{
    global $usedgroups, $Settings, $current_User;
    $r = '';
    if ($current_User->check_perm('users', 'edit', false)) {
        $r = action_icon(T_('Edit this group...'), 'edit', regenerate_url('ctrl,action', 'ctrl=groups&amp;action=edit&amp;grp_ID=' . $row->grp_ID));
        $r .= action_icon(T_('Duplicate this group...'), 'copy', regenerate_url('ctrl,action', 'ctrl=groups&amp;action=new&amp;grp_ID=' . $row->grp_ID));
        if ($row->grp_ID != 1 && $row->grp_ID != $Settings->get('newusers_grp_ID') && !in_array($row->grp_ID, $usedgroups)) {
            // delete
            $r .= action_icon(T_('Delete this group!'), 'delete', regenerate_url('ctrl,action', 'ctrl=groups&amp;action=delete&amp;grp_ID=' . $row->grp_ID . '&amp;' . url_crumb('group')));
        } else {
            $r .= get_icon('delete', 'noimg');
        }
    }
    return $r;
}
/**
 * Generate category line when it has children
 *
 * @param GenericCategory generic category we want to display
 * @param int level of the category in the recursive tree
 * @return string HTML
 */
function cat_line($GenericCategory, $level)
{
    global $line_class, $result_fadeout, $permission_to_edit, $current_User;
    $line_class = $line_class == 'even' ? 'odd' : 'even';
    $r = '<tr id="tr-' . $GenericCategory->ID . '"class="' . $line_class . (in_array($GenericCategory->ID, $result_fadeout) ? ' fadeout-ffff00' : '') . '">
					<td class="firstcol shrinkwrap">' . $GenericCategory->ID . '
					</td>';
    if ($permission_to_edit) {
        // We have permission permission to edit, so display action column:
        $edit_url = regenerate_url('action,' . $GenericCategory->dbIDname, $GenericCategory->dbIDname . '=' . $GenericCategory->ID . '&amp;action=edit');
        $r .= '<td>
						<label style="padding-left: ' . $level . 'em;"><a href="' . $edit_url . '" title="' . T_('Edit...') . '">' . $GenericCategory->name . '</a></label>
					 </td>
					 <td class="lastcol shrinkwrap">' . action_icon(T_('New...'), 'new', regenerate_url('action,' . $GenericCategory->dbIDname . ',' . $GenericCategory->dbprefix . 'parent_ID', $GenericCategory->dbprefix . 'parent_ID=' . $GenericCategory->ID . '&amp;action=new')) . action_icon(T_('Edit...'), 'edit', $edit_url) . action_icon(T_('Delete...'), 'delete', regenerate_url('action,' . $GenericCategory->dbIDname, $GenericCategory->dbIDname . '=' . $GenericCategory->ID . '&amp;action=delete&amp;' . url_crumb('element'))) . '
					 </td>';
    } else {
        $r .= '<td class="lastcol">
						 <label style="padding-left: ' . $level . 'em;">' . $GenericCategory->name . '</label>
					 </td>';
    }
    $r .= '</tr>';
    return $r;
}
Exemplo n.º 10
0
    echo '<li><a href="' . regenerate_url('action', 'action=utf8check&amp;' . url_crumb('tools')) . '">' . T_('Check/Convert/Normalize the charsets/collations used by the DB (UTF-8 / ASCII)') . '</a></li>';
    // echo '<li><a href="'.regenerate_url('action', 'action=backup_db').'">'.T_('Backup database').'</a></li>';
    echo '</ul>';
    $block_item_Widget->disp_template_raw('block_end');
    $block_item_Widget->title = T_('Cleanup tools');
    $block_item_Widget->disp_template_replaced('block_start');
    echo '<ul>';
    echo '<li><a href="' . $admin_url . '?ctrl=itemtags&amp;action=cleanup&amp;' . url_crumb('tag') . '">' . T_('Find and delete all orphan Tag entries (not used anywhere) - DB only.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=find_broken_posts&amp;' . url_crumb('tools')) . '">' . T_('Find all broken posts (with no matching Category) + Option to delete with related objects - DB only.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=find_broken_slugs&amp;' . url_crumb('tools')) . '">' . T_('Find all broken slugs (with no matching Item) + Option to delete - DB only.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=delete_orphan_comments&amp;' . url_crumb('tools')) . '">' . T_('Find and delete all orphan Comments (with no matching Item) - Disk &amp; DB.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=delete_orphan_comment_uploads&amp;' . url_crumb('tools')) . '">' . T_('Find and delete all orphan comment Uploads - Disk &amp; DB.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=delete_orphan_files&amp;' . url_crumb('tools')) . '">' . T_('Find and delete all orphan File objects (with no matching file on disk) - DB only.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=delete_orphan_file_roots&amp;' . url_crumb('tools')) . '">' . T_('Find and delete all orphan file roots (with no matching Collection or User) and all of their content recursively - Disk &amp; DB.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=prune_hits_sessions&amp;' . url_crumb('tools')) . '">' . T_('Prune old hits &amp; sessions (includes OPTIMIZE) - DB only.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=recreate_itemslugs&amp;' . url_crumb('tools')) . '">' . T_('Recreate all item Slugs (change title-[0-9] canonical slugs to a slug generated from current title). Old slugs will still work, but will redirect to the new ones - DB only.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=recreate_autogenerated_excerpts&amp;' . url_crumb('tools')) . '">' . T_('Recreate autogenerated excerpts - DB only.') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=convert_item_content_separators&amp;' . url_crumb('tools')) . '">' . T_('Convert item content separators to [teaserbreak] and [pagebreak] - DB only.') . '</a></li>';
    echo '</ul>';
    $block_item_Widget->disp_template_raw('block_end');
}
// We should load GeoIP plugin here even if it is disabled now, because action 'geoip_download' may be requested
$Plugins->load_plugin_by_classname('geoip_plugin');
// Event AdminToolPayload for each Plugin:
$tool_plugins = $Plugins->get_list_by_event('AdminToolPayload');
foreach ($tool_plugins as $loop_Plugin) {
    $block_item_Widget->title = format_to_output($loop_Plugin->name);
    $block_item_Widget->disp_template_replaced('block_start');
    $Plugins->call_method_if_active($loop_Plugin->ID, 'AdminToolPayload', $params = array());
    $block_item_Widget->disp_template_raw('block_end');
}
Exemplo n.º 11
0
function ityp_row_default($item_type_ID)
{
    if (ItemType::is_reserved($item_type_ID)) {
        // It is reserved item type, Don't allow to enable this
        return '';
    }
    global $current_User, $admin_url, $Blog;
    if ($Blog->get_setting('default_post_type') == $item_type_ID) {
        // The item type is default for current collection:
        $status_icon = get_icon('bullet_black', 'imgtag', array('title' => sprintf(T_('The item type is the default for %s.'), $Blog->get('shortname'))));
    } else {
        // The item type is not default:
        if ($current_User->check_perm('blog_properties', 'edit', false, $Blog->ID)) {
            // URL to use the item type as default if current user has a permission to edit collection properties:
            $status_url = $admin_url . '?ctrl=itemtypes&amp;action=default&amp;ityp_ID=' . $item_type_ID . '&amp;blog=' . $Blog->ID . '&amp;' . url_crumb('itemtype');
            $status_icon_title = sprintf(T_('Set this item type as the default for %s.'), $Blog->get('shortname'));
        } else {
            $status_icon_title = sprintf(T_('The item type is not the default for %s.'), $Blog->get('shortname'));
        }
        $status_icon = get_icon('bullet_empty_grey', 'imgtag', array('title' => $status_icon_title));
    }
    if (isset($status_url)) {
        return '<a href="' . $status_url . '">' . $status_icon . '</a>';
    } else {
        return $status_icon;
    }
}
Exemplo n.º 12
0
$current_skin_ID = $edited_Blog->get_setting($skin_type . '_skin_ID', true);
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $block_item_Widget->global_icon(T_('Install new skin...'), 'new', $dispatcher . '?ctrl=skins&amp;action=new&amp;redirect_to=' . rawurlencode(url_rel_to_same_host(regenerate_url('', 'skinpage=selection', '', '&'), $admin_url)), T_('Install new'), 3, 4);
    $block_item_Widget->global_icon(T_('Keep current skin!'), 'close', regenerate_url('skinpage'), ' ' . T_('Don\'t change'), 3, 4);
}
$block_item_Widget->disp_template_replaced('block_start');
$SkinCache =& get_SkinCache();
$SkinCache->load_all();
if ($display_same_as_normal) {
    $skinshot_title = T_('Same as normal skin');
    $select_url = '?ctrl=coll_settings&tab=skin&blog=' . $edited_Blog->ID . '&amp;action=update&amp;skinpage=selection&amp;' . $skin_type . '_skin_ID=0&amp;' . url_crumb('collection');
    $disp_params = array('function' => 'select', 'selected' => $current_skin_ID == '0', 'select_url' => $select_url);
    Skin::disp_skinshot($skinshot_title, $skinshot_title, $disp_params);
}
$SkinCache->rewind();
while (($iterator_Skin =& $SkinCache->get_next()) != NULL) {
    if ($iterator_Skin->type != $skin_type) {
        // This skin cannot be used here...
        continue;
    }
    $selected = $current_skin_ID == $iterator_Skin->ID;
    $blog_skin_param = $skin_type . '_skin_ID=';
    $select_url = '?ctrl=coll_settings&tab=skin&blog=' . $edited_Blog->ID . '&amp;action=update&amp;skinpage=selection&amp;' . $blog_skin_param . $iterator_Skin->ID . '&amp;' . url_crumb('collection');
    $preview_url = url_add_param($edited_Blog->gen_blogurl(), 'tempskin=' . rawurlencode($iterator_Skin->folder));
    $disp_params = array('function' => 'select', 'selected' => $selected, 'select_url' => $select_url, 'function_url' => $preview_url);
    // Display skinshot:
    Skin::disp_skinshot($iterator_Skin->folder, $iterator_Skin->name, $disp_params);
}
echo '<div class="clear"></div>';
$block_item_Widget->disp_template_replaced('block_end');
Exemplo n.º 13
0
function rgn_td_actions($rgn_enabled, $rgn_ID)
{
    global $dispatcher;
    $r = '';
    if ($rgn_enabled == true) {
        $r .= action_icon(T_('Disable the region!'), 'deactivate', regenerate_url('action', 'action=disable_region&amp;rgn_ID=' . $rgn_ID . '&amp;' . url_crumb('region')));
    } else {
        $r .= action_icon(T_('Enable the region!'), 'activate', regenerate_url('action', 'action=enable_region&amp;rgn_ID=' . $rgn_ID . '&amp;' . url_crumb('region')));
    }
    $r .= action_icon(T_('Edit this region...'), 'edit', regenerate_url('action', 'rgn_ID=' . $rgn_ID . '&amp;action=edit'));
    $r .= action_icon(T_('Duplicate this region...'), 'copy', regenerate_url('action', 'rgn_ID=' . $rgn_ID . '&amp;action=new'));
    $r .= action_icon(T_('Delete this region!'), 'delete', regenerate_url('action', 'rgn_ID=' . $rgn_ID . '&amp;action=delete&amp;' . url_crumb('region')));
    return $r;
}
Exemplo n.º 14
0
/**
 * @var Comment
 */
global $edited_Comment;
/**
 *
 */
global $Plugins;
global $mode, $month, $tab, $redirect_to, $comment_content;
$Form = new Form(NULL, 'comment_checkchanges', 'post');
$link_attribs = array('style' => 'margin-right: 3ex;');
// Avoid misclicks by all means!
if ($current_User->check_perm('blog_post!draft', 'edit', false, $Blog->ID)) {
    $Form->global_icon(T_('Elevate this comment into a post'), 'elevate', '?ctrl=comments&amp;action=elevate&amp;comment_ID=' . $edited_Comment->ID . '&amp;' . url_crumb('comment'), T_('Elevate into a post'), 4, 3, $link_attribs);
}
$delete_url = '?ctrl=comments&amp;action=delete&amp;comment_ID=' . $edited_Comment->ID . '&amp;' . url_crumb('comment');
if ($edited_Comment->status == 'trash') {
    $delete_title = T_('Delete this comment');
    $delete_text = T_('delete');
    $link_attribs['onclick'] = 'return confirm(\'' . TS_('You are about to delete this comment!\\nThis cannot be undone!') . '\')';
} else {
    $delete_title = T_('Recycle this comment');
    $delete_text = T_('recycle');
}
$Form->global_icon($delete_title, 'recycle', $delete_url, $delete_text, 4, 3, $link_attribs);
$Form->global_icon(T_('Cancel editing!'), 'close', str_replace('&', '&amp;', $redirect_to), T_('cancel'), 4, 1);
$Form->begin_form('eform');
$Form->add_crumb('comment');
$Form->hidden('ctrl', 'comments');
$Form->hidden('redirect_to', $redirect_to);
$Form->hidden('comment_ID', $edited_Comment->ID);
Exemplo n.º 15
0
 function antispam_actions(&$row)
 {
     $output = '';
     if ($row->aspm_source == 'local') {
         $output .= '[<a href="' . regenerate_url('action,keyword', 'action=report&amp;keyword=' . rawurlencode($row->aspm_string)) . '&amp;' . url_crumb('antispam') . '" title="' . T_('Report abuse to centralized ban blacklist!') . '">' . T_('Report') . '</a>]';
     }
     return $output . '[<a href="' . regenerate_url('action,keyword', 'action=ban&amp;keyword=' . rawurlencode($row->aspm_string)) . '&amp;' . url_crumb('antispam') . '" title="' . T_('Check hit-logs and comments for this keyword!') . '">' . T_('Re-check') . '</a>]';
 }
Exemplo n.º 16
0
$block_item_Widget->disp_template_raw('block_end');
/**
 * PHP
 */
$block_item_Widget->title = 'PHP';
$block_item_Widget->disp_template_replaced('block_start');
// User ID:
list($uid, $uname, $running_as) = system_check_process_user();
init_system_check('PHP running as USER:'******'note');
// Group ID:
list($gid, $gname, $running_as) = system_check_process_group();
init_system_check('PHP running as GROUP:', $running_as);
disp_system_check('note');
// PHP version
$phpinfo_url = '?ctrl=tools&amp;action=view_phpinfo&amp;' . url_crumb('tools');
$phpinfo_link = action_icon(T_('View PHP info'), 'info', $phpinfo_url, '', 5, '', array('target' => '_blank', 'onclick' => 'return pop_up_window( \'' . $phpinfo_url . '\', \'phpinfo\', 650 )'));
init_system_check('PHP version', $system_stats['php_version'] . ' ' . $phpinfo_link);
if (version_compare($system_stats['php_version'], $required_php_version['application'], '<')) {
    disp_system_check('error', T_('This version is too old. b2evolution will not run correctly. You must ask your host to upgrade PHP before you can run b2evolution.'));
} elseif (version_compare($system_stats['php_version'], '5.2', '<')) {
    disp_system_check('warning', T_('This version is old. b2evolution may run but some features may fail. You should ask your host to upgrade PHP before running b2evolution.') . '<br />' . T_('PHP 5.2 or greater is recommended for maximum security, especially for "httpOnly" cookies support.'));
} else {
    disp_system_check('ok');
}
// register_globals?
init_system_check('PHP register_globals', $system_stats['php_reg_globals'] ? T_('On') : T_('Off'));
if ($system_stats['php_reg_globals']) {
    disp_system_check('warning', $facilitate_exploits . ' ' . sprintf($change_ini, 'register_globals = Off'));
} else {
    disp_system_check('ok');
Exemplo n.º 17
0
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
 *
 * @package admin
 *
 * @author fplanque: Francois PLANQUE.
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * @var Skin
 */
global $edited_Skin;
$Form = new Form(NULL, 'skin_checkchanges');
$Form->global_icon(T_('Uninstall this skin!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('skin')));
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', T_('Skin properties'));
$Form->add_crumb('skin');
$Form->hidden_ctrl();
$Form->hidden('action', 'update');
$Form->hidden('skin_ID', $edited_Skin->ID);
$Form->begin_fieldset(T_('Skin properties') . get_manual_link('skin-system-settings'));
echo '<div class="skin_settings well">';
$disp_params = array('skinshot_class' => 'coll_settings_skinshot');
Skin::disp_skinshot($edited_Skin->folder, $edited_Skin->name, $disp_params);
// Skin name
echo '<div class="skin_setting_row">';
echo '<label>' . T_('Skin name') . ':</label>';
echo '<span>' . $edited_Skin->name . '</span>';
echo '</div>';
Exemplo n.º 18
0
/**
 * Generate category line when it has children
 *
 * @param object Chapter we want to display
 * @param integer Level of the category in the recursive tree
 * @return string HTML
 */
function cat_line($Chapter, $level)
{
    global $line_class, $permission_to_edit, $current_User, $Settings;
    global $ChapterCache, $current_default_cat_ID;
    global $number_of_posts_in_cat;
    global $Session;
    $result_fadeout = $Session->get('fadeout_array');
    $line_class = $line_class == 'even' ? 'odd' : 'even';
    // ID
    $r = '<tr id="tr-' . $Chapter->ID . '"class="' . $line_class . ' chapter_parent_' . ($Chapter->parent_ID ? $Chapter->parent_ID : '0') . (isset($result_fadeout) && in_array($Chapter->ID, $result_fadeout) ? ' fadeout-ffff00' : '') . '">
					<td class="firstcol shrinkwrap">' . $Chapter->ID . '
				</td>';
    // Default
    if ($current_default_cat_ID == $Chapter->ID) {
        $makedef_icon = get_icon('enabled', 'imgtag', array('title' => format_to_output(T_('This is the default category'), 'htmlattr')));
    } else {
        $makedef_url = regenerate_url('action,cat_ID', 'cat_ID=' . $Chapter->ID . '&amp;action=make_default&amp;' . url_crumb('element'));
        $makedef_title = format_to_output(T_('Click to make this the default category'), 'htmlattr');
        $makedef_icon = '<a href="' . $makedef_url . '" title="' . $makedef_title . '">' . get_icon('disabled', 'imgtag', array('title' => $makedef_title)) . '</a>';
    }
    $r .= '<td class="center">' . $makedef_icon . '</td>';
    // Name
    if ($permission_to_edit) {
        // We have permission permission to edit:
        $edit_url = regenerate_url('action,cat_ID', 'cat_ID=' . $Chapter->ID . '&amp;action=edit');
        $r .= '<td>
						<strong style="padding-left: ' . $level . 'em;"><a href="' . $edit_url . '" title="' . T_('Edit...') . '">' . $Chapter->dget('name') . '</a></strong>
					 </td>';
    } else {
        $r .= '<td>
						 <strong style="padding-left: ' . $level . 'em;">' . $Chapter->dget('name') . '</strong>
					 </td>';
    }
    // URL "slug"
    $edit_url = regenerate_url('action,cat_ID', 'cat_ID=' . $Chapter->ID . '&amp;action=edit');
    $r .= '<td><a href="' . htmlspecialchars($Chapter->get_permanent_url()) . '">' . $Chapter->dget('urlname') . '</a></td>';
    // Order
    if ($Chapter->get_parent_subcat_ordering() == 'manual') {
        // Manual ordering
        $r .= '<td class="center cat_order_edit" rel="' . $Chapter->ID . '">' . '<a href="#">' . ($Chapter->get('order') === NULL ? '-' : $Chapter->dget('order')) . '</a>' . '</td>';
    } else {
        // Alphabetic ordering
        $r .= '<td class="center">' . T_('Alphabetic') . '</td>';
    }
    if ($permission_to_edit) {
        // We have permission permission to edit, so display these columns:
        if ($Chapter->meta) {
            $makemeta_icon = 'enabled';
            $makemeta_title = format_to_output(T_('Click to revert this from meta category'), 'htmlattr');
            $action = 'unset_meta';
        } else {
            $makemeta_icon = 'disabled';
            $makemeta_title = format_to_output(T_('Click to make this as meta category'), 'htmlattr');
            $action = 'set_meta';
        }
        // Meta
        $makemeta_url = regenerate_url('action,cat_ID', 'cat_ID=' . $Chapter->ID . '&amp;action=' . $action . '&amp;' . url_crumb('element'));
        $r .= '<td class="center"><a href="' . $makemeta_url . '" title="' . $makemeta_title . '">' . get_icon($makemeta_icon, 'imgtag', array('title' => $makemeta_title)) . '</a></td>';
        // Lock
        if ($Chapter->lock) {
            $makelock_icon = 'file_not_allowed';
            $makelock_title = format_to_output(T_('Unlock category'), 'htmlattr');
            $action = 'unlock';
        } else {
            $makelock_icon = 'file_allowed';
            $makelock_title = format_to_output(T_('Lock category'), 'htmlattr');
            $action = 'lock';
        }
        $makelock_url = regenerate_url('action,cat_ID', 'cat_ID=' . $Chapter->ID . '&amp;action=' . $action . '&amp;' . url_crumb('element'));
        $r .= '<td class="center"><a href="' . $makelock_url . '" title="' . $makelock_title . '">' . get_icon($makelock_icon, 'imgtag', array('title' => $makelock_title)) . '</a></td>';
    }
    // Posts
    if (isset($number_of_posts_in_cat[$Chapter->ID])) {
        $r .= '<td class="center">' . (int) $number_of_posts_in_cat[$Chapter->ID] . '</td>';
    } else {
        // no posts in this category
        $r .= '<td class="center"> - </td>';
    }
    // Actions
    $r .= '<td class="lastcol shrinkwrap">';
    if ($permission_to_edit) {
        // We have permission permission to edit, so display action column:
        $r .= action_icon(T_('Edit...'), 'edit', $edit_url);
        if ($Settings->get('allow_moving_chapters')) {
            // If moving cats between blogs is allowed:
            $r .= action_icon(T_('Move to a different blog...'), 'file_move', regenerate_url('action,cat_ID', 'cat_ID=' . $Chapter->ID . '&amp;action=move'), T_('Move'));
        }
        $r .= action_icon(T_('New...'), 'new', regenerate_url('action,cat_ID,cat_parent_ID', 'cat_parent_ID=' . $Chapter->ID . '&amp;action=new')) . action_icon(T_('Delete...'), 'delete', regenerate_url('action,cat_ID', 'cat_ID=' . $Chapter->ID . '&amp;action=delete&amp;' . url_crumb('element')));
    }
    $r .= '</td>';
    $r .= '</tr>';
    return $r;
}
Exemplo n.º 19
0
 * @copyright (c)2009-2015 by Francois Planque - {@link http://fplanque.com/}
 * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
 *
 * @package evocore
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
load_class('users/model/_userfieldgroup.class.php', 'UserfieldGroup');
/**
 * @var Userfield
 */
global $edited_UserfieldGroup;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'userfieldgroup_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Delete this user field group!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('userfieldgroup')));
$Form->global_icon(T_('Cancel editing!'), 'close', '?ctrl=userfields');
$Form->begin_form('fform', $creating ? T_('New user field group') : T_('User field group'));
$Form->add_crumb('userfieldgroup');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',ufgp_ID' : '')));
// (this allows to come back to the right list order & page)
$Form->hidden('ufgp_ID', $edited_UserfieldGroup->ID);
$Form->text_input('ufgp_name', $edited_UserfieldGroup->name, 50, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('ufgp_order', $edited_UserfieldGroup->order, 50, T_('Order number'), '', array('maxlength' => 11, 'required' => true));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
Exemplo n.º 20
0
    echo '<ul>';
    echo '<li><a href="' . regenerate_url('action', 'action=check_tables&amp;' . url_crumb('tools')) . '">' . T_('CHECK database tables') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=optimize_tables&amp;' . url_crumb('tools')) . '">' . T_('OPTIMIZE database tables') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=analyze_tables&amp;' . url_crumb('tools')) . '">' . T_('ANALYZE database tables') . '</a></li>';
    // echo '<li><a href="'.regenerate_url('action', 'action=backup_db').'">'.T_('Backup database').'</a></li>';
    echo '</ul>';
    $block_item_Widget->disp_template_raw('block_end');
    $block_item_Widget->title = T_('Database Maintenance Tools');
    $block_item_Widget->disp_template_replaced('block_start');
    echo '<ul>';
    echo '<li><a href="' . regenerate_url('action', 'action=del_obsolete_tags&amp;' . url_crumb('tools')) . '">' . T_('Remove obsolete (unused) tag entries') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=find_broken_posts&amp;' . url_crumb('tools')) . '">' . T_('Find all broken posts that have no matching category') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=find_broken_slugs&amp;' . url_crumb('tools')) . '">' . T_('Find all broken slugs that have no matching target post') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=delete_orphan_comment_uploads&amp;' . url_crumb('tools')) . '">' . T_('Find and delete orphan comment uploads (disk &amp; DB)') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=delete_orphan_files&amp;' . url_crumb('tools')) . '">' . T_('Find and delete orphan File objects (with no matching file on disk)') . '</a></li>';
    echo '<li><a href="' . regenerate_url('action', 'action=prune_hits_sessions&amp;' . url_crumb('tools')) . '">' . T_('Prune old hits & sessions (includes OPTIMIZE)') . '</a></li>';
    echo '</ul>';
    $block_item_Widget->disp_template_raw('block_end');
    $block_item_Widget->title = T_('Recreate item slugs');
    $block_item_Widget->disp_template_replaced('block_start');
    echo '&raquo; <a href="' . regenerate_url('action', 'action=recreate_itemslugs&amp;' . url_crumb('tools')) . '">' . T_('Recreate all item slugs (change title-[0-9] canonical slugs to a slug generated from current title). Old slugs will still work, but redirect to the new one.') . '</a>';
    $block_item_Widget->disp_template_raw('block_end');
}
// Event AdminToolPayload for each Plugin:
$tool_plugins = $Plugins->get_list_by_event('AdminToolPayload');
foreach ($tool_plugins as $loop_Plugin) {
    $block_item_Widget->title = format_to_output($loop_Plugin->name);
    $block_item_Widget->disp_template_replaced('block_start');
    $Plugins->call_method_if_active($loop_Plugin->ID, 'AdminToolPayload', $params = array());
    $block_item_Widget->disp_template_raw('block_end');
}
Exemplo n.º 21
0
 /**
  * Get any kind of moderation link where the user status will be changed.
  * This function should be private!
  * TODO: asimo>This function should be used instead the old get_publish_link and get_deprecate_link
  *
  * @param array params
  * @return string the moderate link
  */
 function get_moderation_link($params)
 {
     global $admin_url;
     $redirect_to = $params['redirect_to'];
     $new_status = $params['status'];
     $action = $params['action'];
     $glue = $params['glue'];
     $status_param = $action == 'publish' ? 'publish_status' : 'comment_status';
     $r = $params['before'];
     $r .= '<a href="' . $admin_url . '?ctrl=comments' . $glue . 'action=' . $action . $glue . $status_param . '=' . $new_status . $glue . 'comment_ID=' . $this->ID . '&amp;' . url_crumb('comment');
     if ($params['save_context']) {
         if ($redirect_to != NULL) {
             $r .= $glue . 'redirect_to=' . $redirect_to;
         } else {
             $r .= $glue . 'redirect_to=' . rawurlencode(regenerate_url('', 'filter=restore', '', '&'));
         }
     }
     $r .= '"';
     if ($params['ajax_button']) {
         if ($params['save_context'] && $redirect_to == NULL) {
             $redirect_to = regenerate_url('', 'filter=restore', '', '&');
         }
         $r .= ' onclick="setCommentStatus(' . $this->ID . ', \'' . $new_status . '\', \'' . $redirect_to . '\'); return false;"';
     }
     $status_title = get_visibility_statuses('moderation-titles');
     $r .= ' title="' . $status_title[$new_status] . '"';
     if (!empty($params['class'])) {
         $r .= ' class="' . $params['class'] . '"';
     }
     $r .= '>' . $params['text'] . '</a>';
     $r .= $params['after'];
     return $r;
 }
Exemplo n.º 22
0
if (!$user_profile_only) {
    // echo user edit action icons
    $Widget = new Widget();
    echo_user_actions($Widget, $edited_User, 'edit');
    echo '<span class="floatright">' . $Widget->gen_global_icons() . '</span>';
}
echo '<div>' . get_usertab_header($edited_User, $user_tab, $current_User->ID == $edited_User->ID ? T_('My Activity') : T_('User Activity')) . '</div>';
// Display IP address from where this user was created
echo '<div style="margin-top:25px;font-weight:bold;"><span>' . T_('User created from IP') . ': ' . int2ip($UserSettings->get('created_fromIPv4', $edited_User->ID)) . '</span></div>';
/**** Reports from edited user  ****/
user_reports_results_block(array('edited_User' => $edited_User));
evo_flush();
/**** Blogs owned by the user ****/
blogs_results_block(array('edited_User' => $edited_User));
evo_flush();
/**** Posts created by the user  ****/
items_created_results_block(array('edited_User' => $edited_User));
evo_flush();
/**** Posts edited by the user ****/
items_edited_results_block(array('edited_User' => $edited_User));
evo_flush();
/**** Comments posted by the user ****/
comments_results_block(array('edited_User' => $edited_User));
evo_flush();
/**** Private messages sent by the user ****/
threads_results_block(array('edited_User' => $edited_User));
evo_flush();
if ($current_User->ID != $edited_User->ID && $edited_User->ID != 1) {
    // User can NOT delete admin and own account
    echo '<div style="margin-top:25px;">' . action_icon(T_('Delete User and All his contributions'), 'delete', '?ctrl=user&amp;user_tab=activity&amp;action=delete_all_userdata&amp;user_ID=' . $edited_User->ID . '&amp;' . url_crumb('user'), ' ' . T_('Delete User and All his contributions'), 3, 4) . '</div>';
}
Exemplo n.º 23
0
function ctry_td_actions($ctry_enabled, $ctry_ID)
{
    $r = '';
    $redirect_ctrl = param('ctrl', 'string', 'countries');
    if ($ctry_enabled == true) {
        $r .= action_icon(T_('Disable the country!'), 'deactivate', regenerate_url('ctrl,action', 'ctrl=countries&amp;action=disable_country&amp;ctry_ID=' . $ctry_ID . '&amp;redirect_ctrl=' . $redirect_ctrl . '&amp;' . url_crumb('country')));
    } else {
        $r .= action_icon(T_('Enable the country!'), 'activate', regenerate_url('ctrl,action', 'ctrl=countries&amp;action=enable_country&amp;ctry_ID=' . $ctry_ID . '&amp;redirect_ctrl=' . $redirect_ctrl . '&amp;' . url_crumb('country')));
    }
    $r .= action_icon(T_('Edit this country...'), 'edit', regenerate_url('ctrl,action', 'ctrl=countries&amp;ctry_ID=' . $ctry_ID . '&amp;action=edit'));
    $r .= action_icon(T_('Duplicate this country...'), 'copy', regenerate_url('ctrl,action', 'ctrl=countries&amp;ctry_ID=' . $ctry_ID . '&amp;action=new'));
    $r .= action_icon(T_('Delete this country!'), 'delete', regenerate_url('ctrl,action', 'ctrl=countries&amp;ctry_ID=' . $ctry_ID . '&amp;action=delete&amp;' . url_crumb('country')));
    return $r;
}
Exemplo n.º 24
0
        foreach ($uploadedFiles as $uploadedFile) {
            $success_msg = sprintf(T_('The file &laquo;%s&raquo; has been successfully uploaded to the server.'), $uploadedFile->dget('name'));
            // Allow to insert/link new upload into currently edited link object:
            if ($mode == 'upload' && !empty($link_object_ID) && !empty($link_type)) {
                // The filemanager has been opened from a link owner object, offer to insert an img tag into original object.
                $LinkOwner = get_link_owner($link_type, $link_object_ID);
                // TODO: Add plugin hook to allow generating JS insert code(s)
                $img_tag = format_to_output($uploadedFile->get_tag(), 'formvalue');
                if ($uploadedFile->is_image()) {
                    $link_msg = $LinkOwner->translate('Link this image to your owner');
                    $link_note = T_('recommended - allows automatic resizing');
                } else {
                    $link_msg = $LinkOwner->translate('Link this file to your owner');
                    $link_note = $LinkOwner->translate('The file will be linked for download at the end of the owner');
                }
                $success_msg .= '<ul>' . '<li>' . action_icon(T_('Link this file!'), 'link', regenerate_url('fm_selected,ctrl', 'ctrl=files&amp;action=link_inpost&amp;fm_selected[]=' . rawurlencode($uploadedFile->get_rdfp_rel_path()) . '&amp;' . url_crumb('file')), ' ' . $link_msg, 5, 5, array('target' => $iframe_name)) . ' (' . $link_note . ')</li>' . '<li>' . T_('or') . ' <a href="#" onclick="if( window.focus && window.opener ){' . 'window.opener.focus(); textarea_wrap_selection( window.opener.document.getElementById(\'' . $LinkOwner->type . 'form_post_content\'), \'' . format_to_output($uploadedFile->get_tag(), 'formvalue') . '\', \'\', 1, window.opener.document ); } return false;">' . $LinkOwner->translate('Insert the following code snippet into your owner') . '</a> : <input type="text" value="' . $img_tag . '" size="60" /></li>' . '</ul>';
            }
            $Messages->add($success_msg, 'success');
        }
    }
    if ($upload_quickmode && !empty($failedFiles)) {
        // Transmit file error to next page!
        $Messages->add($failedFiles[0], 'error');
        unset($failedFiles);
    }
    if (empty($failedFiles) && empty($renamedFiles)) {
        // quick mode or no failed files, Go back to Browsing
        // header_redirect( $dispatcher.'?ctrl=files&root='.$fm_FileRoot->ID.'&path='.rawurlencode($path) );
        header_redirect(regenerate_url('ctrl', 'ctrl=files', '', '&'));
    }
}
Exemplo n.º 25
0
function contacts_groups($user_ID)
{
    global $current_User, $DB, $cache_user_contacts_groups;
    if (!is_array($cache_user_contacts_groups)) {
        // Execute only first time to init cache
        $cache_user_contacts_groups = array();
        // Get contacts of current user
        $groups_SQL = new SQL();
        $groups_SQL->SELECT('cgr_ID AS ID, cgu_user_ID AS user_ID, cgr_name AS name');
        $groups_SQL->FROM('T_messaging__contact_groupusers');
        $groups_SQL->FROM_add('LEFT JOIN T_messaging__contact_groups ON cgu_cgr_ID = cgr_ID');
        $groups_SQL->WHERE('cgr_user_ID = ' . $current_User->ID);
        $groups_SQL->ORDER_BY('cgr_name');
        $groups = $DB->get_results($groups_SQL->get());
        $remove_link = url_add_param(get_dispctrl_url('contacts'), 'action=remove_user&amp;view=contacts&amp;' . url_crumb('messaging_contacts'));
        foreach ($groups as $group) {
            // Init cache for groups for each contact of current user
            $group_name = $group->name . action_icon(T_('Remove user from this group'), 'remove', url_add_param($remove_link, 'user_ID=' . $group->user_ID . '&amp;group_ID=' . $group->ID));
            if (isset($cache_user_contacts_groups[$group->user_ID])) {
                // nth group of this user
                $cache_user_contacts_groups[$group->user_ID] .= '<br />' . $group_name;
            } else {
                // first group of this user
                $cache_user_contacts_groups[$group->user_ID] = $group_name;
            }
        }
    }
    if (isset($cache_user_contacts_groups[$user_ID])) {
        // user has groups
        echo $cache_user_contacts_groups[$user_ID];
    }
}
Exemplo n.º 26
0
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
 *
 * @package admin
 *
 * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
 * @author efy-asimo: Attila Simo.
 *
 * @version $Id: _broken_posts.view.php 3328 2013-03-26 11:44:11Z yura $
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
$SQL = new SQL();
$SQL->SELECT('post_ID, post_title, post_main_cat_ID, post_canonical_slug_ID');
$SQL->FROM('T_items__item');
$SQL->WHERE('post_main_cat_ID NOT IN (SELECT cat_ID FROM T_categories )');
$Results = new Results($SQL->get(), 'broken_posts_');
$Results->title = T_('Broken items with no matching category');
$Results->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Results->cols[] = array('th' => T_('Item ID'), 'th_class' => 'shrinkwrap', 'td_class' => 'small center', 'order' => 'post_ID', 'td' => '$post_ID$');
$Results->cols[] = array('th' => T_('Title'), 'th_class' => 'nowrap', 'order' => 'post_title', 'td' => '$post_title$', 'td_class' => 'small');
$Results->cols[] = array('th' => T_('Main Cat ID'), 'th_class' => 'shrinkwrap', 'order' => 'post_main_cat_ID', 'td' => '$post_main_cat_ID$', 'td_class' => 'small center');
$Results->cols[] = array('th' => T_('Canoncical Slug ID'), 'th_class' => 'shrinkwrap', 'order' => 'post_canonical_slug_ID', 'td' => '$post_canonical_slug_ID$', 'td_class' => 'small center');
$Results->display(array('page_url' => regenerate_url('blog,ctrl,action,results_' . $Results->param_prefix . 'page', 'action=' . param_action() . '&amp;' . url_crumb('tools'))));
if ($current_User->check_perm('options', 'edit', true) && $Results->get_num_rows()) {
    // display Delete link
    $redirect_to = regenerate_url('action', 'action=del_broken_posts&' . url_crumb('tools'));
    echo '<p>[<a href="' . $redirect_to . '">' . T_('Delete these posts') . '</a>]</p>';
}
Exemplo n.º 27
0
/**
 * @param string Title of the container. This gets passed to T_()!
 * @param string Suffix of legend
 */
function display_container($container, $legend_suffix = '')
{
    global $Blog;
    global $Session;
    $Table = new Table();
    $Table->title = '<span class="container_name">' . T_($container) . '</span>' . $legend_suffix;
    // Table ID - fp> needs to be handled cleanly by Table object
    $table_id = str_replace(' ', '_', $container);
    // fp> Using the container name which has special chars is a bad idea. Counter would be better
    $Table->global_icon(T_('Add a widget...'), 'new', regenerate_url('', 'action=new&amp;container=' . rawurlencode($container)), T_('Add widget') . ' &raquo;', 3, 4, array('id' => 'add_new_' . $table_id));
    $Table->cols = array(array('th' => T_('En'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap'), array('th' => T_('Widget')), array('th' => T_('Type')), array('th' => T_('Move'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap'), array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap'));
    //enable fadeouts here
    $Table->display_init(NULL, array('fadeouts' => true));
    // add ID for jQuery
    // TODO: fp> Awfully dirty. This should be handled by the Table object
    $Table->params['list_start'] = str_replace('<table', '<table id="' . $table_id . '"', $Table->params['list_start']);
    /*
    if( $legend_suffix )
    {	// add jQuery no-drop -- fp> what do we need this one for?
    	$Table->params['head_title'] = str_replace( 'class="grouped"', 'class="grouped no-drop"', $Table->params['head_title'] );
    }
    */
    $Table->display_list_start();
    // TITLE / COLUMN HEADERS:
    $Table->display_head();
    // BODY START:
    $Table->display_body_start();
    /**
     * @var WidgetCache
     */
    $WidgetCache =& get_WidgetCache();
    $Widget_array =& $WidgetCache->get_by_coll_container($Blog->ID, $container);
    if (empty($Widget_array)) {
        // TODO: cleanup
        $Table->display_line_start(true);
        $Table->display_col_start(array('colspan' => 5));
        echo '<span class="new_widget">' . T_('There is no widget in this container yet.') . '</span>';
        $Table->display_col_end();
        $Table->display_line_end();
    } else {
        $widget_count = 0;
        foreach ($Widget_array as $ComponentWidget) {
            $widget_count++;
            $enabled = $ComponentWidget->get('enabled');
            $fadeout_id = $Session->get('fadeout_id');
            if (isset($fadeout_id) && $ComponentWidget->ID == $fadeout_id) {
                $fadeout = true;
                $Session->delete('fadeout_id');
            } else {
                $fadeout = false;
            }
            $Table->display_line_start(false, $fadeout);
            $Table->display_col_start();
            if ($enabled) {
                // Indicator for the JS UI:
                echo '<span class="widget_is_enabled">';
                echo get_icon('enabled', 'imgtag', array('title' => T_('The widget is enabled.')));
                echo '</span>';
            } else {
                echo get_icon('disabled', 'imgtag', array('title' => T_('The widget is disabled.')));
            }
            $Table->display_col_end();
            $Table->display_col_start();
            $ComponentWidget->init_display(array());
            echo '<a href="' . regenerate_url('blog', 'action=edit&amp;wi_ID=' . $ComponentWidget->ID) . '" class="widget_name">' . $ComponentWidget->get_desc_for_list() . '</a>';
            $Table->display_col_end();
            // Note: this is totally useless, but we need more cols for the screen to feel "right":
            $Table->display_col_start();
            echo $ComponentWidget->type;
            $Table->display_col_end();
            // Move
            $Table->display_col_start();
            //echo $ComponentWidget->order.' ';
            if ($widget_count > 1) {
                echo action_icon(T_('Move up!'), 'move_up', regenerate_url('blog', 'action=move_up&amp;wi_ID=' . $ComponentWidget->ID . '&amp;' . url_crumb('widget')));
            } else {
                echo get_icon('nomove', 'imgtag', array('class' => 'action_icon'));
            }
            if ($widget_count < count($Widget_array)) {
                echo action_icon(T_('Move down!'), 'move_down', regenerate_url('blog', 'action=move_down&amp;wi_ID=' . $ComponentWidget->ID . '&amp;' . url_crumb('widget')));
            } else {
                echo get_icon('nomove', 'imgtag', array('class' => 'action_icon'));
            }
            $Table->display_col_end();
            // Actions
            $Table->display_col_start();
            if ($enabled) {
                echo action_icon(T_('Disable this widget!'), 'deactivate', regenerate_url('blog', 'action=toggle&amp;wi_ID=' . $ComponentWidget->ID . '&amp;' . url_crumb('widget')));
            } else {
                echo action_icon(T_('Enable this widget!'), 'activate', regenerate_url('blog', 'action=toggle&amp;wi_ID=' . $ComponentWidget->ID . '&amp;' . url_crumb('widget')));
            }
            echo '<span class="edit_icon_hook">' . action_icon(T_('Edit widget settings!'), 'edit', regenerate_url('blog', 'action=edit&amp;wi_ID=' . $ComponentWidget->ID)) . '</span>';
            echo '<span class="delete_icon_hook">' . action_icon(T_('Remove this widget!'), 'delete', regenerate_url('blog', 'action=delete&amp;wi_ID=' . $ComponentWidget->ID . '&amp;' . url_crumb('widget'))) . '</span>';
            $Table->display_col_end();
            $Table->display_line_end();
        }
    }
    // BODY END:
    $Table->display_body_end();
    $Table->display_list_end();
}
Exemplo n.º 28
0
     // Generate available blogs list:
     $AdminUI->set_coll_list_params('blog_ismember', 'view', array('ctrl' => 'items', 'filter' => 'restore'));
     switch ($action) {
         case 'edit':
         case 'edit_switchtab':
             // this gets set as action by JS, when we switch tabs
         // this gets set as action by JS, when we switch tabs
         case 'update_edit':
         case 'update':
             // on error
         // on error
         case 'update_publish':
             // on error
             if ($current_User->check_perm('item_post!CURSTATUS', 'delete', false, $edited_Item)) {
                 // User has permissions to delete this post
                 $AdminUI->global_icon(T_('Delete this post'), 'delete', '?ctrl=items&amp;action=delete&amp;post_ID=' . $edited_Item->ID . '&amp;' . url_crumb('item'), ' ' . T_('Delete'), 4, 3, array('onclick' => 'return confirm(\'' . TS_('You are about to delete this post!\\nThis cannot be undone!') . '\')', 'style' => 'margin-right: 3ex;'));
             }
             $AdminUI->global_icon(T_('Permanent link to full entry'), 'permalink', $edited_Item->get_permanent_url(), ' ' . T_('Permalink'), 4, 3, array('style' => 'margin-right: 3ex'));
             break;
     }
     $AdminUI->global_icon(T_('Cancel editing!'), 'close', $redirect_to, T_('Cancel'), 4, 2);
     init_tokeninput_js();
     break;
 case 'new_mass':
     $AdminUI->set_coll_list_params('blog_post_statuses', 'edit', array('ctrl' => 'items', 'action' => 'new'), NULL, '', 'return b2edit_reload( document.getElementById(\'item_checkchanges\'), \'' . $dispatcher . '\', %s )');
     // We don't check the following earlier, because we want the blog switching buttons to be available:
     if (!blog_has_cats($blog)) {
         $error_message = T_('Since this blog has no categories, you cannot post into it.');
         if ($current_User->check_perm('blog_cats', 'edit', false, $blog)) {
             // If current user has a permission to create a category
             global $admin_url;
Exemplo n.º 29
0
}
// Create result set:
$SQL = new SQL();
$SQL->SELECT('T_skins__skin.*, COUNT( DISTINCT( cset_coll_ID ) ) AS nb_blogs');
$SQL->FROM('T_skins__skin LEFT JOIN T_coll_settings ON skin_ID = cset_value AND
			( cset_name = "normal_skin_ID" OR cset_name = "mobile_skin_ID" OR cset_name = "tablet_skin_ID" )');
$SQL->GROUP_BY('skin_ID');
$CountSQL = new SQL();
$CountSQL->SELECT('COUNT( * )');
$CountSQL->FROM('T_skins__skin');
$Results = new Results($SQL->get(), 'skin_', '', NULL, $CountSQL->get());
$Results->Cache =& get_SkinCache();
$Results->title = T_('Installed skins') . get_manual_link('installed_skins');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'skin_name', 'td' => '<strong><a href="' . regenerate_url('', 'skin_ID=$skin_ID$&amp;action=edit') . '" title="' . TS_('Edit skin properties...') . '">$skin_name$</a></strong>');
} else {
    // We have NO permission to modify:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'skin_name', 'td' => '<strong>$skin_name$</strong>');
}
$Results->cols[] = array('th' => T_('Skin type'), 'order' => 'skin_type', 'td_class' => 'center', 'td' => '$skin_type$');
$Results->cols[] = array('th' => T_('Blogs'), 'order' => 'nb_blogs', 'th_class' => 'shrinkwrap', 'td_class' => 'center', 'td' => '~conditional( (#nb_blogs# > 0), #nb_blogs#, \'&nbsp;\' )~');
$Results->cols[] = array('th' => T_('Skin Folder'), 'order' => 'skin_folder', 'td' => '$skin_folder$');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => action_icon(TS_('Edit skin properties...'), 'properties', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=edit\')%') . action_icon(TS_('Reload containers!'), 'reload', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=reload&amp;' . url_crumb('skin') . '\')%') . '~conditional( #nb_blogs# < 1, \'' . action_icon(TS_('Uninstall this skin!'), 'delete', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=delete&amp;' . url_crumb('skin') . '\')%') . '\', \'' . get_icon('delete', 'noimg') . '\' )~');
    $Results->global_icon(T_('Install new skin...'), 'new', regenerate_url('action,blog', 'action=new'), T_('Install new'), 3, 4);
}
// $fadeout_array = array( 'skin_ID' => array(6) );
$fadeout_array = NULL;
$Results->display(NULL, 'session');
Exemplo n.º 30
0
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * @var Organization
 */
global $edited_Organization;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'organization_checkchanges', 'post', 'compact');
if (!$creating) {
    $Form->global_icon(T_('Delete this organization!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('organization')));
}
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action,org_ID'));
$Form->begin_form('fform', ($creating ? T_('New organization') : T_('Organization')) . get_manual_link('organization-form'));
$Form->add_crumb('organization');
$Form->hiddens_by_key(get_memorized('action'));
// (this allows to come back to the right list order & page)
$Form->text_input('org_name', $edited_Organization->name, 32, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('org_url', $edited_Organization->url, 32, T_('Url'), '', array('maxlength' => 2000));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
if ($edited_Organization->ID > 0) {
    // Display users of this organization