本文整理汇总了PHP中ilUtil::prepareDBString方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::prepareDBString方法的具体用法?PHP ilUtil::prepareDBString怎么用?PHP ilUtil::prepareDBString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::prepareDBString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateObject
public function updateObject()
{
global $ilAccess;
if (!$ilAccess->checkAccess('write', '', (int) $_GET['ref_id'])) {
$this->ilErr->raiseError($this->lng->txt('permission_denied'), $this->ilErr->MESSAGE);
}
$this->initSettingsForm('edit');
if ($this->form_gui->checkInput()) {
$_POST['Fobject']['title'] = $this->form_gui->getInput('title');
$_POST['Fobject']['desc'] = $this->form_gui->getInput('desc');
$_POST['Fobject']['activated'] = $this->form_gui->getInput('activated');
$_POST['Fobject']['akclassvalue1'] = $this->form_gui->getInput('akclassvalue1');
$_POST['Fobject']['akclassvalue2'] = $this->form_gui->getInput('akclassvalue2');
$this->object->setTitle(ilUtil::prepareDBString($_POST['Fobject']['title']));
$this->object->setDescription(ilUtil::prepareDBString($_POST['Fobject']['desc']));
$this->object->activated = ilUtil::tf2yn($_POST['Fobject']['activated']);
// update akclassvalues only if iLinc is active
if ($this->ilias->getSetting('ilinc_akclassvalues_active')) {
if ($this->object->getAKClassValue1() != $_POST['Fobject']['akclassvalue1']) {
$this->object->setAKClassValue1(ilUtil::prepareDBString($_POST['Fobject']['akclassvalue1']));
}
if ($this->object->getAKClassValue2() != $_POST['Fobject']['akclassvalue2']) {
$this->object->setAKClassValue2(ilUtil::prepareDBString($_POST['Fobject']['akclassvalue2']));
}
}
// save changes to ilinc server and ilias database
$success = $this->object->update();
if ($success == false) {
$this->ilErr->raiseError($this->object->getErrorMsg(), $this->ilErr->MESSAGE);
}
// update all akclassvalues of classes if akclassvalues has changed
if (array_key_exists('akclassvalue1', $_POST['Fobject']) or array_key_exists('akclassvalue2', $_POST['Fobject'])) {
if (!$this->object->updateClassrooms()) {
ilUtil::sendInfo($this->lng->txt($this->object->getErrorMsg()));
$this->form_gui->setValuesByPost();
return $this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
}
}
ilUtil::sendInfo($this->lng->txt('msg_obj_modified'));
$this->form_gui->setValuesByPost();
return $this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
} else {
$this->form_gui->setValuesByPost();
return $this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
}
}
示例2: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'size' => ilUtil::prepareDBString($this->getSize()), 'installation_remarks' => ilUtil::prepareDBString($this->getInstallationRemarks()), 'installation_remarks_language' => ilUtil::prepareDBString($this->getInstallationRemarksLanguageCode()), 'other_platform_requirements' => ilUtil::prepareDBString($this->getOtherPlatformRequirements()), 'other_platform_requirements_language' => ilUtil::prepareDBString($this->getOtherPlatformRequirementsLanguageCode()), 'duration' => ilUtil::prepareDBString($this->getDuration()));
}
示例3: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'format' => ilUtil::prepareDBString($this->getFormat()));
}
示例4: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'interactivity_type' => ilUtil::prepareDBString($this->getInteractivityType()), 'learning_resource_type' => ilUtil::prepareDBString($this->getLearningResourceType()), 'interactivity_level' => ilUtil::prepareDBString($this->getInteractivityLevel()), 'semantic_density' => ilUtil::prepareDBString($this->getSemanticDensity()), 'intended_end_user_role' => ilUtil::prepareDBString($this->getIntendedEndUserRole()), 'context' => ilUtil::prepareDBString($this->getContext()), 'difficulty' => ilUtil::prepareDBString($this->getDifficulty()), 'typical_learning_time' => ilUtil::prepareDBString($this->getTypicalLearningTime()));
}
示例5: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'parent_type' => $this->getParentType(), 'parent_id' => $this->getParentId(), 'typical_age_range' => ilUtil::prepareDBString($this->getTypicalAgeRange()), 'typical_age_range_language' => ilUtil::prepareDBString($this->getTypicalAgeRangeLanguageCode()));
}
示例6: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'costs' => ilUtil::prepareDBString($this->getCosts()), 'copyright_and_other_restrictions' => ilUtil::prepareDBString($this->getCopyrightAndOtherRestrictions()), 'description' => ilUtil::prepareDBString($this->getDescription()), 'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
}
示例7: update
/**
* update object in db
*
* Note: This is mostly the same as method update in class.ilObject.php.
* In addition to updating descriptional properties, we also update the
* "type" property. This is needed, because a Null Resource can be converted
* into another resource type using a PUT or a MKCOL request by a WebDAV client.
*
* @access public
* @return boolean true on success
*/
function update()
{
parent::update();
$q = "UPDATE object_data" . " SET" . " type = '" . ilUtil::prepareDBString($this->getType()) . "'" . " WHERE obj_id = '" . $this->getId() . "'";
$this->ilias->db->query($q);
return true;
}
示例8: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'parent_type' => $this->getParentType(), 'parent_id' => $this->getParentId(), 'role' => ilUtil::prepareDBString($this->getRole()), 'date' => ilUtil::prepareDBString($this->getDate()));
}
示例9: __parseQuotation
function __parseQuotation()
{
if (!strlen($this->getQueryString())) {
$this->quoted_words[] = '';
return false;
}
$query_str = $this->getQueryString();
while (preg_match("/\".*?\"/", $query_str, $matches)) {
$query_str = str_replace($matches[0], '', $query_str);
$this->quoted_words[] = ilUtil::prepareDBString($matches[0]);
}
// Parse the rest
$words = explode(' ', trim($query_str));
foreach ($words as $word) {
if (!strlen(trim($word))) {
continue;
}
$this->quoted_words[] = ilUtil::prepareDBString($word);
}
if (!$this->getAllowedWildcards()) {
// #14768
foreach ($this->quoted_words as $idx => $word) {
if (!stristr($word, '\\')) {
$word = str_replace('%', '\\%', $word);
$word = str_replace('_', '\\_', $word);
}
$this->quoted_words[$idx] = $word;
}
}
}
示例10: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'parent_type' => $this->getParentType(), 'parent_id' => $this->getParentId(), 'keyword' => ilUtil::prepareDBString($this->getKeyword()), 'keyword_language' => ilUtil::prepareDBString($this->getKeywordLanguageCode()));
}
示例11: __parseQuotation
function __parseQuotation()
{
if (!strlen($this->getQueryString())) {
$this->quoted_words[] = '';
return false;
}
$query_str = $this->getQueryString();
while (preg_match("/\".*?\"/", $query_str, $matches)) {
$query_str = str_replace($matches[0], '', $query_str);
$this->quoted_words[] = ilUtil::prepareDBString($matches[0]);
}
// Parse the rest
$words = explode(' ', trim($query_str));
foreach ($words as $word) {
if (!strlen(trim($word))) {
continue;
}
$this->quoted_words[] = ilUtil::prepareDBString($word);
}
}
示例12: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'parent_type' => $this->getParentType(), 'parent_id' => $this->getParentId(), 'operating_system_name' => ilUtil::prepareDBString($this->getOperatingSystemName()), 'operating_system_minimum_version' => ilUtil::prepareDBString($this->getOperatingSystemMinimumVersion()), 'operating_system_maximum_version' => ilUtil::prepareDBString($this->getOperatingSystemMaximumVersion()), 'browser_name' => ilUtil::prepareDBString($this->getBrowserName()), 'browser_minimum_version' => ilUtil::prepareDBString($this->getBrowserMinimumVersion()), 'browser_maximum_version' => ilUtil::prepareDBString($this->getBrowserMaximumVersion()), 'or_composite_id' => $this->getOrCompositeId());
}
示例13: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'lifecycle_status' => ilUtil::prepareDBString($this->getStatus()), 'meta_version' => ilUtil::prepareDBString($this->getVersion()), 'version_language' => ilUtil::prepareDBString($this->getVersionLanguageCode()));
}
示例14: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'meta_data_scheme' => ilUtil::prepareDBString($this->getMetaDataScheme()), 'language' => ilUtil::prepareDBString($this->getLanguageCode()));
}
示例15: __getFields
function __getFields()
{
return array('rbac_id' => $this->getRBACId(), 'obj_id' => $this->getObjId(), 'obj_type' => ilUtil::prepareDBString($this->getObjType()), 'parent_type' => $this->getParentType(), 'parent_id' => $this->getParentId(), 'catalog' => ilUtil::prepareDBString($this->getCatalog()), 'entry' => ilUtil::prepareDBString($this->getEntry()));
}