|
From: Jon O. <jon...@us...> - 2007-05-31 19:53:31
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23973/includes Modified Files: functions_admin.php Log Message: minor fixes Index: functions_admin.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_admin.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_admin.php 1 Aug 2006 21:02:19 -0000 1.3 --- functions_admin.php 31 May 2007 19:53:27 -0000 1.4 *************** *** 46,49 **** --- 46,144 ---- * Enter description here... * + * @param unknown_type $cat_parent + * @param unknown_type $depth + */ + function admin_cat_main( $cat_parent = 0, $depth = 0 ) + { + global $template, $phpEx; + static $i; + + $pre = str_repeat( ' ', $depth ); + if ( isset( $this->subcat_rowset[$cat_parent] ) ) + { + foreach( $this->subcat_rowset[$cat_parent] as $subcat_id => $cat_data ) + { + if ( $cat_parent == 0 ) + { + $i = 0; + $str = "cat"; + } + else + { + $i++; + $str = ( $i % 2 ) ? "row1" : "row2"; + } + $template->assign_block_vars( 'cat_row', array( + 'COLOR' => $str, + 'U_CAT' => append_sid( "admin_linkdb.$phpEx?action=cat_manage&cat_id" . $subcat_id ), + 'U_CAT_EDIT' => append_sid( "admin_linkdb.$phpEx?action=cat_manage&mode=edit&cat_id=$subcat_id" ), + 'U_CAT_DELETE' => append_sid( "admin_linkdb.$phpEx?action=cat_manage&mode=delete&cat_id=$subcat_id" ), + 'U_CAT_MOVE_UP' => append_sid( "admin_linkdb.$phpEx?action=cat_manage&mode=cat_order&move=-15&cat_id_other=$subcat_id" ), + 'U_CAT_MOVE_DOWN' => append_sid( "admin_linkdb.$phpEx?action=cat_manage&mode=cat_order&move=15&cat_id_other=$subcat_id" ), + 'U_CAT_RESYNC' => append_sid( "admin_linkdb.$phpEx?action=cat_manage&mode=sync&cat_id_other=$subcat_id" ), + 'CAT_NAME' => $cat_data['cat_name'], + 'PRE' => $pre ) + ); + $this->admin_cat_main( $subcat_id, $depth + 1 ); + } + return; + } + return; + } + + /** + * Enter description here... + * + * @param unknown_type $sel_id + * @param unknown_type $use_default_option + * @param unknown_type $select_name + * @return unknown + */ + function get_forums( $sel_id = 0, $use_default_option = false, $select_name = 'forum_id' ) + { + global $db, $lang; + + $sql = "SELECT forum_id, forum_name + FROM " . FORUMS_TABLE; + + if ( !$result = $db->sql_query( $sql ) ) + { + mx_message_die( GENERAL_ERROR, "Couldn't get list of forums", "", __LINE__, __FILE__, $sql ); + } + + $forumlist = '<select name="'.$select_name.'">'; + + if ( $sel_id == 0 ) + { + $forumlist .= '<option value="0" selected >'.$lang['Select_topic_id'].'</option>'; + } + + if ( $use_default_option ) + { + $status = $sel_id == "-1" ? "selected" : ""; + $forumlist .= '<option value="-1" '.$status.' >::'.$lang['Use_default'].'::</option>'; + } + + while ( $row = $db->sql_fetchrow( $result ) ) + { + if ( $sel_id == $row['forum_id'] ) + { + $status = "selected"; + } + else + { + $status = ''; + } + $forumlist .= '<option value="' . $row['forum_id'] . '" ' . $status . '>' . $row['forum_name'] . '</option>'; + } + + $forumlist .= '</select>'; + + return $forumlist; + } + + /** + * Enter description here... + * * @param unknown_type $cat_id * @return unknown |