/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. * */ public function reportPhoto($link, $message, $id) { $report = new CReportingLibrary(); $config = CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } // Pass the link and the reported message $report->createReport(JText::_('COM_COMMUNITY_BAD_PHOTO'), $link, $message); // Add the action that needs to be called. $action = new stdClass(); $action->label = 'COM_COMMUNITY_PHOTOS_UNPUBLISH'; $action->method = 'photos,unpublishPhoto'; $action->parameters = $id; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. * */ public function reportProfile($link, $message, $id) { $report = new CReportingLibrary(); $config = CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } $report->createReport(JText::_('COM_COMMUNITY_REPORT_BAD_USER'), $link, $message); $action = new stdClass(); $action->label = 'COM_COMMUNITY_BLOCK_USER'; $action->method = 'profile,blockProfile'; $action->parameters = $id; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
public function reportActivities($link, $message, $id) { $report = new CReportingLibrary(); $config = CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } if (strpos($link, 'actid') === false) { $link = $link . '&actid=' . $id; } if (strpos($link, '&actid') && !strpos($link, '?')) { $link = str_replace('&actid', '?actid', $link); } $report->createReport(JText::_('COM_COMMUNITY_REPORT_ACTIVITY_CONTAIN'), $link, $message); $action = new stdClass(); $action->label = 'COM_COMMUNITY_ACTVITIES_REMOVE'; $action->method = 'activities,deleteStream'; $action->parameters = $id; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportEvent($link, $message, $eventId) { CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $report->createReport(JText::_('COM_COMMUNITY_EVENTS_BAD'), $link, $message); $action = new stdClass(); $action->label = 'Unpublish event'; $action->method = 'events,unpublishEvent'; $action->parameters = $eventId; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportProfile($link, $message, $id) { CFactory::load('libraries', 'reporting'); $report = new CReportingLibrary(); $config =& CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } $report->createReport(JText::_('Bad user'), $link, $message); $action = new stdClass(); $action->label = 'Block User'; $action->method = 'profile,blockProfile'; $action->parameters = $id; $action->defaultAction = false; $report->addActions(array($action)); return JText::_('CC REPORT SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. * */ public function reportVideo($link, $message, $id) { //CFactory::load( 'libraries' , 'reporting' ); $report = new CReportingLibrary(); $config = CFactory::getConfig(); $my = CFactory::getUser(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } // Pass the link and the reported message $report->createReport(JText::_('COM_COMMUNITY_VIDEOS_ERROR'), $link, $message); // Add the action that needs to be called. $action = new stdClass(); $action->label = 'COM_COMMUNITY_VIDEOS_UNPUBLISH'; $action->method = 'videos,deleteVideo'; $action->parameters = array($id, 0); $action->defaultAction = false; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportGroup($link, $message, $groupId) { CFactory::load('libraries', 'reporting'); $config =& CFactory::getConfig(); $my = CFactory::getUser(); $report = new CReportingLibrary(); if (!$config->get('enablereporting') || $my->id == 0 && !$config->get('enableguestreporting')) { return ''; } $report->createReport(JText::_('Bad group'), $link, $message); $action = new stdClass(); $action->label = 'Unpublish group'; $action->method = 'groups,unpublishGroup'; $action->parameters = $groupId; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('CC REPORT SUBMITTED'); }
/** * Method is called from the reporting library. Function calls should be * registered here. * * return String Message that will be displayed to user upon submission. **/ public function reportGroup($link, $message, $groupId) { CFactory::load('libraries', 'reporting'); $config =& CFactory::getConfig(); $my = CFactory::getUser(); $report = new CReportingLibrary(); if (!$my->authorise('community.view', 'groups.report')) { return ''; } $report->createReport(JText::_('Bad group'), $link, $message); $action = new stdClass(); $action->label = 'Unpublish group'; $action->method = 'groups,unpublishGroup'; $action->parameters = $groupId; $action->defaultAction = true; $report->addActions(array($action)); return JText::_('COM_COMMUNITY_REPORT_SUBMITTED'); }