Skip to content
Snippets Groups Projects
Commit 368cc7ec authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

remove dead code, fixes #1241

Closes #1241

Merge request studip/studip!756
parent 7e128a20
No related branches found
No related tags found
No related merge requests found
<?php <?php
/** /**
* ContentBoxHelper.php * ContentBoxHelper.php
* *
* The ContentBoxHelper controls ids of contentboxes * The ContentBoxHelper controls ids of contentboxes
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -19,33 +19,33 @@ class ContentBoxHelper { ...@@ -19,33 +19,33 @@ class ContentBoxHelper {
/** /**
* Returns the class open if the id was clicked * Returns the class open if the id was clicked
* *
* @param String $id id of the content box * @param String $id id of the content box
* @param int $chdate last change of the displayed article * @param int $chdate last change of the displayed article
* @return String open if the contentbox is open otherwise an empty String * @return String open if the contentbox is open otherwise an empty String
*/ */
public static function classes($id, $is_new = false) { public static function classes($id, $is_new = false) {
// Init // Init
$classes = []; $classes = [];
// Check if open // Check if open
if (Request::get('contentbox_open') == $id) { if (Request::get('contentbox_open') == $id) {
$classes[] = 'open'; $classes[] = 'open';
} }
// Check if new // Check if new
if ($is_new) { if ($is_new) {
$classes[] = 'new'; $classes[] = 'new';
} }
// Return classes // Return classes
return join(' ', $classes); return join(' ', $classes);
} }
/** /**
* Produces an html link to open a contentbox if javascript is not active * Produces an html link to open a contentbox if javascript is not active
* *
* @param String $id Id of the content box * @param String $id Id of the content box
* @param Array $params other needed parameters * @param Array $params other needed parameters
* @return String Url to open the contentbox * @return String Url to open the contentbox
...@@ -61,7 +61,7 @@ class ContentBoxHelper { ...@@ -61,7 +61,7 @@ class ContentBoxHelper {
/** /**
* Link to the contentbox (Required when some action should take place) * Link to the contentbox (Required when some action should take place)
* *
* @param String $id Id of the content box * @param String $id Id of the content box
* @param Array $params other needed parameters * @param Array $params other needed parameters
* @return String Url to the contentbox * @return String Url to the contentbox
...@@ -70,18 +70,4 @@ class ContentBoxHelper { ...@@ -70,18 +70,4 @@ class ContentBoxHelper {
$params['contentbox_open'] = $id; $params['contentbox_open'] = $id;
return URLHelper::getURL("#$id", $params); return URLHelper::getURL("#$id", $params);
} }
/**
* Sets an object as visited
*
* @param String $type the type to be set in the database
* @param Array $ids Array of ids that might be visited with the given type
*/
public static function visitType($type, $ids) {
$object_id = Request::get('contentbox_open');
if ($object_id && in_array($object_id, $ids)) {
ObjectVisit::visit($object_id, $type);
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment