code/pages/WikiPage.php
public function objectdetails() {
		$response = new stdClass;
		if (isset($_GET['ID'])) {
			$type = null;
			if (isset($_GET['type'])) {
				$type = $_GET['type'] == 'href' ? 'SiteTree' : 'File';
			} else {
				$type = 'SiteTree';
			}

			$object = DataObject::get_by_id($type, $_GET['ID']);

			$response->Title = $object->Title;
			$response->Link = $object->Link();

			if ($object instanceof Image) {
				$response->Name = $object->Name;
				$response->Filename = $object->Filename;
				$response->width = $object->getWidth();
				$response->height = $object->getHeight();
			}

			$response->error = 0;
		} else {
			$response->error = 1;
			$response->message = "Invalid image ID";
		}
		echo json_encode($response);
	}
public function objectdetails() {
		$response = new stdClass;
		if (isset($_GET['ID'])) {
			$type = null;
			if (isset($_GET['type'])) {
				$type = $_GET['type'] == 'href' ? 'SiteTree' : 'File';
			} else {
				$type = 'SiteTree';
			}

			$object = DataObject::get_by_id($type, $_GET['ID']);

			$response->Title = $object->Title;
			$response->Link = $object->Link();

			if ($object instanceof Image) {
				$response->Name = $object->Name;
				$response->Filename = $object->Filename;
				$response->width = $object->getWidth();
				$response->height = $object->getHeight();
			}

			$response->error = 0;
		} else {
			$response->error = 1;
			$response->message = "Invalid image ID";
		}
		echo json_encode($response);
	}
public function objectdetails ( ) { $ response = new stdClass ; if ( isset ( $ _GET [ 'ID' ] ) ) { $ type = null ; if ( isset ( $ _GET [ 'type' ] ) ) { $ type = $ _GET [ 'type' ] == 'href' ? 'SiteTree' : 'File' ; } else { $ type = 'SiteTree' ; } $ object = DataObject :: get_by_id ( $ type , $ _GET [ 'ID' ] ) ; $ response -> Title = $ object -> Title ; $ response -> Link = $ object -> Link ( ) ; if ( $ object instanceof Image ) { $ response -> Name = $ object -> Name ; $ response -> Filename = $ object -> Filename ; $ response -> width = $ object -> getWidth ( ) ; $ response -> height = $ object -> getHeight ( ) ; } $ response -> error = 0 ; } else { $ response -> error = 1 ; $ response -> message = "Invalid image ID" ; } echo json_encode ( $ response ) ; }
Retrieves information about a selected image for the frontend
image insertion tool - hacky for now, ideally need to pull through the
backend ImageForm

@return string
Retrieves information about a selected image for the frontend image insertion tool - hacky for now ideally need to pull through the backend ImageForm