本文整理汇总了PHP中cmsFramework::StringTransliterate方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsFramework::StringTransliterate方法的具体用法?PHP cmsFramework::StringTransliterate怎么用?PHP cmsFramework::StringTransliterate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsFramework
的用法示例。
在下文中一共展示了cmsFramework::StringTransliterate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
//.........这里部分代码省略.........
}
} else {
// It's a clean install so we use the whole jReviews sql file
$sql_file = S2Paths::get('jreviews', 'S2_APP') . 'upgrades' . DS . 'jreviews.sql';
$action['db_install'] = $this->__parseMysqlDump($sql_file, $dbprefix);
}
# Update component id in pre-existing jReviews menus
if ($this->cmsVersion == CMS_JOOMLA16) {
$query = "\n SELECT \n extension_id AS id\n FROM \n #__extensions \n WHERE \n element = '" . S2Paths::get('jreviews', 'S2_CMSCOMP') . "' AND type = 'component'\n ";
} else {
$query = "\n SELECT \n id \n FROM \n #__components \n WHERE \n admin_menu_link = 'option=" . S2Paths::get('jreviews', 'S2_CMSCOMP') . "'\n ";
}
$this->_db->setQuery($query);
if ($id = $this->_db->loadResult()) {
if ($this->cmsVersion == CMS_JOOMLA16) {
$query = "\n UPDATE \n `#__menu` \n SET \n component_id = {$id} \n WHERE \n type IN ('component','components') \n AND \n link LIKE 'index.php?option=" . S2Paths::get('jreviews', 'S2_CMSCOMP') . "%'\n ";
} else {
$query = "\n UPDATE \n `#__menu` \n SET \n componentid = {$id} \n WHERE \n type IN ('component','components') \n AND \n link = 'index.php?option=" . S2Paths::get('jreviews', 'S2_CMSCOMP') . "'\n ";
}
$this->_db->setQuery($query);
$this->_db->query();
}
# Update version number in the database
$this->Config->version = $new_version;
$this->Config->store();
$action['plugin_install'] = $this->_installPlugin();
# Create image upload and thumbnail folders
if (!is_dir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS)) {
$Config = new JConfig();
if (isset($Config->ftp_enable) && $Config->ftp_enable) {
// set up basic connection
$conn_id = ftp_connect($Config->ftp_host, $Config->ftp_port);
// login with username and password
$login_result = ftp_login($conn_id, $Config->ftp_user, $Config->ftp_pass);
ftp_chdir($conn_id, $Config->ftp_root);
ftp_mkdir($conn_id, _JR_PATH_IMAGES . 'jreviews');
ftp_mkdir($conn_id, _JR_PATH_IMAGES . 'jreviews' . DS . 'tn');
ftp_close($conn_id);
@copy(PATH_ROOT . _JR_PATH_IMAGES . 'index.html', PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'index.html');
@copy(PATH_ROOT . _JR_PATH_IMAGES . 'index.html', PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'tn' . DS . 'index.html');
}
}
if (!is_dir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS)) {
$result = mkdir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS, 0755);
if (!$result) {
$action['thumbnail_dir'] = false;
} else {
@copy(PATH_ROOT . _JR_PATH_IMAGES . 'index.html', PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'index.html');
$result = mkdir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'tn', 0755);
if (!$result) {
$action['thumbnail_dir'] = false;
} else {
@copy(PATH_ROOT . _JR_PATH_IMAGES . 'index.html', PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'tn' . DS . 'index.html');
}
}
}
if (!is_dir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'tn' . DS)) {
$result = mkdir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'tn', 0755);
if (!$result) {
$action['thumbnail_dir'] = false;
} else {
@copy(PATH_ROOT . _JR_PATH_IMAGES . 'index.html', PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'tn' . DS . 'index.html');
}
}
if (is_dir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS) && is_dir(PATH_ROOT . _JR_PATH_IMAGES . 'jreviews' . DS . 'tn' . DS)) {
$action['thumbnail_dir'] = true;
}
# Ensure that all field group names are slugs
$query = "\n SELECT \n groupid, name\n FROM\n #__jreviews_groups\n ";
$this->_db->setQuery($query);
$groups = $this->_db->loadAssocList();
if (!empty($groups)) {
foreach ($groups as $group) {
if (strpos($group['name'], ' ') !== false) {
$name = cmsFramework::StringTransliterate($group['name']) . $group['groupid'];
$query = "\n UPDATE\n #__jreviews_groups\n SET \n name = " . $this->quote($name) . "\n WHERE\n groupid = " . $group['groupid'];
$this->_db->setQuery($query);
$this->_db->query();
}
}
}
# Clear data and core caches
clearCache('', '__data');
clearCache('', 'core');
//var_dump($action);
if (Sanitize::getString($this->params, 'task') == 'upgrade') {
$response = array('error' => false, 'html' => '');
// {"db_install":true,"plugin_install":true,"thumbnail_dir":true}
if (!$action['db_install']) {
$response['error'] = true;
$response['html'] = '<div style="color:red>There was a problem upgrading the database</div>';
}
if (!$action['plugin_install']) {
$response['error'] = true;
$response['html'] .= '<div style="color:red>There was a problem upgrading the JReviews plugin</div>';
}
return json_encode($response);
}
$this->set(array('action' => $action));
}