本文整理汇总了PHP中Extension::get_id_by_identifier方法的典型用法代码示例。如果您正苦于以下问题:PHP Extension::get_id_by_identifier方法的具体用法?PHP Extension::get_id_by_identifier怎么用?PHP Extension::get_id_by_identifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extension
的用法示例。
在下文中一共展示了Extension::get_id_by_identifier方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: io_handler
//.........这里部分代码省略.........
}
} else {
throw new ItemAddIOClassNotFoundException();
}
} else {
throw new ItemAddIOFileNotFoundException();
}
} else {
throw new ItemHandlerClassNotFoundException();
}
} else {
throw new ItemPositionIDMissingException();
}
} else {
throw new ItemParentIDMissingException();
}
} else {
throw new ItemParentTypeMissingException();
}
} else {
throw new ProjectSecurityAccessDeniedException();
}
break;
// Extension
/**
* @todo type filter
*/
// Extension
/**
* @todo type filter
*/
case "extension":
if ($_GET['extension']) {
$extension_id = Extension::get_id_by_identifier($_GET['extension']);
if ($extension_id) {
$extension = new Extension($extension_id);
$main_file = constant("EXTENSION_DIR") . "/" . $extension->get_folder() . "/" . $extension->get_main_file();
$main_class = $extension->get_class();
if (file_exists($main_file)) {
require_once $main_file;
if (class_exists($main_class)) {
$project = new Project($_GET['project_id']);
$project_item = new ProjectItem($_GET['project_id']);
$project_status_requirements = $project->get_current_status_requirements();
if (is_array($project_status_requirements) and count($project_status_requirements) >= 1) {
foreach ($project_status_requirements as $key => $value) {
if ($value['element_type'] == "extension" and $value['extension'] == $_GET['extension']) {
if (is_array($value['filter']) and count($value['filter']) >= 1) {
$filter_array = $value['filter'];
} else {
$filter_array = null;
}
break;
}
}
} else {
throw new ProjectStatusWithoutExtensionException();
}
if ($filter_array) {
$item_array = array();
foreach ($filter_array as $key => $value) {
if (is_numeric($value['status'])) {
$item_array = array_merge($item_array, $project_item->get_project_status_items($value['status'], true));
}
}
} else {
示例2: get_current_status_requirements
//.........这里部分代码省略.........
unset($parent_requirement_array['sub_items']);
if (!is_numeric($parent_item_array[$value['parent_status']])) {
$return_array[$counter] = $parent_requirement_array;
$return_array[$counter]['display'] = false;
$parent_item_counter = $counter;
$parent_item_array[$value['parent_status']] = $counter;
} else {
$parent_item_counter = $parent_item_array[$value['parent_status']];
}
if (is_array($sub_item_array) and count($sub_item_array) >= 1) {
foreach ($sub_item_array as $sub_item_key => $sub_item_value) {
$return_array[$parent_item_counter]['sub_items'][$sub_item_key][$value['pos_id']] = $sub_item_value[$value['pos_id']];
if ($value['takeover'] == "true") {
$return_array[$parent_item_counter]['sub_items'][$sub_item_key][$value['pos_id']]['takeover'] = true;
} else {
$return_array[$parent_item_counter]['sub_items'][$sub_item_key][$value['pos_id']]['takeover'] = false;
}
}
}
} elseif ($in_item == true and is_array($item_instance_array) and count($item_instance_array) >= 1) {
foreach ($item_instance_array as $object_key => $object_value) {
if (is_numeric($value['pos_id'])) {
$pos_id = $value['pos_id'];
} else {
$pos_id = $sub_item_counter;
}
$return_array[$counter]['sub_items'][$object_key][$pos_id] = $object_value->get_item_add_information($pos_id);
}
}
}
// TYPE
if ($value['xml_element'] == "type" and !$value['close'] and $in_item = true and is_numeric($value['id'])) {
$return_array[$counter]['type_id'][$type_counter] = $value['id'];
$type_counter++;
}
// CATEGORY
if ($value['xml_element'] == "category" and !$value['close'] and $in_item = true and is_numeric($value['id'])) {
$return_array[$counter]['category_id'][$category_counter] = $value['id'];
$category_counter++;
}
// EXTENSION
if ($value['xml_element'] == "extension" and !$value['close']) {
$extension_id = Extension::get_id_by_identifier($value['identifier']);
$extension = new Extension($extension_id);
$return_array[$counter]['element_type'] = "extension";
$return_array[$counter]['name'] = $extension->get_name();
$return_array[$counter]['extension'] = $value['identifier'];
if ($value['requirement'] and $status_attribute_array['requirement'] != "optional") {
$return_array[$counter]['requirement'] = $value['requirement'];
} else {
$return_array[$counter]['requirement'] = $requirement_default;
}
if ($value['occurrence']) {
$return_array[$counter]['occurrence'] = $value['occurrence'];
} else {
$return_array[$counter]['occurrence'] = "once";
}
$return_array[$counter]['fulfilled'] = ProjectExtension::get_status($extension_id, $this->project_id);
$in_extension = true;
}
if ($value['xml_element'] == "extension" and $value['close'] == "1") {
$counter++;
$filter_counter = 0;
$in_extension = false;
}
// FILTER
if ($value['xml_element'] == "filter" and !$value['close'] and $in_extension == true and is_numeric($value['status'])) {
$return_array[$counter]['filter'][$filter_counter]['status'] = $value['status'];
if ($value['type']) {
$return_array[$counter]['filter'][$filter_counter]['type'] = $value['type'];
}
$filter_counter++;
}
}
}
if (is_array($return_array) and count($return_array) >= 1) {
foreach ($return_array as $key => $value) {
if (!$value['name'] and $value['type']) {
if ($return_array[$key]['handling_class']) {
$return_array[$key]['name'] = "Add " . $return_array[$key]['handling_class']::get_generic_name($value['type'], $value['type_id']);
}
}
if (is_array($value['sub_items']) and count($value['sub_items']) >= 1) {
foreach ($value['sub_items'] as $sub_item_key => $sub_item_value) {
if (!$sub_item_value['name'] and $sub_item_value['type']) {
if ($return_array[$key]['sub_items'][$sub_item_key]['handling_class']) {
$return_array[$key]['sub_items'][$sub_item_key]['name'] = "Add " . $return_array[$key]['sub_items'][$sub_item_key]['handling_class']::get_generic_name($sub_item_value['type'], $sub_item_value['type_id']);
}
}
}
}
}
}
$runtime_data->write_object_data($this, "PROJECT_" . $this->project_id . "_" . $status_id . "_CURRENT_STATUS_REQUIREMENTS", $return_array);
return $return_array;
}
} else {
return null;
}
}
示例3: ajax
/**
* Main Controller for requests via ajax.php
* @throws BaseModuleControllerClassNotFoundException
* @throws BaseModuleControllerFileNotFoundException
* @throws BaseExtensionClassNotFoundException
* @throws BaseExtensionFileNotFoundException
* @throws BaseExtensionNotFoundException
* @throws BaseModuleIllegalControllerCallException
*/
public static function ajax()
{
global $session;
try {
$session_valid_array = $session->is_valid();
if ($session_valid_array[0] === true) {
if ($_GET['nav']) {
$module_controller_array = SystemHandler::get_module_controller($_GET['nav']);
$module_controller_path = "core/modules/" . $module_controller_array['path'];
if (file_exists($module_controller_path)) {
require_once $module_controller_path;
if (class_exists($module_controller_array['class'])) {
$module_controller_array['class']::ajax_handler($module_controller_array['alias']);
} else {
throw new BaseModuleControllerClassNotFoundException();
}
} else {
throw new BaseModuleControllerFileNotFoundException();
}
} elseif ($_GET['extension']) {
$extension_id = Extension::get_id_by_identifier($_GET['extension']);
if (is_numeric($extension_id)) {
$extension = new Extension($extension_id);
$extension_class = $extension->get_class();
$extension_file = constant("EXTENSION_DIR") . "/" . $extension->get_folder() . "/" . $extension->get_main_file();
if (file_exists($extension_file)) {
require_once $extension_file;
if (class_exists($extension_class)) {
$extension_class::ajax();
} else {
throw new BaseExtensionClassNotFoundException();
}
} else {
throw new BaseExtensionFileNotFoundException();
}
} else {
throw new BaseExtensionNotFoundException();
}
} else {
throw new BaseModuleIllegalControllerCallException();
}
} else {
if ($_GET['nav'] == "base" and $_GET['run'] == "login" or $_GET['nav'] == "base" and $_GET['run'] == "forgot_password" or $_GET['run'] == "cron" or $_GET['nav'] == "base" and $_GET['run'] == "logout" and $session->is_dead() == true) {
require_once "core/modules/base/base.request.php";
BaseRequest::ajax_handler(null);
}
}
} catch (DatabaseQueryFailedException $e) {
echo "EXCEPTION: DatabaseQueryFailedException";
} catch (BaseException $e) {
$error_io = new Error_IO($e);
echo "EXCEPTION: " . $error_io->get_error_message();
}
}