/** * in_array() is a native PHP function that will determine if the value of the * first argument is found in the array listed in the second argument. Strings * are case sensitive and the 3rd argument determines whether type matching is * required */ if (in_array($clean_op, $valid_op, true)) { switch ($clean_op) { case "mod": $profile_tribes_handler = icms_getModuleHandler('tribes', basename(dirname(dirname(__FILE__))), 'profile'); $tribes = $profile_tribes_handler->getAllTribes(); if (count($tribes) == 0) { redirect_header(PROFILE_ADMIN_URL . 'tribeuser.php', 3, _AM_PROFILE_TRIBEUSER_NOTTRIBESYET); } icms_cp_header(); edittribeuser($clean_tribeuser_id); break; case "addtribeuser": $controller = new icms_ipf_Controller($profile_tribeuser_handler); $controller->storeFromDefaultForm(_AM_PROFILE_TRIBEUSER_CREATED, _AM_PROFILE_TRIBEUSER_MODIFIED); break; case "del": $controller = new icms_ipf_Controller($profile_tribeuser_handler); $controller->handleObjectDeletion(); break; default: icms_cp_header(); icms::$module->displayAdminMenu(8, _AM_PROFILE_TRIBEUSERS); $objectTable = new icms_ipf_view_Table($profile_tribeuser_handler); $objectTable->addColumn(new icms_ipf_view_Column('tribeuser_id', _GLOBAL_LEFT, false, 'getTribeuserId')); $objectTable->addColumn(new icms_ipf_view_Column('tribe_id', _GLOBAL_LEFT, false, 'getTribeName', false, false, false));
redirect_header(icms_getPreviousPage('index.php'), 3, _MD_PROFILE_SECURITY_CHECK_FAILED . implode('<br />', icms::$security->getErrors())); } $controller = new icms_ipf_Controller($profile_tribes_handler); $controller->handleObjectDeletionFromUserSide(); break; default: if ($userCanEditAndDelete) { edittribes($tribesObj, true); } if ($clean_tribes_id > 0) { if ($tribesObj->isNew()) { redirect_header(icms_getPreviousPage('index.php'), 3, _MD_PROFILE_TRIBES_NOTFOUND); } $icmsTpl->assign('profile_category_path', '<a href="' . $tribesObj->handler->_moduleUrl . $tribesObj->handler->_page . '?uid=' . $uid . '">' . _MD_PROFILE_TRIBES . '</a>'); // make tribe form edittribeuser($tribesObj, true); $clean_topic_id = isset($_GET['topic_id']) ? (int) $_GET['topic_id'] : 0; $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0; $profile_tribes_handler->updateCounter($clean_tribes_id); $tribe = $tribesObj->toArray(); $icmsTpl->assign('profile_tribe', $tribe); $tribeOwner = array('tribeuser_avatar' => $tribe['tribe_sender_avatar'], 'tribeuser_sender_link' => $tribe['tribe_sender_link'], 'owner' => TRUE); $tribeMembers = $profile_tribeuser_handler->getTribeusers(0, 0, false, false, $clean_tribes_id, '=', 1, 1); $tribeMembers = array_merge(array($tribeOwner), $tribeMembers); $icmsTpl->assign('profile_tribe_members', $tribeMembers); $icmsTpl->assign('userCanEditAndDelete', $userCanEditAndDelete); $icmsTpl->assign('delete_image', ICMS_IMAGES_SET_URL . "/actions/editdelete.png"); $showContent = $tribesObj->isMember($real_uid); $icmsTpl->assign('showContent', $showContent); icms_makeSmarty(array('lang_members' => _MD_PROFILE_TRIBES_MEMBERS, 'lang_topics' => _MD_PROFILE_TRIBES_TOPICS, 'lang_discussions' => _MD_PROFILE_TRIBES_DISCUSSIONS, 'lang_creation_time' => _MD_PROFILE_TRIBES_CREATION_TIME, 'lang_views' => _MD_PROFILE_TRIBES_VIEWS, 'lang_owner' => _MD_PROFILE_TRIBES_OWNER, 'lang_delete' => _DELETE)); $total_topics_count = $profile_tribetopic_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('tribes_id', $clean_tribes_id)));