* Invision Power Services * IP.Board v3.3.4 * ACP groups skin file * Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $ * * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @license http://www.invisionpower.com/company/standards.php#license * @package IP.Board * @subpackage Members * @link http://www.invisionpower.com * @since 20th February 2002 * @version $Rev: 10914 $ * */ class cp_skin_groups extends output { /**#@+ * Registry objects * * @var object */ public $registry; public $DB; public $settings; public $request; public $lang; public $member; public $memberData; public $cache; public $caches; /**#@-*/ /** * Constructor * * @param object $registry Registry object * @return @e void */ public function __construct( ipsRegistry $registry ) { $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); $this->lang = $this->registry->class_localization; } /** * Should this admin group get ACP restrictions? * * @return string HTML */ public function groupAdminConfirm( $group_id ) { $IPBHTML = ""; //--starthtml--// $IPBHTML .= <<

{$this->lang->words['sm_configrest']}

{$this->lang->words['sm_detectacp']}

{$this->lang->words['sm_setrestrict']}
form_code}'>{$this->lang->words['sm_nothanks']}   {$this->lang->words['sm_yesplease']}

HTML; //--endhtml--// return $IPBHTML; } /** * Group form * * @param string Type (add|edit) * @param array Group data * @param array Permission masks * @param array Extra tabs * @param string Default tab to open * @return string HTML */ public function groupsForm( $type, $group, $permission_masks, $content=array(), $firsttab='' ) { //----------------------------------------- // Format some of the data //----------------------------------------- list($group['g_promotion_id'], $group['g_promotion_posts']) = explode( '&', $group['g_promotion'] ); list($p_max, $p_width, $p_height) = explode( ":", $group['g_photo_max_vars'] ); if ($group['g_promotion_posts'] < 1) { $group['g_promotion_posts'] = ''; } if( $type == 'edit' AND $group['g_attach_max'] == 0 ) { $group['g_attach_maxdis'] = $this->lang->words['gf_unlimited']; } else if( $type == 'edit' AND $group['g_attach_max'] == -1 ) { $group['g_attach_maxdis'] = $this->lang->words['gf_disabled']; } else { $group['g_attach_maxdis'] = IPSLib::sizeFormat( $group['g_attach_max'] * 1024 ); } if( $type == 'edit' AND $group['g_attach_per_post'] == 0 ) { $group['g_attach_per_postdis'] = $this->lang->words['gf_unlimited']; } else if( $type == 'edit' AND $group['g_attach_per_post'] == -1 ) { $group['g_attach_per_postdis'] = $this->lang->words['gf_disabled']; } else { $group['g_attach_per_postdis'] = IPSLib::sizeFormat( $group['g_attach_per_post'] * 1024 ); } //----------------------------------------- // Set some of the form variables //----------------------------------------- $form_code = $type == 'edit' ? 'doedit' : 'doadd'; $button = $type == 'edit' ? $this->lang->words['g_compedit'] : $this->lang->words['g_addgroup']; $ini_max = @ini_get( 'upload_max_filesize' ) ? @ini_get( 'upload_max_filesize' ) : $this->lang->words['g_cannotobt']; $secure_key = ipsRegistry::getClass('adminFunctions')->getSecurityKey(); //----------------------------------------- // Start off the form fields //----------------------------------------- $all_groups = array( 0 => array ( 'none', $this->lang->words['g_dontprom'] ) ); foreach( $this->cache->getCache('group_cache') as $group_data ) { $all_groups[] = array( $group_data['g_id'], $group_data['g_title'] ); } $gbw_unit_type = array( 0 => array( 0, $this->lang->words['g_dd_apprp'] ), 1 => array( 1, $this->lang->words['g_dd_days'] ) ); $form = array(); $form['g_title'] = $this->registry->output->formInput( "g_title", $group['g_title'], '', 32, 'text', '', '', 32 ); $form['permid'] = $this->registry->output->formMultiDropdown( "permid[]", $permission_masks, explode( ",", $group['g_perm_id'] ) ); $form['g_icon'] = $this->registry->output->formTextarea( "g_icon", htmlspecialchars( $group['g_icon'], ENT_QUOTES ) ); $form['prefix'] = $this->registry->output->formInput( "prefix", htmlspecialchars( $group['prefix'], ENT_QUOTES ) ); $form['suffix'] = $this->registry->output->formInput( "suffix", htmlspecialchars( $group['suffix'], ENT_QUOTES ) ); $form['g_hide_from_list'] = $this->registry->output->formYesNo( "g_hide_from_list", $group['g_hide_from_list'] ); $form['g_attach_max'] = $this->registry->output->formInput( "g_attach_max", $group['g_attach_max'] ); $form['g_attach_per_post'] = $this->registry->output->formInput( "g_attach_per_post", $group['g_attach_per_post'] ); $form['p_max'] = $this->registry->output->formInput( "p_max", $p_max ); $form['p_width'] = $this->registry->output->formSimpleInput( "p_width", $p_width, 3 ); $form['p_height'] = $this->registry->output->formSimpleInput( "p_height", $p_height, 3 ); $form['g_can_msg_attach'] = $this->registry->output->formYesNo( "g_can_msg_attach", $group['g_can_msg_attach'] ); $form['g_view_board'] = $this->registry->output->formYesNo( "g_view_board", $group['g_view_board'], 'g_view_board' ); $form['g_access_offline'] = $this->registry->output->formYesNo( "g_access_offline", $group['g_access_offline'] ); $form['g_mem_info'] = $this->registry->output->formYesNo( "g_mem_info", $group['g_mem_info'] ); $form['gbw_view_last_info'] = $this->registry->output->formYesNo( "gbw_view_last_info", $group['gbw_view_last_info'] ); $form['g_can_add_friends'] = $this->registry->output->formYesNo( "g_can_add_friends", $group['g_can_add_friends'] ); $form['g_hide_online_list'] = $this->registry->output->formYesNo( "g_hide_online_list", $group['g_hide_online_list'] ); $form['g_use_search'] = $this->registry->output->formYesNo( "g_use_search", $group['g_use_search'] ); $form['g_search_flood'] = $this->registry->output->formInput( "g_search_flood", $group['g_search_flood'] ); $form['g_edit_profile'] = $this->registry->output->formYesNo( "g_edit_profile", $group['g_edit_profile'] ); $form['g_use_pm'] = $this->registry->output->formYesNo( "g_use_pm", $group['g_use_pm'] ); $form['g_max_mass_pm'] = $this->registry->output->formInput( "g_max_mass_pm", $group['g_max_mass_pm'] ); $form['g_max_messages'] = $this->registry->output->formInput( "g_max_messages", $group['g_max_messages'] ); $form['g_pm_perday'] = $this->registry->output->formSimpleInput( "g_pm_perday", $group['g_pm_perday'], 4 ); $form['g_pm_flood_mins'] = $this->registry->output->formSimpleInput( "g_pm_flood_mins", $group['g_pm_flood_mins'], 3 ); $form['g_dohtml'] = $this->registry->output->formYesNo( "g_dohtml", $group['g_dohtml'] ); $form['g_bypass_badwords'] = $this->registry->output->formYesNo( "g_bypass_badwords", $group['g_bypass_badwords'] ); $form['g_dname_date'] = $this->registry->output->formSimpleInput( "g_dname_date", $group['g_dname_date'], 3 ); $form['g_dname_changes'] = $this->registry->output->formSimpleInput( "g_dname_changes", $group['g_dname_changes'], 3 ); $form['g_is_supmod'] = $this->registry->output->formYesNo( "g_is_supmod", $group['g_is_supmod'] ); $form['g_access_cp'] = $this->registry->output->formYesNo( "g_access_cp", $group['g_access_cp'] ); $form['g_promotion_id'] = $this->registry->output->formDropdown( "g_promotion_id", $all_groups, $group['g_promotion_id'] ); $form['g_promotion_posts'] = $this->registry->output->formSimpleInput( 'g_promotion_posts', $group['g_promotion_posts'] ); $form['g_new_perm_set'] = $this->registry->output->formInput( "g_new_perm_set", '' ); $form['g_rep_max_positive'] = $this->registry->output->formInput( "g_rep_max_positive", $group['g_rep_max_positive'] ); $form['g_rep_max_negative'] = $this->registry->output->formInput( "g_rep_max_negative", $group['g_rep_max_negative'] ); $form['gbw_view_reps'] = $this->registry->output->formYesNo( "gbw_view_reps", $group['gbw_view_reps'] ); $sig_limits = explode( ':', $group['g_signature_limits'] ); $form['use_signatures'] = $this->registry->output->formYesNo( "use_signatures", $sig_limits[0] ); $form['max_images'] = $this->registry->output->formInput( "max_images", $sig_limits[1] ); $form['max_dims'] = $this->lang->words['g_upersonalpho_w'] . ' ' . $this->registry->output->formSimpleInput( "max_dims_x", $sig_limits[2] ) . ' x ' . $this->lang->words['g_upersonalpho_h'] . ' ' . $this->registry->output->formSimpleInput( "max_dims_y", $sig_limits[3] ); $form['max_urls'] = $this->registry->output->formInput( "max_urls", $sig_limits[4] ); $form['max_lines'] = $this->registry->output->formInput( "max_lines", $sig_limits[5] ); $form['g_displayname_unit'] = $this->registry->output->formSimpleInput( "g_displayname_unit", $group['g_displayname_unit'], 3 ); $form['gbw_displayname_unit_type'] = $this->registry->output->formDropdown( "gbw_displayname_unit_type", $gbw_unit_type, $group['gbw_displayname_unit_type'] ); $form['g_sig_unit'] = $this->registry->output->formSimpleInput( "g_sig_unit", $group['g_sig_unit'], 3 ); $form['gbw_sig_unit_type'] = $this->registry->output->formDropdown( "gbw_sig_unit_type", $gbw_unit_type, $group['gbw_sig_unit_type'] ); $form['gbw_promote_unit_type'] = $this->registry->output->formDropdown( "gbw_promote_unit_type", $gbw_unit_type, $group['gbw_promote_unit_type'] ); $form['gbw_no_status_update'] = $this->registry->output->formYesNo( "gbw_no_status_update", $group['gbw_no_status_update'] ); $form['gbw_no_status_import'] = $this->registry->output->formYesNo( "gbw_no_status_import", $group['gbw_no_status_import'] ); $form['g_max_notifications'] = $this->registry->output->formInput( "g_max_notifications", $group['g_max_notifications'] ); $form['gbw_allow_customization'] = $this->registry->output->formYesNo( "gbw_allow_customization" , $group['gbw_allow_customization'] ); $form['gbw_allow_url_bgimage'] = $this->registry->output->formYesNo( "gbw_allow_url_bgimage" , $group['gbw_allow_url_bgimage'] ); $form['gbw_allow_upload_bgimage'] = $this->registry->output->formYesNo( "gbw_allow_upload_bgimage", $group['gbw_allow_upload_bgimage'] ); $form['g_max_bgimg_upload'] = $this->registry->output->formInput( "g_max_bgimg_upload", $group['g_max_bgimg_upload'] ); $form['gbw_disable_tagging'] = $this->registry->output->formYesNo( "gbw_disable_tagging" , $group['gbw_disable_tagging'] ); $form['gbw_disable_prefixes'] = $this->registry->output->formYesNo( "gbw_disable_prefixes", $group['gbw_disable_prefixes'] ); if( $type == 'edit' ) { $title = $this->lang->words['g_editing'] . $group['g_title']; } else { $title = $this->lang->words['g_adding']; } $IPBHTML = ""; //--starthtml--// $IPBHTML .= <<

{$title}

form_code}&do={$form_code}&secure_key={$secure_key}' method='post' id='adform' name='adform' onsubmit='return checkform();'>

 

« »
  • {$this->lang->words['g_globalsett']}
  • {$this->lang->words['g_globalperm']}
  • HTML; // Got blocks from other apps? $IPBHTML .= implode( "\n", $content['tabs'] ); $pmlimit = sprintf( $this->lang->words['gf_pm_limit'], $form['g_pm_perday'] ); $pmflood = sprintf( $this->lang->words['gf_pm_flood'], $form['g_pm_flood_mins'] ); $_firstTab = ( $firsttab ) ? 'GROUPS_' . $firsttab : "GROUPS_1"; $dnc1 = sprintf( $this->lang->words['display_name_changes_1'], $form['g_displayname_unit'], $form['gbw_displayname_unit_type'] ); $dnc2 = sprintf( $this->lang->words['display_name_changes_3'], $form['g_dname_changes'], $form['g_dname_date'] ); $IPBHTML .= <<
{$this->lang->words['gf_t_details']}
{$this->lang->words['gf_gtitle']} {$form['g_title']}
{$this->lang->words['gf_gicon']} {$form['g_icon']}
{$this->lang->words['gf_gicon_info']}
{$this->lang->words['gf_gformpre']} {$form['prefix']}
{$this->lang->words['gf_gformpre_info']}
{$this->lang->words['gf_gformsuf']} {$form['suffix']}
{$this->lang->words['gf_gformsuf_info']}
{$this->lang->words['gf_t_permissions']}
{$this->lang->words['gf_permset']} {$form['permid']}
{$this->lang->words['g_permset_info']}
{$this->lang->words['g_newpermset']} {$form['g_new_perm_set']}
{$this->lang->words['g_newpermset_info']}
{$this->lang->words['gf_hide']} {$form['g_hide_from_list']}
{$this->lang->words['gf_hide_online']} {$form['g_hide_online_list']}
{$this->lang->words['gf_hideonline_desc']}
{$this->lang->words['gf_t_display_name']}
{$this->lang->words['display_name_changes']} {$dnc1}
{$this->lang->words['display_name_changes_2']}

{$dnc2}
{$this->lang->words['display_name_changes_4']}
{$this->lang->words['gf_t_access_control']}
{$this->lang->words['gf_msup']} {$form['g_is_supmod']}
{$this->lang->words['gf_macp']} {$form['g_access_cp']}
{$this->lang->words['gf_t_promotion']}
{$this->lang->words['gf_mpromote']} {$this->javascriptHelpLink('mg_promote')} HTML; if( $group['g_access_cp'] ) { $IPBHTML .= "{$this->lang->words['g_mpromote_no']}"; } else { $promotegrouptxt = sprintf( $this->lang->words['g_mpromote_to'], $form['g_promotion_id'], $form['g_promotion_posts'], $form['gbw_promote_unit_type'] ); $IPBHTML .= "{$promotegrouptxt}"; } $IPBHTML .= <<
{$this->lang->words['gf_t_access_permissions']}
{$this->lang->words['gf_ssite']} HTML; if( $group['g_id'] == $this->settings['guest_group'] ) { $g_view_board_warning_message = sprintf( $this->lang->words['gf_view_board_warning'], $this->registry->output->buildURL( 'app=core&module=settings§ion=settings', 'admin' ) ); $IPBHTML .= <<{$g_view_board_warning_message} HTML; } else { $IPBHTML .= $form['g_view_board']; } $IPBHTML .= <<
{$this->lang->words['gf_soffline']} {$form['g_access_offline']}
{$this->lang->words['gf_sprofile']} {$form['g_mem_info']}
{$this->lang->words['gbw_view_last_info']} {$form['gbw_view_last_info']}
{$this->lang->words['gf_addfriends']} {$form['g_can_add_friends']}
{$this->lang->words['gf_editprofile']} {$form['g_edit_profile']}
{$this->lang->words['gf_shtml']} {$this->javascriptHelpLink('mg_dohtml')} {$form['g_dohtml']}
{$this->lang->words['gf_maxnotify']} {$form['g_max_notifications']}
{$this->lang->words['gf_maxnotify_desc']}
{$this->lang->words['gf_sbadword']} {$form['g_bypass_badwords']}
{$this->lang->words['gf_no_status']} {$form['gbw_no_status_update']}
{$this->lang->words['gf_no_status_import']} {$form['gbw_no_status_import']}
{$this->lang->words['gf_no_status_import_d']}
{$this->lang->words['gf_customization_title']}
{$this->lang->words['gf_bw_allow_customization']} {$form['gbw_allow_customization']}
{$this->lang->words['gbw_allow_customization_d']}
{$this->lang->words['gf_bw_allow_url_bgimage']} {$form['gbw_allow_url_bgimage']}
{$this->lang->words['gbw_allow_url_bgimage_d']}
{$this->lang->words['gf_bw_allow_upload_bgimage']} {$form['gbw_allow_upload_bgimage']}
{$this->lang->words['gf_max_bgimg_upload']} {$form['g_max_bgimg_upload']}

{$this->lang->words['gbw_allow_upload_bgimage_d']}
{$this->lang->words['gf_t_search']}
{$this->lang->words['gf_ssearch']} {$form['g_use_search']}
{$this->lang->words['gf_sflood']} {$form['g_search_flood']}
{$this->lang->words['gf_sflood_info']}
{$this->lang->words['gf_t_pms']}
{$this->lang->words['gf_spm']} {$form['g_use_pm']}
{$pmlimit}
{$pmflood}
{$this->lang->words['gf_spmperday_info']}
{$this->lang->words['gf_spmmax']} {$form['g_max_mass_pm']}
{$this->lang->words['gf_spmmax_info']}
{$this->lang->words['gf_spmmaxstor']} {$form['g_max_messages']}
{$this->lang->words['gf_maxmessages_info']}
{$this->lang->words['gf_upm']} {$form['g_can_msg_attach']}
{$this->lang->words['gf_t_reps']}
{$this->lang->words['gf_repmaxpos']} {$form['g_rep_max_positive']}
{$this->lang->words['gf_repnum_info']}
{$this->lang->words['gf_repmaxneg']} {$form['g_rep_max_negative']}
{$this->lang->words['gf_repnum_info']}
{$this->lang->words['gf_bw_view_reps']}
{$form['gbw_view_reps']}
{$this->lang->words['gf_t_sigs']}
{$this->lang->words['gf_usesigs']}

{$form['use_signatures']}   {$this->lang->words['g_until']} {$form['g_sig_unit']} {$form['gbw_sig_unit_type']}

{$this->lang->words['g_limit_dd']}

{$this->lang->words['gf_sigmaximages']} {$form['max_images']}
{$this->lang->words['gf_sigmaxdims']} {$form['max_dims']}
{$this->lang->words['gf_sigmaxurls']} {$form['max_urls']}
{$this->lang->words['gf_sigmaxtext']} {$form['max_lines']}
{$this->lang->words['gf_t_uploads']}
{$this->lang->words['gf_uglobal']} {$this->javascriptHelpLink('mg_upload')} {$form['g_attach_max']} {$this->lang->words['g_inkb']} ({$this->lang->words['g_ucurrently']}{$group['g_attach_maxdis']})
{$this->lang->words['g_usingle']}{$ini_max}
{$this->lang->words['gf_uglobal_info']}
{$this->lang->words['gf_upost']} {$this->javascriptHelpLink('mg_upload')} {$form['g_attach_per_post']} {$this->lang->words['g_inkb']} ({$this->lang->words['g_ucurrently']}{$group['g_attach_per_postdis']})
{$this->lang->words['g_usingle']}{$ini_max}
{$this->lang->words['gf_upost_info']}
{$this->lang->words['gf_upersonalpho']} {$form['p_max']}{$this->lang->words['g_inkb']}
{$this->lang->words['g_upersonalpho_w']}{$form['p_width']} x {$this->lang->words['g_upersonalpho_h']}{$form['p_height']}
{$this->lang->words['g_upersonalpho_l']}
{$this->lang->words['gf_t_tagging']}
{$this->lang->words['gbw_disable_tagging']} {$form['gbw_disable_tagging']}
{$this->lang->words['gbw_disable_tagging_desc']}
{$this->lang->words['gbw_disable_prefixes']} {$form['gbw_disable_prefixes']}
{$this->lang->words['gbw_disable_prefixes_desc']}
HTML; // Got blocks from other apps? $IPBHTML .= implode( "\n", $content['area'] ); $IPBHTML .= << jQ("#tabstrip_group").ipsTabBar({tabWrap: "#tabstrip_group_content", defaultTab: "tab_{$_firstTab}" });
HTML; //--endhtml--// return $IPBHTML; } /** * Build a javascript help link * * @param string Help ID * @return string Help Link * @since 2.0 * @see admin_core_system_quickhelp */ public function javascriptHelpLink( $help="" ) { return "( settings['_base_url'] ) . "&app=core&module=help§ion=quickhelp&id={$help}','Help','width=450,height=400,resizable=yes,scrollbars=yes'); return false;\">{$this->lang->words['acp_quick_help']} )"; } /** * Overview of groups * * @param string Groups HTML * @param array Groups * @return string HTML */ public function groupsOverviewWrapper( $content, $g_array ) { $new_dd = $this->registry->output->formDropdown( 'id', $g_array, 3 ); $IPBHTML = ""; //--starthtml--// $leSigh = ( $this->request['showSecondary'] ) ? 'closed' : ''; $leBigh = ( $this->request['showSecondary'] ) ? 0 : 1; $IPBHTML .= <<

{$this->lang->words['g_title']}

{$this->lang->words['g_usergroupman']}

{$content}
  {$this->lang->words['g_grouptitle']} {$this->lang->words['g_canaccessacp']} {$this->lang->words['g_issupermod']} {$this->lang->words['g_membercount']}  

form_code}&do=add' method='POST' > _admin_auth_key}' />

{$this->lang->words['g_createnew']}

{$this->lang->words['g_basenewon']} {$new_dd}
HTML; //--endhtml--// return $IPBHTML; } /** * Group row * * @param array Group * @return string HTML */ public function groupsOverviewRow( $r="" ) { $IPBHTML = ""; //--starthtml--// $r['_can_acp_img'] = $r['_can_acp'] ? 'accept.png' : 'cross.png'; $r['_can_supmod_img'] = $r['_can_supmod'] ? 'accept.png' : 'cross.png'; $r['_title'] = IPSMember::makeNameFormatted( $r['g_title'], $r['g_id'] ); $IPBHTML .= << form_code}&do=edit&id={$r['g_id']}' style='font-weight:bold'>{$r['_title']} ({$this->lang->words['g_id']}: {$r['g_id']}) - - HTML; if ( $r['g_id'] != $this->settings['guest_group'] ) { $_extraLink = ''; if( $this->request['showSecondary'] ) { $_extraLink = "&f_inc_secondary=1"; } $IPBHTML .= <<{$r['count']} HTML; } else { $IPBHTML .= <<