• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP munge_string_to_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: postprocess

 public function postprocess($html)
 {
     $smarty = cmsms()->GetSmarty();
     $otd = $smarty->template_dir;
     $smarty->template_dir = dirname(__FILE__) . '/templates';
     $module_help_type = $this->get_value('module_help_type');
     // get a page title
     $title = $this->get_value('pagetitle');
     $alias = $this->get_value('pagetitle');
     if ($title) {
         if (!$module_help_type) {
             // if not doing module help, translate the string.
             $extra = $this->get_value('extra_lang_params');
             if (!$extra) {
                 $extra = array();
             }
             $title = lang($title, $extra);
         }
     } else {
         // no title, get one from the breadcrumbs.
         $bc = $this->get_breadcrumbs();
         if (is_array($bc) && count($bc)) {
             $title = $bc[count($bc) - 1]['title'];
         }
     }
     // page title and alias
     $smarty->assign('pagetitle', $title);
     $smarty->assign('pagealias', munge_string_to_url($alias));
     // module name?
     if ($module_name = $this->get_value('module_name')) {
         $smarty->assign('module_name', $module_name);
     }
     // module icon?
     if ($module_icon_url = $this->get_value('module_icon_url')) {
         $smarty->assign('module_icon_url', $module_icon_url);
     }
     // module_help_url
     if (!get_preference(get_userid(), 'hide_help_links', 0)) {
         if ($module_help_url = $this->get_value('module_help_url')) {
             $smarty->assign('module_help_url', $module_help_url);
         }
     }
     // if bookmarks
     if (get_preference(get_userid(), 'bookmarks')) {
         $marks = $this->get_bookmarks();
         $smarty->assign('marks', $marks);
     }
     $headtext = $this->get_value('headertext');
     $smarty->assign('headertext', $headtext);
     // and some other common variables,.
     $smarty->assign('content', str_replace('</body></html>', '', $html));
     $smarty->assign('config', cmsms()->GetConfig());
     $smarty->assign('theme', $this);
     $smarty->assign('secureparam', CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]);
     $userops = cmsms()->GetUserOperations();
     $smarty->assign('user', $userops->LoadUserByID(get_userid()));
     // get user selected language
     $smarty->assign('lang', get_preference(get_userid(), 'default_cms_language'));
     // get language direction
     $lang = CmsNlsOperations::get_current_language();
     $info = CmsNlsOperations::get_language_info($lang);
     $smarty->assign('lang_dir', $info->direction());
     if (is_array($this->_errors) && count($this->_errors)) {
         $smarty->assign('errors', $this->_errors);
     }
     if (is_array($this->_messages) && count($this->_messages)) {
         $smarty->assign('messages', $this->_messages);
     }
     $_contents = $smarty->fetch('pagetemplate.tpl');
     $smarty->template_dir = $otd;
     return $_contents;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:72,代码来源:OneElevenTheme.php


示例17: get_events

 public function get_events()
 {
     $gCms = cmsms();
     $sorting = $this->_reverse ? 'DESC' : 'ASC';
     $query = 'SELECT * FROM ' . cms_db_prefix() . 'module_cgcalendar_events WHERE event_id IN (';
     $query .= implode(',', $this->_idlist) . ')';
     $query .= " ORDER BY event_date_start {$sorting}";
     $db = cmsms()->GetDb();
     // get the parent ids and events.
     $events = $db->GetArray($query);
     $parent_ids = $this->_idlist;
     if (!is_array($events) || count($events) == 0) {
         return;
     }
     foreach ($events as $row) {
         if ($row['event_parent_id'] > 0) {
             $parent_ids[] = $row['event_parent_id'];
         }
     }
     $parent_ids = array_unique($parent_ids);
     $customfields = array();
     $query = 'SELECT * FROM ' . cms_db_prefix() . 'module_cgcalendar_event_field_values
             WHERE event_id IN (' . implode(',', $parent_ids) . ') ORDER BY event_id';
     $frs = $db->GetArray($query);
     foreach ($frs as $row) {
         $customfields[$row['event_id']][] = $row;
     }
     $allcategories = array();
     $query = 'SELECT * FROM ' . cms_db_prefix() . 'module_cgcalendar_events_to_categories
                    WHERE event_id IN (' . implode(',', $this->_idlist) . ') ORDER BY event_id';
     $crs = $db->Execute($query);
     while ($crs && !$crs->EOF()) {
         $row = $crs->fields;
         $allcategories[$row['event_id']][] = $row;
         $crs->MoveNext();
     }
     if (count($allcategories)) {
         \CGCalendar\category::get_categories();
     }
     // forces preload.
     $users = array();
     $userops = $gCms->GetUserOperations();
     $userlist = $userops->LoadUsers();
     foreach ($userlist as $oneuser) {
         $users[$oneuser->id] = $oneuser;
     }
     $module = cms_utils::get_module('CGCalendar');
     foreach ($events as &$row) {
         $titleSEO = munge_string_to_url($row['event_title']);
         $prettyurl = sprintf($this->_url_prefix . '/%d/%d-%s', $this->_destpage, $row['event_id'], $titleSEO);
         $parms = array();
         $parms['event_id'] = $row['event_id'];
         $parms['display'] = 'event';
         if ($this->_eventtemplate) {
             $parms['eventtemplate'] = $this->_eventtemplate;
         }
         $row['url'] = $module->create_url($this->_actionid, 'default', $this->_destpage, $parms, false, false, $prettyurl);
         $ptr = null;
         if (isset($allcategories[$row['event_id']])) {
             $ptr = $allcategories[$row['event_id']];
         } else {
             if ($row['event_parent_id'] > 0 && isset($allcategories[$row['event_parent_id']])) {
                 $ptr = $allcategories[$row['event_parent_id']];
             }
         }
         $row['bgcolor'] = $row['fgcolor'] = null;
         if ($ptr) {
             $categories = array();
             foreach ($ptr as $cat) {
                 $categories[] = $cat['category_id'];
                 if (!$row['bgcolor']) {
                     // get colors for this event...
                     $cat_obj = \CGCalendar\category::load($cat['category_id']);
                     $row['fgcolor'] = $cat_obj['fgcolor'];
                     $row['bgcolor'] = $cat_obj['bgcolor'];
                 }
             }
             $row['categories'] = $categories;
             $row['category_names'] = $module->GetCategoryNames($categories);
         }
         $ptr = null;
         if (isset($customfields[$row['event_id']])) {
             $ptr = $customfields[$row['event_id']];
         } else {
             if ($row['event_parent_id'] > 0 && isset($customfields[$row['event_parent_id']])) {
                 $ptr = $customfields[$row['event_parent_id']];
             }
         }
         if ($ptr) {
             $fields = array();
             $fieldinfo = array();
             foreach ($ptr as $key => $rec) {
                 $fields[$rec['field_name']] = $rec['field_value'];
                 $fieldinfo[$rec['field_name']] = $rec;
             }
             $row['fields'] = $fields;
             // deprecated
             $row['fieldinfo'] = $fieldinfo;
         }
         if ($row['event_created_by'] < 0) {
//.........这里部分代码省略.........
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:101,代码来源:class.cgc_event_loader.php


示例18: SearchResult

 function SearchResult($returnid, $event_id, $attr = '')
 {
     $result = array();
     if ($attr != 'event') {
         return $result;
     }
     $db = $this->GetDb();
     $query = 'SELECT event_title FROM ' . $this->events_table_name . ' WHERE event_id = ?';
     $title = $db->GetOne($query, array($event_id));
     $result[0] = $this->GetFriendlyName();
     $result[1] = $title;
     $titleSEO = munge_string_to_url($title);
     $destpage = $this->GetPreference('defaultcalendarpage', -1);
     $destpage = $destpage != -1 ? $destpage : $returnid;
     $destpage = $detailpage != '' ? $detailpage : $destpage;
     $prefix = $this->GetPreference('url_prefix');
     if (!$prefix) {
         $prefix = 'calendar';
     }
     $prettyurl = sprintf($prefix . "/%d/%d-%s", $destpage, $event_id, $titleSEO);
     $result[2] = $this->CreateLink($id, 'default', $destpage, '', array('event_id' => $event_id, 'display' => 'event', 'detailpage' => $destpage, 'return_id' => $returnid), '', true, '', '', $prettyurl);
     return $result;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:23,代码来源:CGCalendar.module.php


示例19: cms_db_prefix

    $simpletypes[] = $typeid;
}
if (isset($_POST["addaliases"])) {
    //$contentops->SetAllHierarchyPositions();
    $count = 0;
    $query = "SELECT * FROM " . cms_db_prefix() . "content";
    $allcontent = $db->Execute($query);
    while ($contentpiece = $allcontent->FetchRow()) {
        $content_id = $contentpiece["content_id"];
        if (trim($contentpiece["content_alias"]) == '' && $contentpiece['type'] != 'separator') {
            $alias = trim($contentpiece["menu_text"]);
            if ($alias == '') {
                $alias = trim($contentpiece["content_name"]);
            }
            $tolower = true;
            $alias = munge_string_to_url($alias, $tolower);
            if ($contentops->CheckAliasError($alias, $content_id)) {
                $alias_num_add = 2;
                // If a '-2' version of the alias already exists
                // Check the '-3' version etc.
                while ($contentops->CheckAliasError($alias . '-' . $alias_num_add) !== FALSE) {
                    $alias_num_add++;
                }
                $alias .= '-' . $alias_num_add;
            }
          

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP murl函数代码示例发布时间:2022-05-15
下一篇:
PHP multiply函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap