当前位置: 首页>>代码示例>>PHP>>正文


PHP munge_string_to_url函数代码示例

本文整理汇总了PHP中munge_string_to_url函数的典型用法代码示例。如果您正苦于以下问题:PHP munge_string_to_url函数的具体用法?PHP munge_string_to_url怎么用?PHP munge_string_to_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了munge_string_to_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.<br />
  * Required for all subclasses.<br />
  * Should be called from each subclass as the very first.
  * @param object &$content_obj - the content object instance that creates the contentblock
  * @param array $params - the parameters of that contentblock
  */
 function __construct(&$content_obj, &$params = array())
 {
     $this->content_obj = $content_obj;
     $AdvancedContent =& cms_utils::get_module('AdvancedContent');
     $this->_block_properties['smarty'] = isset($params['smarty']) ? $params['smarty'] : false;
     $this->_block_properties['editor_groups'] = isset($params['editor_groups']) ? $params['editor_groups'] : '';
     $this->_block_properties['editor_users'] = isset($params['editor_users']) ? $params['editor_users'] : '';
     $this->_block_properties['type'] = isset($params['block_type']) ? $params['block_type'] : '';
     $this->_block_properties['name'] = isset($params['block']) ? $params['block'] : 'content_en';
     $this->_block_properties['id'] = preg_replace('/-+/', '_', munge_string_to_url($this->_block_properties['name']));
     $this->_block_properties['label'] = isset($params['label']) ? $params['label'] : ucwords($this->_block_properties['name']);
     $this->_block_properties['translate_labels'] = isset($params['translate_labels']) && $this->content_obj->IsTrue($params['translate_labels']);
     $this->_block_properties['translate_values'] = isset($params['translate_values']) && $this->content_obj->IsTrue($params['translate_values']);
     $this->_block_properties['required'] = isset($params['required']) && $this->content_obj->IsTrue($params['required']);
     $this->_block_properties['default'] = isset($params['default']) ? $params['default'] : '';
     $this->_block_properties['style'] = isset($params['style']) ? $params['style'] : '';
     # deprecated
     $this->_block_properties['page_tab'] = isset($params['page_tab']) ? $params['page_tab'] : 'main';
     $this->_block_properties['block_tab'] = isset($params['block_tab']) ? $params['block_tab'] : '';
     $this->_block_properties['block_group'] = isset($params['block_group']) ? $params['block_group'] : '';
     $this->_block_properties['allow_none'] = !(isset($params['allow_none']) && $this->content_obj->IsFalse($params['allow_none']));
     $this->_block_properties['description'] = isset($params['description']) ? $params['description'] : '';
     $this->_block_properties['no_collapse'] = isset($params['no_collapse']) && $this->content_obj->IsTrue($params['no_collapse']);
     $this->_block_properties['collapsible'] = !$this->_block_properties['no_collapse'];
     if (!$this->_block_properties['collapsible']) {
         $this->_block_properties['collapse'] = false;
     } else {
         $this->_block_properties['collapse'] = isset($params['collapse']) ? !$this->content_obj->IsFalse($params['collapse']) : $AdvancedContent->GetPreference('collapse_block_default', true);
     }
     $this->_block_properties['feu_access'] = isset($params['feu_access']) ? $params['feu_access'] : '';
     $this->_block_properties['feu_action'] = isset($params['feu_action']) && $this->content_obj->IsTrue($params['feu_action']);
     $this->_block_properties['feu_hide'] = isset($params['feu_hide']) && $this->content_obj->IsTrue($params['feu_hide']);
     #$this->_block_properties['inherit'] = (isset($params['inherit']) && $this->content_obj->IsTrue($params['inherit']));
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:41,代码来源:class.acContentBlockBase.php

示例2: _get_items_array

 /**
  * Not part of the api
  */
 private function _get_items_array($selItems = array())
 {
     $AdvancedContent =& cms_utils::get_module('AdvancedContent');
     $items = array();
     if ($this->GetBlockProperty('items') != '') {
         foreach (explode($this->GetBlockProperty('delimiter'), $this->GetBlockProperty('items')) as $key => $val) {
             $items[$key]['id'] = munge_string_to_url(trim($val));
             $items[$key]['label'] = trim($val);
             if ($this->GetBlockProperty('translate_labels')) {
                 $items[$key]['label'] = $AdvancedContent->lang($items[$key]['label']);
             }
             $items[$key]['value'] = $items[$key]['label'];
             $items[$key]['selected'] = in_array($items[$key]['label'], $selItems);
         }
     }
     if ($this->GetBlockProperty('values') != '') {
         foreach (explode($this->GetBlockProperty('delimiter'), $this->GetBlockProperty('values')) as $key => $val) {
             $items[$key]['value'] = trim($val);
             if ($this->GetBlockProperty('translate_values')) {
                 $items[$key]['value'] = $AdvancedContent->lang($items[$key]['value']);
             }
             $items[$key]['selected'] = in_array($items[$key]['value'], $selItems);
             if (!isset($items[$key]['label'])) {
                 $items[$key]['label'] = $items[$key]['value'];
             }
         }
     }
     return $items;
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:32,代码来源:class.acBlockType_select_multiple.php

示例3: __get

 public function __get($key)
 {
     $fielddefs = news_ops::get_fielddefs(FALSE);
     switch ($key) {
         case 'alias':
             $alias = munge_string_to_url($this->name);
             return $alias;
         case 'id':
         case 'name':
         case 'type':
         case 'max_length':
         case 'create_date':
         case 'modified_date':
         case 'item_order':
         case 'public':
         case 'value':
             if (isset($this->_data[$key])) {
                 return $this->_data[$key];
             }
             break;
         case 'extra':
             if (isset($this->_data['extra'])) {
                 if (!is_array($this->_data['extra'])) {
                     $this->_data['extra'] = unserialize($this->_data['extra']);
                 }
                 return $this->_data['extra'];
             }
             break;
         case 'options':
             $extra = $this->extra;
             if (is_array($extra) && isset($extra['options'])) {
                 return $extra['options'];
             }
             break;
         case 'displayvalue':
             if (!$this->_displayvalue) {
                 if (isset($this->_data['value'])) {
                     $value = $this->_data['value'];
                     $this->_displayvalue = $value;
                     if ($this->type == 'dropdown') {
                         // dropdowns may have a different displayvalue than actual value.
                         if (is_array($this->options) && isset($this->options[$value])) {
                             $this->_displayvalue = $this->options[$value];
                         }
                     }
                 }
             }
             return $this->_displayvalue;
             break;
         case 'fielddef_id':
             return $this->_data['id'];
     }
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:53,代码来源:class.news_field.php

示例4: _get_canonical

 private function _get_canonical()
 {
     if (!isset($this->_meta['canonical'])) {
         $tmp = $this->news_url;
         if ($tmp == '') {
             $aliased_title = munge_string_to_url($this->title);
             $tmp = 'news/' . $this->id . '/' . $this->returnid . "/{$aliased_title}";
         }
         $mod = cms_utils::get_module('News');
         $canonical = $mod->create_url($this->_inid, 'detail', $this->returnid, $this->params, false, false, $tmp);
         $this->_meta['canonical'] = $canonical;
     }
     return $this->_meta['canonical'];
 }
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:14,代码来源:class.news_article.php

示例5: __get

 public function __get($key)
 {
     switch ($key) {
         case 'alias':
             $alias = munge_string_to_url($this->name);
             return $alias;
         case 'id':
         case 'name':
         case 'type':
         case 'max_length':
         case 'create_date':
         case 'modified_date':
         case 'item_order':
         case 'public':
         case 'value':
             return $this->_data[$key];
     }
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:18,代码来源:class.news_field.php

示例6: is_valid_url

 /**
  * A utility function to test if the supplied url path is valid for the supplied content id
  *
  * @param string The partial url path to test
  * @return boolean
  */
 public static function is_valid_url($url, $content_id = '')
 {
     // check for starting or ending slashes
     if (startswith($url, '/') || endswith($url, '/')) {
         return FALSE;
     }
     // first check for invalid chars.
     $translated = munge_string_to_url($url, false, true);
     if (strtolower($translated) != strtolower($url)) {
         return FALSE;
     }
     cms_route_manager::load_routes();
     $route = cms_route_manager::find_match($url);
     if (!$route) {
         return TRUE;
     }
     if ($route->is_content()) {
         if ($content_id == '' || $route->get_content() == $content_id) {
             return TRUE;
         }
     }
     return FALSE;
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:29,代码来源:class.content_assistant.php

示例7: array

#
#-------------------------------------------------------------------------------
if (!is_object(cmsms())) {
    exit;
}
if (!$this->CheckPermission('Manage AdvancedContent MultiInputs')) {
    return $this->DisplayErrorPage($id, $returnid, $this->Lang('error_permissions'));
}
if (isset($params['cancel'])) {
    $this->Redirect($id, 'defaultadmin', $returnid, array('active_tab' => 'multi_input'));
}
$error = false;
$errormessage = '';
$input_id = '';
if (isset($params['input_id']) && !empty($params['input_id'])) {
    $input_id = preg_replace('/-+/', '_', munge_string_to_url(trim($params['input_id'])));
}
$multi_input = ac_admin_ops::GetMultiInputFull($input_id);
if (isset($params['input_fields'])) {
    $multi_input[$input_id]['input_fields'] = trim($params['input_fields']);
}
if (isset($params['input_tpl'])) {
    $multi_input[$input_id]['tpl_name'] = $params['input_tpl'];
}
### do action ##################################################################
if (isset($params['submit'])) {
    if ($input_id == '') {
        $error = true;
        $errormessage .= $this->lang('error_input_id') . '<br />';
    }
    if ($multi_input[$input_id]['input_fields'] == '') {
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:31,代码来源:action.editMultiInput.php

示例8: trim

    $module->SetError($this->Lang('error_missingparam'));
    $module->RedirectToTab($id, $this->_current_tab, '', $the_action);
    return;
}
if (isset($params['cancel'])) {
    $module->_current_tab = $this->_current_tab;
    $module->RedirectToTab($id, $this->_current_tab, '', $the_action);
}
$template = "";
if (isset($params['template'])) {
    $template = trim($params['template']);
    if ($template == '' || !preg_match('/^[a-zA-Z0-9\\_]+$/', $template)) {
        $module->SetError($this->Lang('error_templatenamebad'));
        $module->RedirectToTab($id, $this->_current_tab, '', $the_action);
    }
    $template = munge_string_to_url(trim($template));
}
$prefix = "";
if (isset($params['prefix'])) {
    $prefix = trim($params['prefix']);
}
if (!isset($params['templatecontent']) || empty($params['templatecontent'])) {
    $module->SetError($this->Lang('error_missingparam'));
    $module->RedirectToTab($id, $this->_current_tab, '', $the_action);
    return;
}
if ($template == "" || $prefix == "") {
    $module->SetError($this->Lang('error_missingparam'));
    $module->RedirectToTab($id, $this->_current_tab, '', $the_action);
    return;
}
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:31,代码来源:action.do_addtemplate.php

示例9: array

#
#-------------------------------------------------------------------------------
if (!is_object(cmsms())) {
    exit;
}
if (!$this->CheckPermission('Manage AdvancedContent MultiInput Templates')) {
    return $this->DisplayErrorPage($id, $returnid, $this->Lang('error_permissions'));
}
if (isset($params['cancel'])) {
    $this->Redirect($id, 'defaultadmin', $returnid, array('active_tab' => 'multi_input_tpl'));
}
$error = false;
$errormessage = '';
$tpl_name = '';
if (isset($params['tpl_name']) && !empty($params['tpl_name'])) {
    $tpl_name = preg_replace('/-+/', '_', munge_string_to_url(trim($params['tpl_name'])));
}
$template = '';
if (isset($params['template'])) {
    $template = trim($params['template']);
}
### do action ##################################################################
if (isset($params['submit'])) {
    if ($tpl_name == '') {
        $error = true;
        $errormessage .= $this->lang('error_tpl_name') . '<br />';
    }
    if ($template == '') {
        $error = true;
        $errormessage .= $this->lang('error_template') . '<br />';
    }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:31,代码来源:action.addMultiInputTpl.php

示例10: expand_events

 public static function expand_events($eventids, $returnid, $parameters, $limit = 10000, $startoffset = 0)
 {
     if (!is_array($eventids) || count($eventids) < 1) {
         return FALSE;
     }
     $module = cge_utils::get_module(MOD_CGCALENDAR);
     $gCms = CmsApp::get_instance();
     $db = $gCms->GetDb();
     $events_to_categories_table_name = $module->events_to_categories_table_name;
     $categories_table_name = $module->categories_table_name;
     $event_field_values_table_name = $module->event_field_values_table_name;
     $userops = $gCms->GetUserOperations();
     $tmp = $userops->LoadUsers();
     $users = array();
     foreach ($tmp as $oneuser) {
         $users[$oneuser->id] = $oneuser;
     }
     $query = 'SELECT * FROM ' . $module->events_table_name . ' WHERE event_id IN (' . implode(',', $eventids) . ')
               ORDER BY event_date_start ASC';
     $rs = $db->SelectLimit($query, $limit, $startoffset);
     $feu_users = array();
     while (!$rs->EOF()) {
         $row = $rs->fields;
         $uid = $row['event_created_by'];
         if ($uid < 1 && !in_array($uid, $feu_users)) {
             $feu_users[] = $uid;
         }
         $rs->MoveNext();
     }
     debug_display($feu_users);
     die;
     $rs->MoveFirst();
     $events = array();
     while ($rs && ($row = $rs->FetchRow())) {
         $titleSEO = munge_string_to_url($row['event_title']);
         $destpage = $module->GetPreference('defaultcalendarpage', -1);
         $destpage = $destpage > 0 ? $destpage : $returnid;
         //$destpage =$detailpage!=''?$detailpage:$destpage;
         $prefix = $module->GetPreference('url_prefix');
         if (!$prefix) {
             $prefix = 'calendar';
         }
         $prettyurl = sprintf($prefix . "/%d/%d-%s", $destpage, $row['event_id'], $titleSEO);
         $parms = array();
         $parms['event_id'] = $row['event_id'];
         $parms['display'] = 'event';
         if (isset($parameters['eventtemplate'])) {
             $parms['eventtemplate'] = $parameters['eventtemplate'];
         }
         $url = $module->CreateLink('cntnt01', 'default', $destpage, $contents = '', $parms, '', true, '', '', '', $prettyurl);
         $row['url'] = $url;
         $row['author'] = $users[$row['event_created_by']]->username;
         $row['authorname'] = $users[$row['event_created_by']]->firstname . ' ' . $users[$row['event_created_by']]->lastname;
         // Build the sql to retrieve the categories for this event.
         $sql = "SELECT category_name FROM {$events_to_categories_table_name}\n\t        INNER JOIN {$categories_table_name} ON  {$events_to_categories_table_name}.category_id = {$categories_table_name}.category_id\n\t        WHERE event_id = ?";
         $crs = $db->Execute($sql, array($row['event_id']));
         // Get the field values
         $categories = array();
         $categories_temp = array();
         if ($crs) {
             // make sure there are results and assign to the $categories array
             $categories_temp = $crs->GetArray();
             foreach ($categories_temp as $category) {
                 $category_name = $category['category_name'];
                 $categories[$category_name] = '1';
             }
         }
         // Attach the custom fields to the event
         $row['categories'] = $categories;
         // Build the sql to retrieve the field values for this event.
         $sql = "SELECT field_name,field_value FROM {$event_field_values_table_name} WHERE event_id = ?";
         $frs = $db->Execute($sql, array($row['event_id']));
         // Get the field values
         $fields = array();
         $fields_temp = array();
         if ($frs) {
             // make sure there are results and assign to the $fields array
             $fields_temp = $frs->GetArray();
             foreach ($fields_temp as $field) {
                 $field_name = $field['field_name'];
                 $field_value = $field['field_value'];
                 $fields[$field_name] = $field_value;
             }
         }
         // Attach the custom fields to the event
         $row['fields'] = $fields;
         // End custom fields retrieval
         // and add it to the list of completed, expanded events.
         $events[] = $row;
     }
     if ($rs) {
         $rs->Close();
     }
     return $events;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:95,代码来源:class.cgcalendar_utils.php

示例11: cms_db_prefix

    $query = "SELECT fileid, filepath FROM " . cms_db_prefix() . "module_gallery WHERE galleryid=?";
    $result = $db->Execute($query, array($params['gid']));
    if ($result && $result->RecordCount() > 0) {
        while ($row = $result->FetchRow()) {
            Gallery_utils::DeleteFiles(str_replace('/', DIRECTORY_SEPARATOR, '../' . DEFAULT_GALLERYTHUMBS_PATH), $row['fileid'] . '-*', false);
            $filepath = $row['filepath'];
        }
        $filepath .= $filepath != '' ? '/' : '';
        Gallery_utils::DeleteFiles(str_replace('/', DIRECTORY_SEPARATOR, '../' . DEFAULT_GALLERY_PATH . $filepath), IM_PREFIX . '*', false);
    }
    if ($result) {
        $params['module_message'] = $this->Lang('thumbsdeleted') . ' ' . $this->Lang('thumbsrecreated');
    }
} elseif (isset($params['directoryname'])) {
    // cleanup the directoryname, see reference-arrays in lib/replacement.php
    $params['directoryname'] = munge_string_to_url($params['directoryname']);
    // add subgallery
    if (empty($params['directoryname'])) {
        $params['module_error'] = $this->Lang('error_directorynameinvalid');
        $this->Redirect($id, 'editgallery', '', $params);
        exit;
    }
    $params['gid'] = $params['moveto'];
    $galleryinfo = Gallery_utils::Getgalleryinfobyid($params['gid']);
    $gallerypath = $galleryinfo['filepath'] . $galleryinfo['filename'];
    if (is_dir($gallerypath . $params['directoryname'])) {
        $params['module_error'] = $this->Lang('error_directoryalreadyexists');
        $this->Redirect($id, 'editgallery', '', $params);
        exit;
    } else {
        if (!mkdir('../' . DEFAULT_GALLERY_PATH . $gallerypath . $params['directoryname'])) {
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:31,代码来源:action.do_editgallery.php

示例12: trim

            $output = trim($method($params, cmsms()->GetSmarty()));
        } else {
            if (!function_exists('smarty_cms_function_content') && !function_exists('smarty_function_content')) {
                require_once $config['root_path'] . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'function.content.php';
            }
            $method = function_exists('smarty_cms_function_content') ? 'smarty_cms_function_content' : 'smarty_function_content';
            $output = trim($method($params, cmsms()->GetSmarty()));
        }
    }
    if (!isset($params['no_output']) || ac_utils::IsFalse($params['no_output'])) {
        echo $output;
    }
    return;
}
$output = '';
$block = isset($params['block']) ? preg_replace('/-+/', '_', munge_string_to_url($params['block'])) : 'content_en';
$id = '';
$modulename = '';
$action = '';
$inline = false;
if (isset($_REQUEST['module'])) {
    $modulename = $_REQUEST['module'];
}
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
} elseif (isset($_REQUEST['mact'])) {
    $ary = explode(',', cms_htmlentities($_REQUEST['mact']), 4);
    $modulename = isset($ary[0]) ? $ary[0] : '';
    $id = isset($ary[1]) ? $ary[1] : '';
    $action = isset($ary[2]) ? $ary[2] : '';
    $inline = isset($ary[3]) && $ary[3] == 1 ? true : false;
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:31,代码来源:action.default.php

示例13: print_r

// get the individual reviews.
$dbr = $db->SelectLimit($query, $pagelimit, $startoffset, $qparms);
if (!$dbr) {
    echo "DEBUG SUMMARY QUERY: SQL FAILED<br/>";
    echo "QUERY: " . $db->sql . '<br/>';
    echo "MESSAGE: " . $db->ErrorMsg() . '<br/>';
    echo "SQUERY: " . $query . '<br/>';
    print_r($qparms);
    die;
}
$parms = $params;
$parms['feedback_origpage'] = $returnid;
$data = array();
while ($dbr && ($row = $dbr->FetchRow())) {
    $prettyurl = "feedback/detail/{$row['id']}/{$detailpage}/";
    $prettyurl .= munge_string_to_url(substr($row['title'], 0, 30));
    $parms['cid'] = $row['id'];
    $row['detail_url'] = $this->CreateURL($id, 'detail', $detailpage, $parms, 0, $prettyurl);
    $sql = 'SELECT * FROM ' . CGFEEDBACK_TABLE_FIELDVALS . ' WHERE comment_id = ?';
    $tmp = $db->GetArray($sql, array($row['id']));
    if (is_array($tmp) && is_array($fields)) {
        for ($i = 0; $i < count($tmp); $i++) {
            $tmp[$i] = array_merge($tmp[$i], $fields[$tmp[$i]['field_id']]);
        }
        $row['fields'] = cge_array::to_hash($tmp, 'name');
    }
    $tmp = $fields;
    $data[] = $row;
}
#
# Give everything to smarty
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:31,代码来源:action.summary.php

示例14: _register_content_block

 private function _register_content_block(&$contentBlock)
 {
     $AdvancedContent =& cms_utils::get_module('AdvancedContent');
     if ($contentBlock->GetBlockProperty('type') != '') {
         $this->_blockTypes[$contentBlock->GetBlockProperty('type')]['content_blocks'][$contentBlock->GetBlockProperty('id')] = $contentBlock->GetBlockProperty('id');
         $this->_blockTypes[$contentBlock->GetBlockProperty('type')]['header_html_called'] = false;
         if ($this->_cms_access == 'backend') {
             # this block has been added to the template after page has been created?
             if (!in_array($contentBlock->GetBlockProperty('id'), $this->mProperties->mPropertyNames)) {
                 $contentBlock->SetBlockProperty('new_block', true);
             }
             $pageTab = preg_replace('/-+/', '_', munge_string_to_url(strtolower(trim($contentBlock->GetBlockProperty('page_tab')))));
             if (!isset($this->_pageTabs[$pageTab])) {
                 $this->_pageTabs[$pageTab]['tab_id'] = $pageTab;
                 $this->_pageTabs[$pageTab]['tab_name'] = $contentBlock->GetBlockProperty('page_tab');
                 $this->_pageTabs[$pageTab]['block_tabs'] = array();
                 $this->_pageTabs[$pageTab]['block_groups'] = array();
                 $contentBlock->SetBlockProperty('page_tab', $pageTab);
             }
             $this->_pageTabs[$pageTab]['content_blocks'][$contentBlock->GetBlockProperty('id')] = $contentBlock->GetBlockProperty('id');
             $blockTab = '';
             if ($contentBlock->GetBlockProperty('block_tab') != '') {
                 $blockTab = $pageTab . '_' . preg_replace('/-+/', '_', munge_string_to_url(strtolower(trim($contentBlock->GetBlockProperty('block_tab')))));
                 if (!isset($this->_blockTabs[$blockTab])) {
                     $this->_blockTabs[$blockTab]['tab_id'] = $blockTab;
                     $this->_blockTabs[$blockTab]['tab_name'] = $contentBlock->GetBlockProperty('block_tab');
                     $this->_blockTabs[$blockTab]['block_groups'] = array();
                 }
                 $this->_blockTabs[$blockTab]['content_blocks'][$contentBlock->GetBlockProperty('id')] = $contentBlock->GetBlockProperty('id');
                 $this->_pageTabs[$pageTab]['block_tabs'][$blockTab] = $blockTab;
                 $contentBlock->SetBlockProperty('block_tab', $blockTab);
             }
             $blockGroup = '';
             if ($contentBlock->GetBlockProperty('block_group') != '') {
                 $blockGroup = ($blockTab ? $blockTab : $pageTab) . '_' . preg_replace('/-+/', '_', munge_string_to_url(strtolower(trim($contentBlock->GetBlockProperty('block_group')))));
                 if (!isset($this->_blockGroups[$blockGroup])) {
                     $this->_blockGroups[$blockGroup]['group_id'] = $blockGroup;
                     $this->_blockGroups[$blockGroup]['group_name'] = $contentBlock->GetBlockProperty('block_group');
                     $this->_blockGroups[$blockGroup]['collapsible'] = $contentBlock->GetBlockProperty('collapsible');
                     if (!$this->_blockGroups[$blockGroup]['collapsible']) {
                         $this->_blockGroups[$blockGroup]['collapse'] = false;
                     } else {
                         $this->_blockGroups[$blockGroup]['collapse'] = $AdvancedContent->GetPreference('collapse_group_default', 1);
                     }
                     $this->_pageTabs[$pageTab]['block_groups'][$blockGroup] = $blockGroup;
                 }
                 $this->_blockGroups[$blockGroup]['content_blocks'][$contentBlock->GetBlockProperty('id')] = $contentBlock->GetBlockProperty('id');
                 unset($this->_blockTabs[$blockTab]['content_blocks'][$contentBlock->GetBlockProperty('id')]);
                 if ($blockTab) {
                     $this->_blockTabs[$blockTab]['block_groups'][$blockGroup] = $blockGroup;
                 } else {
                     unset($this->_blockTabs[$blockTab]['block_groups'][$blockGroup]);
                 }
                 $contentBlock->SetBlockProperty('block_group', $blockGroup);
             }
         }
         #$AdvancedContent =& cms_utils::get_module('AdvancedContent');
         #$AdvancedContent->SetAllowedParam($contentBlock->GetBlockProperty('id'), CLEAN_NONE);
         #foreach($contentBlock->GetBlockProperties() as $paramName => $paramValue)
         #{
         #	if(is_string($paramValue))
         #	{
         #		$AdvancedContent->SetAllowedParam($paramName, CLEAN_STRING);
         #		continue;
         #	}
         #	if(is_bool($paramValue) || is_int($paramValue))
         #	{
         #		$AdvancedContent->SetAllowedParam($paramName, CLEAN_INT);
         #		continue;
         #	}
         #	if(is_float($paramValue) || is_double($paramValue))
         #	{
         #		$AdvancedContent->SetAllowedParam($paramName, CLEAN_FLOAT);
         #		continue;
         #	}
         #	$AdvancedContent->SetAllowedParam($paramName, CLEAN_NONE);
         #}
         $this->_blockTypes[$contentBlock->GetBlockProperty('type')]['props'] = $contentBlock->GetBlockTypeProperties($this->_cms_access);
         $this->AddExtraProperty($contentBlock->GetBlockProperty('id'));
         #if($contentBlock->GetBlockProperty('inherit'))
         #{
         #	$this->_inheritables[$contentBlock->GetBlockProperty('id')] = -1;
         #	$this->SetPropertyValueNoLoad($contentBlock->GetBlockProperty('id'), -1);
         #}
     }
     $this->_contentBlocks[$contentBlock->GetBlockProperty('id')] = $contentBlock;
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:87,代码来源:contenttype.Content2.php

示例15: munge_string_to_url

    $this->Redirect($id, $the_action, $returnid, $params);
    return;
}
$module = $this->GetModuleInstance($params['modname']);
if (!$module) {
    $params['errors'] = $this->Lang('error_insufficientparams');
    $this->Redirect($id, $the_action, $returnid, $params);
    return;
}
if (isset($params['cancel'])) {
    $module->_current_tab = $this->_current_tab;
    $module->RedirectToTab($id, $this->_current_tab, '', $the_action);
}
$template = "";
if (isset($params['template'])) {
    $template = munge_string_to_url(trim($params['template']));
}
$prefix = "";
if (isset($params['prefix'])) {
    $prefix = trim($params['prefix']);
}
if (!isset($params['templatecontent'])) {
    $params['errors'] = $this->Lang('error_insufficientparams');
    $module->Redirect($id, $params['origaction'], '', $params);
    return;
}
if ($template == "" || $prefix == "") {
    $params['errors'] = $this->Lang('error_insufficientparams');
    $module->Redirect($id, $params['origaction'], '', $params);
    return;
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:31,代码来源:action.do_addtemplate.php


注:本文中的munge_string_to_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。