diff --git a/301-migrate.php b/301-migrate.php deleted file mode 100644 index 89514ad..0000000 --- a/301-migrate.php +++ /dev/null @@ -1,63 +0,0 @@ -initialize('web'); - -$stercseo = $modx->getService('stercseo', 'StercSEO', $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path').'components/stercseo/').'model/stercseo/', array()); - -if (!($stercseo instanceof StercSEO)) { - return; -} - -$output = array(); -$count = 0; -$site_url = $modx->getOption('site_url'); -$resources = $modx->getCollection('modResource', array('context_key:!=' => 'mgr')); -foreach ($resources as $resource) { - $context_key = $resource->get('context_key'); - $site_url_setting = $modx->getObject('modContextSetting', array('context_key' => $context_key, 'key' => 'site_url')); - if ($site_url_setting) { - $site_url = $site_url_setting->get('value'); - } - $base_url_setting = $modx->getObject('modContextSetting', array('context_key' => $context_key, 'key' => 'base_url')); - if ($base_url_setting) { - $base_url = $base_url_setting->get('value'); - } - if (isset($base_url) && !empty($base_url)) { - $site_url = str_replace($base_url, '/', $site_url); - } - $properties = $resource->getProperties('stercseo'); - foreach ($properties['urls'] as $urls) { - foreach ($urls as $url) { - $encoded_url = urlencode($site_url.ltrim($url, '/')); - $redirect = $modx->getObject('seoUrl', array('url' => $encoded_url)); - if (!$redirect) { - $redirect = $modx->newObject('seoUrl'); - $data = array( - 'url' => $encoded_url, - 'resource' => $resource->get('id'), - 'context_key' => $context_key, - ); - $redirect->fromArray($data); - $redirect->save(); - echo $context_key.' -- '.($site_url.$url).' >>>> '.$resource->get('uri').' -- Redirect added for resource '.$resource->get('id').'
'; - $count++; - } else { - echo $site_url.$url.' already exist for resource '.$resource->get('id').'
'; - } - } - } - // reset the urls in properties - unset($properties['urls']); - $resource->setProperties($properties, 'stercseo'); - $resource->save(); -} - -if ($count == 0) { - echo '
No 301 redirect urls found in resource properties.'; -} else { - echo '

-------------------------------

'; - echo $count.' Redirect urls migrated from resource properties to seoUrl object.'; -} diff --git a/301export.php b/301export.php deleted file mode 100644 index 1f50380..0000000 --- a/301export.php +++ /dev/null @@ -1,51 +0,0 @@ -initialize('web'); - -$stercseo = $modx->getService('stercseo', 'StercSEO', $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path').'components/stercseo/').'model/stercseo/', array()); - -if (!($stercseo instanceof StercSEO)) { - return; -} - -$output = array(); - -$contexts = $modx->getCollection('modContext', array('key:!=' => 'mgr')); -foreach ($contexts as $context) { - $name = $context->get('name'); - if ($name == '' || empty($name)) { - $name = $context->get('key'); - } - $site_url = $modx->getOption('site_url'); - - $resources = $modx->getCollection('modResource', array('context_key' => $context->get('key'))); - foreach ($resources as $resource) { - $context_key = $resource->get('context_key'); - $properties = $resource->getProperties('stercseo'); - foreach ($properties['urls'] as $urls) { - foreach ($urls as $url) { - // $redirect = $modx->newObject('seoUrl'); - // $data = array( - // 'url' => urlencode($site_url.$url), - // 'resource' => $resource->get('id'), - // 'context_key' => $context_key, - // ); - // $redirect->fromArray($data); - // $redirect->save(); - echo urlencode($site_url.$url).'
'; - } - } - - // $newProperties = array( - // 'follow' => $properties['follow'], - // 'sitemap' => $properties['sitemap'], - // 'priority' => $properties['priority'], - // 'changefreq' => $properties['changefreq'], - // ); - // $resource->setProperties($newProperties, 'stercseo'); - } -} diff --git a/README.md b/README.md index 38c3606..be19ef3 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,73 @@ -SEOTab -======== +# MODX SEO Tab - The best way to perform in search engines +![SEO Tab version](https://img.shields.io/badge/version-2.0.0-blue.svg) ![MODX Extra by Sterc](https://img.shields.io/badge/checked%20by-sterc-ff69b4.svg) ![MODX version requirements](https://img.shields.io/badge/modx%20version%20requirement-2.4%2B-brightgreen.svg) -Author: Sterc.nl +SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google. -Description: --------------------- -MODX SEOTab is a MODX package that helps you manage your pages in Google. It allows you to: -- Manage noindex, nofollow +### Key features of SEO Tab: +- Manage search engine visibility (noindex, nofollow) - Manage internal search engine behavior -- Manage your Google Sitemap +- Manage your Google XML Sitemap(s) - Manage 301 redirects -- Automatically generate 301 redirects when changing a resource URL from the resource itself +- Automatically generate 301 redirects when changing a resource URL +- Freeze URL functionality is moved into the SEO-tab -Bugs and Features: --------------------- -https://github.com/Sterc/SEOTab +## Installation +Simply install it through the top menu ```Extras > Installer``` and search for ```SEO Tab```. Install it from there. After installing it, it is recommended to clear your MODX cache, through the top menu ```Manage > Clear Cache```. + +## Upgrade risks +First of all: ALWAYS MAKE A BACKUP BEFORE UPDATING! Especially the modx_site_content database table in this case. + +Upgrading to 2.0.0 from 1.* is highly recommended, but it does introduce some risks. SEO Tab 1.* stored the 301 redirects into the properties-column of a resource. SEO Tab 2 stores it in a seperate database table. This means a migration is needed. The migration-process is memory-intensive and might take a very long time, so just let it roll until it mentions a finished migration. + +Possible problems (and solutions): +- Long migration-process because of many resources and redirects (think of 1000+ resource websites). Not really a problem, but if you have a big site, just plan your update at a low-traffic time, because redirects won't work 100% during the migration. +- A blank page with a 500 error. This usually is because of memory issues. Try to re-run the migration with a lower limit and queryLimit. It is currently set to limit:1000 and queryLimit=100. Try setting it to 500 and 50 in core/components/stercseo/processors/mgr/redirect/migrate.class.php +- If you somehow end up with an unfinished migration and the migration-notice is gone, you can fix it by setting the SystemSetting stercseo.migration_status to 0. + +## Usage +SEO Tab is automatically enabled after install. Don't forget to clear your cache. + +## Using the Google XML Sitemap +You have to manually create a resource within MODX, ```Template: (empty)```. go to the tab ```Settings``` and set ```Content Type: XML```, ```Cachable``` and ```Rich Text``` should be ticked off. In the content field, use the following code: + + +```HTML +[[!StercSeoSiteMap]] +``` + +The sitemap-snippet has multiple (all optional) properties. + +Property | Default value | Description +---|---|--- +contexts|web|Specify one or more contextKey's, separated by a comma. +allowSymlinks|0|Set this to ```1``` if you want to include symlinks in your sitemap. +outerTpl|sitemap/outertpl|Refer to a chunk here to change the outer template, which contains rows of rowTpl's (see below). +rowTpl|sitemap/rowtpl|Refer to a chunk here to change the rowTpl which is repeated for every resource which is included in the sitemap. + +An example of a sitemap-call with all properties set to a default-value would be: +```HTML +[[!StercSeoSiteMap? &contexts=`web` &allowSymlinks=`0` &outerTpl=`sitemap/outertpl` &rowTpl=`sitemap/rowtpl`]] +``` + +## Using the robots-tag +Within the tab ```SEO > Findability```, you can manage three options which determine the robots-tag. If you leave out a robots-tag and do not have a robots.txt in your website-root, the Search engine will use the following robots-tag: +```HTML + +``` + +The settings ```Include in search engines``` and ```Following links``` result in two placeholders which you can add to your template/chunks: + +```HTML + +``` + +If you set ```Include in search engines``` to ```no```, it will generate the following HTML: + +```HTML + +``` + +We add noopd,noydir by default, because we don't want the [Open Directory Project](http://www.dmoz.org/) and the Yahoo Directory (deprecated) to change how are pages are displayed within Google. + +## Bugs and feature requests +We greatly value your feedback, feature requests and bug reports. Please issue them on [Github](https://github.com/Sterc/SEOTab/issues/new). diff --git a/_build/config.json b/_build/config.json index 8db3b5d..aee8281 100644 --- a/_build/config.json +++ b/_build/config.json @@ -1,18 +1,19 @@ { "name": "StercSEO", "lowCaseName": "stercseo", - "description": "SEOTab is a MODX package that helps you manage your pages in Google.", + "description": "SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google.", "author": "Sterc", "version": "2.0.0-pl", "package":{ "menus": [{ "text": "stercseo.seotab", + "description": "stercseo.menu_desc", "action": "home" }], "elements": { "plugins": [{ "name": "StercSEO", - "description": "Plugin to render SEOTab and save all the data.", + "description": "Plugin to render SEO Tab and save all the data.", "file": "stercseo.plugin.php", "events": [ "OnDocFormPrerender", @@ -21,12 +22,14 @@ "OnPageNotFound", "OnResourceDuplicate", "OnManagerPageBeforeRender", - "OnResourceBeforeSort" + "OnResourceBeforeSort", + "OnDocFormSave", + "OnEmptyTrash" ] }], "snippets": [{ "name": "StercSeoSiteMap", - "description": "Outputs the sitemap based on the resource settings made in SEOTab", + "description": "Outputs the sitemap based on the resource settings made in SEO Tab", "file": "stercseositemap.snippet.php" }], "chunks": [], @@ -69,9 +72,31 @@ "key": "hide_from_usergroups", "value": "", "area": "general" + },{ + "key": "user_name", + "type": "textfield", + "area": "general", + "value": "" + }, { + "key": "user_email", + "type": "textfield", + "area": "general", + "value": "" }] }, "database": { "tables": ["seoUrl"] + }, + "build":{ + "resolver": { + "after": [ + "setupoptions.resolver.php", + "stercextra.resolver.php", + "uninstall.resolver.php" + ] + }, + "setupOptions":{ + "source": "setup.options.php" + } } } \ No newline at end of file diff --git a/_build/gpm_resolvers/gpm.resolve.tables.php b/_build/gpm_resolvers/gpm.resolve.tables.php index 117a883..c837548 100644 --- a/_build/gpm_resolvers/gpm.resolve.tables.php +++ b/_build/gpm_resolvers/gpm.resolve.tables.php @@ -1,29 +1,29 @@ -xpdo) { - $modx =& $object->xpdo; - switch ($options[xPDOTransport::PACKAGE_ACTION]) { - case xPDOTransport::ACTION_INSTALL: - case xPDOTransport::ACTION_UPGRADE: - $modelPath = $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path') . 'components/stercseo/') . 'model/'; - - $modx->addPackage('stercseo', $modelPath, null); - - - $manager = $modx->getManager(); - - $manager->createObjectContainer('seoUrl'); - - break; - } -} - +xpdo) { + $modx =& $object->xpdo; + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modelPath = $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path') . 'components/stercseo/') . 'model/'; + + $modx->addPackage('stercseo', $modelPath, null); + + + $manager = $modx->getManager(); + + $manager->createObjectContainer('seoUrl'); + + break; + } +} + return true; \ No newline at end of file diff --git a/_build/resolvers/setupoptions.resolver.php b/_build/resolvers/setupoptions.resolver.php new file mode 100644 index 0000000..3bebd94 --- /dev/null +++ b/_build/resolvers/setupoptions.resolver.php @@ -0,0 +1,47 @@ +xpdo->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.' . $key) + ); + + if ($settingObject) { + $settingObject->set('value', $options[$key]); + $settingObject->save(); + } else { + $error = '[' . $package . '] ' . strtolower($package) . '.' . $key . ' setting could not be found,'; + $error .= ' so the setting could not be changed.'; + + $object->xpdo->log( + xPDO::LOG_LEVEL_ERROR, + $error + ); + } + } + } + + $success = true; + break; + case xPDOTransport::ACTION_UNINSTALL: + $success = true; + break; +} + +return $success; diff --git a/_build/resolvers/stercextra.resolver.php b/_build/resolvers/stercextra.resolver.php new file mode 100644 index 0000000..e15619b --- /dev/null +++ b/_build/resolvers/stercextra.resolver.php @@ -0,0 +1,118 @@ +xpdo; +$c = $modx->newQuery('transport.modTransportPackage'); +$c->where( + array( + 'workspace' => 1, + "(SELECT + `signature` + FROM {$modx->getTableName('modTransportPackage')} AS `latestPackage` + WHERE `latestPackage`.`package_name` = `modTransportPackage`.`package_name` + ORDER BY + `latestPackage`.`version_major` DESC, + `latestPackage`.`version_minor` DESC, + `latestPackage`.`version_patch` DESC, + IF(`release` = '' OR `release` = 'ga' OR `release` = 'pl','z',`release`) DESC, + `latestPackage`.`release_index` DESC + LIMIT 1,1) = `modTransportPackage`.`signature`", + ) +); +$c->where( + array( + array( + 'modTransportPackage.package_name' => strtolower($package) + ), + 'installed:IS NOT' => null + ) +); +$c->limit(1); + +/** @var modTransportPackage $oldPackage */ +$oldPackage = $modx->getObject('transport.modTransportPackage', $c); + +$oldVersion = ''; +if ($oldPackage) { + $oldVersion = $oldPackage->get('version_major') . '.' . $oldPackage->get('version_minor'); + $oldVersion .= '.' . $oldPackage->get('version_patch'); + $oldVersion .= '-' . $oldPackage->get('release'); +} + +$version = ''; +if ($options['topic']) { + $topic = trim($options['topic'], '/'); + $topic = explode('/', $topic); + $signature = end($topic); + $version = str_replace(strtolower($package) . '-', '', $signature); +} + +$userNameObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_name') +); +$userName = ($userNameObj) ? $userNameObj->get('value') : ''; + +$userEmailObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_email') +); +$userEmail = ($userEmailObj) ? $userEmailObj->get('value') : ''; + +$modxVersionObj = $modx->getObject('modSystemSetting', array('key' => 'settings_version')); +$modxVersion = ($modxVersionObj) ? $modxVersionObj->get('value') : ''; +$managerLang = $modx->getOption('manager_language'); + +$action = ''; +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + $action = 'install'; + break; + case xPDOTransport::ACTION_UPGRADE: + $action = 'upgrade'; + break; + case xPDOTransport::ACTION_UNINSTALL: + $action = 'uninstall'; + + $version = $oldVersion; + $setupOptionsPath = explode('/', $options['setup-options']); + $signature = $setupOptionsPath[0]; + $oldVersion = str_replace(strtolower($package) . '-', '', $signature); + + break; +} + +$params = array( + 'name' => $options['namespace'], + 'url' => $_SERVER['SERVER_NAME'], + 'user_name' => $userName, + 'user_email' => $userEmail, + 'php_version' => phpversion(), + 'modx_version' => $modxVersion, + 'manager_lang' => $managerLang, + 'installation_type' => $action, + 'package_version_from' => $oldVersion, + 'package_version' => $version, + 'date' => time() +); + +/** + * Curl POST. + */ +$curl = curl_init(); +curl_setopt($curl, CURLOPT_URL, $url); +curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: STERC-A64XHC7PNY8G61L79E')); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); +curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120); +curl_setopt($curl, CURLOPT_POST, true); +curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params)); +curl_setopt($curl, CURLOPT_TIMEOUT, 120); + +$response = curl_exec($curl); +$responseInfo = curl_getinfo($curl); +$curlError = curl_error($curl); +curl_close($curl); + +return true; diff --git a/_build/resolvers/uninstall.resolver.php b/_build/resolvers/uninstall.resolver.php new file mode 100644 index 0000000..81b6f96 --- /dev/null +++ b/_build/resolvers/uninstall.resolver.php @@ -0,0 +1,20 @@ +xpdo->getObject('modSystemSetting', array( + 'key' => 'stercseo.migration_status', + 'namespace' => 'stercseo_custom' + )); + if ($migrationStatusSetting) { + $migrationStatusSetting->remove(); + } + break; +} +return true; \ No newline at end of file diff --git a/_build/setup.options.php b/_build/setup.options.php new file mode 100644 index 0000000..da96b31 --- /dev/null +++ b/_build/setup.options.php @@ -0,0 +1,63 @@ + setup options + * + * @package StercSEO + * @subpackage build + */ +$package = 'StercSEO'; + +$settings = array( + array( + 'key' => 'user_name', + 'value' => '', + 'name' => 'Name' + ), + array( + 'key' => 'user_email', + 'value' => '', + 'name' => 'Email address' + ), +); +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + foreach ($settings as $key => $setting) { + $settingObject = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.' . $setting['key']) + ); + if ($settingObject) { + $settings[$key]['value'] = $settingObject->get('value'); + } + } + break; + case xPDOTransport::ACTION_UNINSTALL: + break; +} + +/* Hide default setuptoptions text */ +$output[] = ' + + + + +

Get free priority updates

+

Enter your name and email address below to receive priority updates about our extras. +Be the first to know about updates and new features. +It is NOT required to enter your name and email to use this extra.

'; + +foreach ($settings as $setting) { + $str = ''; + $str .= ''; + + $output[] = $str; +} + +return implode('

', $output); diff --git a/_media/Screenshot 301 redirects Extra.png b/_media/Screenshot 301 redirects Extra.png new file mode 100644 index 0000000..a663b43 Binary files /dev/null and b/_media/Screenshot 301 redirects Extra.png differ diff --git a/_media/Screenshot 301 redirects on page.png b/_media/Screenshot 301 redirects on page.png new file mode 100644 index 0000000..72a6cfc Binary files /dev/null and b/_media/Screenshot 301 redirects on page.png differ diff --git a/_media/Screenshot Freeze URL.png b/_media/Screenshot Freeze URL.png new file mode 100644 index 0000000..43f503e Binary files /dev/null and b/_media/Screenshot Freeze URL.png differ diff --git a/_media/Screenshot Google Sitemap.png b/_media/Screenshot Google Sitemap.png new file mode 100644 index 0000000..32570ab Binary files /dev/null and b/_media/Screenshot Google Sitemap.png differ diff --git a/_media/Screenshot findability.png b/_media/Screenshot findability.png new file mode 100644 index 0000000..a2c416c Binary files /dev/null and b/_media/Screenshot findability.png differ diff --git a/_media/test b/_media/test new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/_media/test @@ -0,0 +1 @@ + diff --git a/_packages/stercseo-2.0.0-pl.transport.zip b/_packages/stercseo-2.0.0-pl.transport.zip new file mode 100644 index 0000000..7640de9 Binary files /dev/null and b/_packages/stercseo-2.0.0-pl.transport.zip differ diff --git a/_packages/stercseo-2.0.0-pl/manifest.php b/_packages/stercseo-2.0.0-pl/manifest.php new file mode 100644 index 0000000..02a6afd --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/manifest.php @@ -0,0 +1,547 @@ + '1.1', + 'manifest-attributes' => + array ( + 'license' => 'GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 +-------------------------- + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble +-------- + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation\'s software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author\'s protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors\' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone\'s free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + +GNU GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +--------------------------------------------------------------- + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program\'s +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients\' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +NO WARRANTY +----------- + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +--------------------------- +END OF TERMS AND CONDITIONS', + 'readme' => '-------------------- +SEO Tab +-------------------- +Version: 2.0.0-pl +Author: Sterc +License: GNU GPLv2 +-------------------- +SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google. + +More info and documentation on Github: https://github.com/Sterc/SEOTab + + +Key features of SEO Tab +----------------------- +- Manage search engine visibility (noindex, nofollow) +- Manage internal search engine behavior +- Manage your Google XML Sitemap(s) +- Manage 301 redirects +- Automatically generate 301 redirects when changing a resource URL +- Freeze URL functionality is moved into the SEO-tab + + +Bugs and feature requests +------------------------- +We greatly value your feedback, feature requests and bug reports. Please issue them on GitHub (https://github.com/Sterc/SEOTab/issues/new).', + 'changelog' => '---------------------- +Changelog for SEO Tab +---------------------- + +SEOTab 2.0.0-pl +============== +- PLEASE NOTE: THIS UPDATE CONTAINS A MIGRATION SCRIPT - READ ABOUT THE RISKS on https://github.com/Sterc/SEOTab +- 301 redirects are now stored in a separate table (migration page included) +- New custom manager page for viewing and managing 301 redirects +- Added systemsetting for excluding usergroups from accessing SEOTab #39 +- Automatically add redirect for resource and children when moving or changing alias/uri (thanks to Michael Engel). PR#63 +- Menu description was added +- Text is updated +- Added \'http\' check-up and entered pre-populated text field +- Fixed bug #61: OnPageNotFound doesn\'t works correctly on site with many resources +- Fixed bug #71: Target / Resource URL Dialog + Enhancement +- Fixed bug #72: Sorting options +- Fixed bug #73: Confirmation dialog added +- Fixed bug #74: Duplicate-redirect check +- Fixed bug #81: 301 from context2 to context1 results in 404 +- Fixed bug #85: 301 redirect of current page URL is not allowed +- Fixed bug #86: noindex results in exclusion from the sitemap +- Fixed bug #92: Migration dies on timeout +- Fixed bug #93: Deleting saved objects onEmptyTrash +- Fixed bug #94: All pages set to noindex,nofollow after installation +- Fixed bug #98: Memory issues after installation + +SEOTab 1.2.2-pl +============== +- Changed author +- Removed development files +- Added automatically adding 301 redirects if alias of page is changed #42 +- Added option to set params outerTpl and rowTpl for StercSeoSiteMap snippet #52 + +SEOTab 1.2.1-pl +============== +- Fixed 301 redirect do not match URLS containing & and % #32 +- Fixed bug with clearing resource URI would add unnecessary 301 redirects + +SEOTab 1.2.0-pl +============== +- Changed style for MODX 2.4 +- Multiple context support inside sitemap + +SEOTab 1.1.2-pl +============== +- Added ability to hide SEOTab for certain contexts (Todo: also add usergroups and templates) + +SEOTab 1.1.1-pl +============== +- Optimized 301 grid for MODX 2.3.x + +SEOTab 1.1.0-pl +============== +- Changed save function on new document + +SEOTab 1.0.10-pl +============== +-Reversed Pull request #30 for not working properly + +SEOTab 1.0.9-pl +============== +-Fixed wide vtabs body for MODX 2.3 + +SEOTab 1.0.8-pl +============== +- Fixed disappearing values when only update 301 redirects. This also fixes the multi context bug. +- Removed custom CSS for MODX 2.3 + +SEOTab 1.0.7-pl +============== +- Test against explicit removal from sitemap #30 +- Get defaults from modx settings. Add Context aware redirects #28 + +SEOTab 1.0.6-pl +- Fix OnPageNotFound #23 + +SEOTab 1.0.2-pl +============== +- Fixed the install for plugin events +- Changed datetime format for Google Sitemap + +SEOTab 1.0.1-pl +============== +- Loading tab with Articles +- Added RU localization +- French translation +- Update transport.snippets.php +- Enable drag&drop sorting creating redirects +- Changed the sitemap + +SEOTab 1.0.0-pl +============== +- Initial release +', + 'setup-options' => 'stercseo-2.0.0-pl/setup-options.php', + ), + 'manifest-vehicles' => + array ( + 0 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modNamespace', + 'guid' => '5fe23d6c6c42fd01a925faed1b5e9f9e', + 'native_key' => 'stercseo', + 'filename' => 'modNamespace/33f4d63e4de81d8b17c04af4481e53ca.vehicle', + 'namespace' => 'stercseo', + ), + 1 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => 'd950948f56aec653622f502b796e445f', + 'native_key' => 'stercseo.context-aware-alias', + 'filename' => 'modSystemSetting/2e871a83945f6f5a206ba70ba5f910c7.vehicle', + 'namespace' => 'stercseo', + ), + 2 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => '8bb37867c400e9d5ce0061269b7a5805', + 'native_key' => 'stercseo.index', + 'filename' => 'modSystemSetting/5067d31a012bfebe4c1d0cf10373c4de.vehicle', + 'namespace' => 'stercseo', + ), + 3 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => 'c00357e141699d0b135e49885e3107f9', + 'native_key' => 'stercseo.follow', + 'filename' => 'modSystemSetting/546e44b0e6790bdde0a844e87f891b33.vehicle', + 'namespace' => 'stercseo', + ), + 4 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => '2d2439546666b5169991e7b1dc98700f', + 'native_key' => 'stercseo.sitemap', + 'filename' => 'modSystemSetting/52f4b68c4dbee4806ccf960aae6ff3d0.vehicle', + 'namespace' => 'stercseo', + ), + 5 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => 'b9cae45b1c3dada918e5b10468908523', + 'native_key' => 'stercseo.priority', + 'filename' => 'modSystemSetting/199b364dbc43edb4b562dae594587009.vehicle', + 'namespace' => 'stercseo', + ), + 6 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => '63d8b810a3c563b62f7ed19616b8601f', + 'native_key' => 'stercseo.changefreq', + 'filename' => 'modSystemSetting/eb8aa5a25c0f6595ee43bdf74da507cc.vehicle', + 'namespace' => 'stercseo', + ), + 7 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => 'cb09a1c2694b93ed8d2edcbaae41719b', + 'native_key' => 'stercseo.allowed_contexts', + 'filename' => 'modSystemSetting/4cf80a2dc46ecf7f2b67e2813af1e32a.vehicle', + 'namespace' => 'stercseo', + ), + 8 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => 'f838e17170d8e15dde982cc5b71fe7bc', + 'native_key' => 'stercseo.hide_from_usergroups', + 'filename' => 'modSystemSetting/d645cc92f250c430b7ff6dc03ca1ccc2.vehicle', + 'namespace' => 'stercseo', + ), + 9 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => '59dea56b67953da6da9b688744249689', + 'native_key' => 'stercseo.user_name', + 'filename' => 'modSystemSetting/cea64ec9761f7f4ec5274c674df13862.vehicle', + 'namespace' => 'stercseo', + ), + 10 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modSystemSetting', + 'guid' => 'ebd23d14c1d635761352f15da02a72d3', + 'native_key' => 'stercseo.user_email', + 'filename' => 'modSystemSetting/71bb5cfe8ab0eb4c370b065e5e00477b.vehicle', + 'namespace' => 'stercseo', + ), + 11 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modCategory', + 'guid' => '1a6c0b59e42305eaa6084cfe5e0634e2', + 'native_key' => NULL, + 'filename' => 'modCategory/907ce229a7a4529ab87c0773ee03532c.vehicle', + 'namespace' => 'stercseo', + ), + 12 => + array ( + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'class' => 'modMenu', + 'guid' => '42f8af5cb82410f04f56d2cd12a5f7c0', + 'native_key' => 'stercseo.seotab', + 'filename' => 'modMenu/4295eeadad7599cd0d50b84583f1738f.vehicle', + 'namespace' => 'stercseo', + ), + ), +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.gpm.resolve.tables.resolver b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.gpm.resolve.tables.resolver new file mode 100644 index 0000000..c837548 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.gpm.resolve.tables.resolver @@ -0,0 +1,29 @@ +xpdo) { + $modx =& $object->xpdo; + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modelPath = $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path') . 'components/stercseo/') . 'model/'; + + $modx->addPackage('stercseo', $modelPath, null); + + + $manager = $modx->getManager(); + + $manager->createObjectContainer('seoUrl'); + + break; + } +} + +return true; \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.setupoptions.resolver.resolver b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.setupoptions.resolver.resolver new file mode 100644 index 0000000..3bebd94 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.setupoptions.resolver.resolver @@ -0,0 +1,47 @@ +xpdo->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.' . $key) + ); + + if ($settingObject) { + $settingObject->set('value', $options[$key]); + $settingObject->save(); + } else { + $error = '[' . $package . '] ' . strtolower($package) . '.' . $key . ' setting could not be found,'; + $error .= ' so the setting could not be changed.'; + + $object->xpdo->log( + xPDO::LOG_LEVEL_ERROR, + $error + ); + } + } + } + + $success = true; + break; + case xPDOTransport::ACTION_UNINSTALL: + $success = true; + break; +} + +return $success; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.stercextra.resolver.resolver b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.stercextra.resolver.resolver new file mode 100644 index 0000000..e15619b --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.stercextra.resolver.resolver @@ -0,0 +1,118 @@ +xpdo; +$c = $modx->newQuery('transport.modTransportPackage'); +$c->where( + array( + 'workspace' => 1, + "(SELECT + `signature` + FROM {$modx->getTableName('modTransportPackage')} AS `latestPackage` + WHERE `latestPackage`.`package_name` = `modTransportPackage`.`package_name` + ORDER BY + `latestPackage`.`version_major` DESC, + `latestPackage`.`version_minor` DESC, + `latestPackage`.`version_patch` DESC, + IF(`release` = '' OR `release` = 'ga' OR `release` = 'pl','z',`release`) DESC, + `latestPackage`.`release_index` DESC + LIMIT 1,1) = `modTransportPackage`.`signature`", + ) +); +$c->where( + array( + array( + 'modTransportPackage.package_name' => strtolower($package) + ), + 'installed:IS NOT' => null + ) +); +$c->limit(1); + +/** @var modTransportPackage $oldPackage */ +$oldPackage = $modx->getObject('transport.modTransportPackage', $c); + +$oldVersion = ''; +if ($oldPackage) { + $oldVersion = $oldPackage->get('version_major') . '.' . $oldPackage->get('version_minor'); + $oldVersion .= '.' . $oldPackage->get('version_patch'); + $oldVersion .= '-' . $oldPackage->get('release'); +} + +$version = ''; +if ($options['topic']) { + $topic = trim($options['topic'], '/'); + $topic = explode('/', $topic); + $signature = end($topic); + $version = str_replace(strtolower($package) . '-', '', $signature); +} + +$userNameObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_name') +); +$userName = ($userNameObj) ? $userNameObj->get('value') : ''; + +$userEmailObj = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.user_email') +); +$userEmail = ($userEmailObj) ? $userEmailObj->get('value') : ''; + +$modxVersionObj = $modx->getObject('modSystemSetting', array('key' => 'settings_version')); +$modxVersion = ($modxVersionObj) ? $modxVersionObj->get('value') : ''; +$managerLang = $modx->getOption('manager_language'); + +$action = ''; +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + $action = 'install'; + break; + case xPDOTransport::ACTION_UPGRADE: + $action = 'upgrade'; + break; + case xPDOTransport::ACTION_UNINSTALL: + $action = 'uninstall'; + + $version = $oldVersion; + $setupOptionsPath = explode('/', $options['setup-options']); + $signature = $setupOptionsPath[0]; + $oldVersion = str_replace(strtolower($package) . '-', '', $signature); + + break; +} + +$params = array( + 'name' => $options['namespace'], + 'url' => $_SERVER['SERVER_NAME'], + 'user_name' => $userName, + 'user_email' => $userEmail, + 'php_version' => phpversion(), + 'modx_version' => $modxVersion, + 'manager_lang' => $managerLang, + 'installation_type' => $action, + 'package_version_from' => $oldVersion, + 'package_version' => $version, + 'date' => time() +); + +/** + * Curl POST. + */ +$curl = curl_init(); +curl_setopt($curl, CURLOPT_URL, $url); +curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: STERC-A64XHC7PNY8G61L79E')); +curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); +curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120); +curl_setopt($curl, CURLOPT_POST, true); +curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params)); +curl_setopt($curl, CURLOPT_TIMEOUT, 120); + +$response = curl_exec($curl); +$responseInfo = curl_getinfo($curl); +$curlError = curl_error($curl); +curl_close($curl); + +return true; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.uninstall.resolver.resolver b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.uninstall.resolver.resolver new file mode 100644 index 0000000..81b6f96 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.uninstall.resolver.resolver @@ -0,0 +1,20 @@ +xpdo->getObject('modSystemSetting', array( + 'key' => 'stercseo.migration_status', + 'namespace' => 'stercseo_custom' + )); + if ($migrationStatusSetting) { + $migrationStatusSetting->remove(); + } + break; +} +return true; \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.vehicle b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.vehicle new file mode 100644 index 0000000..ca0184c --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c.vehicle @@ -0,0 +1,263 @@ + 'category', + 'preserve_keys' => false, + 'update_object' => true, + 'related_objects' => + array ( + 'Snippets' => + array ( + '65b99ae48c2667b2cef5671eb11ef339' => + array ( + 'preserve_keys' => false, + 'update_object' => true, + 'unique_key' => 'name', + 'class' => 'modSnippet', + 'object' => '{"id":null,"source":0,"property_preprocess":0,"name":"StercSeoSiteMap","description":"Outputs the sitemap based on the resource settings made in SEO Tab","editor_type":0,"category":0,"cache_type":0,"snippet":"require_once $modx->getOption(\'stercseo.core_path\', null, $modx->getOption(\'core_path\').\'components\\/stercseo\\/\').\'model\\/stercseo\\/stercseo.class.php\';\\n$stercseo = new StercSeo($modx, $scriptProperties);\\n$allowSymlinks = (isset($allowSymlinks)) ? $allowSymlinks : 0;\\n$contexts = (isset($contexts)) ? explode(\',\',str_replace(\' \', \'\', $contexts)) : array($modx->resource->get(\'context_key\'));\\n$outerTpl = (isset($outerTpl)) ? $outerTpl : \'sitemap\\/outertpl\';\\n$rowTpl = (isset($rowTpl)) ? $rowTpl : \'sitemap\\/rowtpl\';\\n\\nreturn $stercseo->sitemap($contexts, $rowTpl, $outerTpl, $allowSymlinks);","locked":0,"properties":"a:0:{}","moduleguid":"","static":0,"static_file":"","content":"require_once $modx->getOption(\'stercseo.core_path\', null, $modx->getOption(\'core_path\').\'components\\/stercseo\\/\').\'model\\/stercseo\\/stercseo.class.php\';\\n$stercseo = new StercSeo($modx, $scriptProperties);\\n$allowSymlinks = (isset($allowSymlinks)) ? $allowSymlinks : 0;\\n$contexts = (isset($contexts)) ? explode(\',\',str_replace(\' \', \'\', $contexts)) : array($modx->resource->get(\'context_key\'));\\n$outerTpl = (isset($outerTpl)) ? $outerTpl : \'sitemap\\/outertpl\';\\n$rowTpl = (isset($rowTpl)) ? $rowTpl : \'sitemap\\/rowtpl\';\\n\\nreturn $stercseo->sitemap($contexts, $rowTpl, $outerTpl, $allowSymlinks);"}', + 'guid' => 'c5e74920bab30c38ab1314a3732f36d2', + 'native_key' => NULL, + 'signature' => '0e0f542e2b9857f3cc322267dbc2f713', + ), + ), + 'Plugins' => + array ( + 'f61fe0b6cec09126edda6f8894e9da13' => + array ( + 'unique_key' => 'name', + 'preserve_keys' => false, + 'update_object' => true, + 'related_objects' => + array ( + 'PluginEvents' => + array ( + '107ca333a433e43d4a63ada87e3c5f83' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnDocFormPrerender","priority":0,"propertyset":0}', + 'guid' => '714ef4f90327530c975c2f961595caa2', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnDocFormPrerender', + ), + 'signature' => '20d0020b5351db224cece6824fc5978c', + ), + 'bfb6515df40ebf12a82b36e9bb5f4600' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnBeforeDocFormSave","priority":0,"propertyset":0}', + 'guid' => '8cde938f239256708b4f5425bdaf8e61', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnBeforeDocFormSave', + ), + 'signature' => 'a32a5fa3c1013849ccf3771feb89ca87', + ), + '0995a9187583e7bc2b7767dcb81c2e90' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnLoadWebDocument","priority":0,"propertyset":0}', + 'guid' => '0565588a4850f5ccf1123fa395366798', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnLoadWebDocument', + ), + 'signature' => '44b64ae736fd8085bc274cc0004cc57d', + ), + 'cd12b814b1c9ab4e7d43832af2519772' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnPageNotFound","priority":0,"propertyset":0}', + 'guid' => '089e4dc88db119653721d34bca51b075', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnPageNotFound', + ), + 'signature' => 'a8a339202c6ade1726e14f7bdea13676', + ), + '039a1a9d8652589d4bf6ba04bd7a95c8' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnResourceDuplicate","priority":0,"propertyset":0}', + 'guid' => '0932f396f320457e21a9f20f08f76efa', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnResourceDuplicate', + ), + 'signature' => 'd5f10c90f702902996d8385a49652ec8', + ), + 'b941bf017e1467d2c08c176e16b07481' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnManagerPageBeforeRender","priority":0,"propertyset":0}', + 'guid' => 'b341a7ed4900dc7d1f712baf7b6e80d9', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnManagerPageBeforeRender', + ), + 'signature' => 'cb565249a04c2ce76a528874cd876244', + ), + '59825706eaba9f374231ad072cfb0e53' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnResourceBeforeSort","priority":0,"propertyset":0}', + 'guid' => '08a38a393fedd05c5a8b0ede4f0612e7', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnResourceBeforeSort', + ), + 'signature' => 'f9aa508815c4823cbb45382f2c6f439a', + ), + 'db0697065240c8289cb714fe315c3503' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnDocFormSave","priority":0,"propertyset":0}', + 'guid' => '815148a58cfd3e614e523b3f297bee28', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnDocFormSave', + ), + 'signature' => '1ba28d1a1c6a4627579779c01b864df3', + ), + 'd859e802a2214732fc6c8f90760e080c' => + array ( + 'class' => 'modPluginEvent', + 'object' => '{"pluginid":0,"event":"OnEmptyTrash","priority":0,"propertyset":0}', + 'guid' => '171de28dd7c72d7ab48d5fc02fdb2bd1', + 'native_key' => + array ( + 0 => 0, + 1 => 'OnEmptyTrash', + ), + 'signature' => 'b4787163c84538242e7fbba8a0c85bed', + ), + ), + ), + 'related_object_attributes' => + array ( + 'PluginEvents' => + array ( + 'preserve_keys' => true, + 'update_object' => false, + 'unique_key' => + array ( + 0 => 'pluginid', + 1 => 'event', + ), + ), + ), + 'class' => 'modPlugin', + 'object' => '{"id":null,"source":0,"property_preprocess":0,"name":"StercSEO","description":"Plugin to render SEO Tab and save all the data.","editor_type":0,"category":0,"cache_type":0,"plugincode":"\\/**\\n * SEO Tab\\n *\\n * Copyright 2013 by Sterc internet & marketing \\n *\\n * This file is part of SEO Tab.\\n *\\n * SEO Tab is free software; you can redistribute it and\\/or modify it under the\\n * terms of the GNU General Public License as published by the Free Software\\n * Foundation; either version 2 of the License, or (at your option) any later\\n * version.\\n *\\n * SEO Tab is distributed in the hope that it will be useful, but WITHOUT ANY\\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\\n * A PARTICULAR PURPOSE. See the GNU General Public License for more details.\\n *\\n * You should have received a copy of the GNU General Public License along with\\n * SEO Tab; if not, write to the Free Software Foundation, Inc., 59 Temple Place,\\n * Suite 330, Boston, MA 02111-1307 USA\\n *\\n * @package stercseo\\n *\\/\\n\\/**\\n * SEO Tab Plugin\\n *\\n *\\n * Events:\\n * OnDocFormPrerender,OnDocFormSave,OnHandleRequest,OnPageNotFound, OnResourceDuplicate, OnEmptyThrash, OnResourceBeforeSort\\n *\\n * @author Sterc internet & marketing \\n *\\n * @package stercseo\\n *\\n *\\/\\n$stercseo = $modx->getService(\'stercseo\', \'StercSEO\', $modx->getOption(\'stercseo.core_path\', null, $modx->getOption(\'core_path\').\'components\\/stercseo\\/\').\'model\\/stercseo\\/\', array());\\n\\nif (!($stercseo instanceof StercSEO)) {\\n return;\\n}\\n\\nswitch ($modx->event->name) {\\n case \'OnDocFormPrerender\':\\n if (!$stercseo->checkUserAccess()) {\\n return;\\n }\\n\\n $resource =& $modx->event->params[\'resource\'];\\n if ($resource) {\\n \\/\\/First check if SEO Tab is allowed in this context\\n if (!$stercseo->isAllowed($resource->get(\'context_key\'))) {\\n return;\\n }\\n $properties = $resource->getProperties(\'stercseo\');\\n $urls = $modx->getCollection(\'seoUrl\', array(\'resource\' => $resource->get(\'id\')));\\n }\\n\\n if (empty($properties)) {\\n $properties = array(\\n \'index\' => $modx->getOption(\'stercseo.index\', null, \'1\'),\\n \'follow\' => $modx->getOption(\'stercseo.follow\', null, \'1\'),\\n \'sitemap\' => $modx->getOption(\'stercseo.sitemap\', null, \'1\'),\\n \'priority\' => $modx->getOption(\'stercseo.priority\', null, \'0.5\'),\\n \'changefreq\' => $modx->getOption(\'stercseo.changefreq\', null, \'weekly\')\\n );\\n }\\n $properties[\'urls\'] = \'\';\\n \\/\\/ Fetch urls from seoUrl collection\\n if ($urls && is_object($urls)) {\\n foreach ($urls as $url) {\\n $properties[\'urls\'][][\'url\'] = urldecode($url->get(\'url\'));\\n }\\n }\\n\\n $modx->regClientStartupHTMLBlock(\''); + $version = $modx->getVersionData(); + + /* include CSS and JS*/ + if ($version['version'] == 2 && $version['major_version'] == 2) { + $modx->regClientCSS($stercseo->config['cssUrl'].'stercseo.css'); + } + $modx->regClientStartupScript($stercseo->config['jsUrl'].'mgr/stercseo.js'); + $modx->regClientStartupScript($stercseo->config['jsUrl'].'mgr/sections/resource.js'); + $modx->regClientStartupScript($stercseo->config['jsUrl'].'mgr/widgets/resource.grid.js'); + $modx->regClientStartupScript($stercseo->config['jsUrl'].'mgr/widgets/resource.vtabs.js'); + + //add lexicon + $modx->controller->addLexiconTopic('stercseo:default'); + + break; + + case 'OnBeforeDocFormSave': + $oldResource = ($mode == 'upd') ? $modx->getObject('modResource', $resource->get('id')) : $resource; + if (!$stercseo->isAllowed($oldResource->get('context_key'))) { + return; + } + $properties = $oldResource->getProperties('stercseo'); + + if (isset($_POST['urls'])) { + $urls = $modx->fromJSON($_POST['urls']); + foreach ($urls as $url) { + $check = $modx->getObject('seoUrl', array( 'url' => urlencode($url['url']), 'resource' => $oldResource->get('id'), 'context_key' => $oldResource->get('context_key'))); + if (!$check) { + $redirect = $modx->newObject('seoUrl'); + $data = array( + 'url' => urlencode($url['url']), + 'resource' => $oldResource->get('id'), + 'context_key' => $oldResource->get('context_key'), + ); + $redirect->fromArray($data); + $redirect->save(); + } + } + } + + if ($mode == 'upd') { + $newProperties = array( + 'index' => (isset($_POST['index']) ? $_POST['index'] : $properties['index']), + 'follow' => (isset($_POST['follow']) ? $_POST['follow'] : $properties['follow']), + 'sitemap' => (isset($_POST['sitemap']) ? $_POST['sitemap'] : $properties['sitemap']), + 'priority' => (isset($_POST['priority']) ? $_POST['priority'] : $properties['priority']), + 'changefreq' => (isset($_POST['changefreq']) ? $_POST['changefreq'] : $properties['changefreq']) + ); + } else { + $newProperties = array( + 'index' => (isset($_POST['index']) ? $_POST['index'] : $modx->getOption('stercseo.index', null, '1')), + 'follow' => (isset($_POST['follow']) ? $_POST['follow'] : $modx->getOption('stercseo.follow', null, '1')), + 'sitemap' => (isset($_POST['sitemap']) ? $_POST['sitemap'] : $modx->getOption('stercseo.sitemap', null, '1')), + 'priority' => (isset($_POST['priority']) ? $_POST['priority'] : $modx->getOption('stercseo.priority', null, '0.5')), + 'changefreq' => (isset($_POST['changefreq']) ? $_POST['changefreq'] : $modx->getOption('stercseo.changefreq', null, 'weekly')) + ); + } + + // If uri is changed or alias (with freeze uri off) has changed, add a new redirect + if (($oldResource->get('uri') != $resource->get('uri') || + ($oldResource->get('uri_override') == 0 && $oldResource->get('alias') != $resource->get('alias'))) && + $oldResource->get('uri') != '') { + $url = urlencode($modx->getOption('site_url').$oldResource->get('uri')); + if (!$modx->getCount('seoUrl', array('url' => $url))) { + $data = array( + 'url' => $url, + 'resource' => $resource->get('id'), + 'context_key' => $resource->get('context_key'), + ); + $redirect = $modx->newObject('seoUrl'); + $redirect->fromArray($data); + $redirect->save(); + } + // Recursive set all children resources as redirects + if ($modx->getOption('use_alias_path')) { + $resourceOldBasePath = $oldResource->getAliasPath($oldResource->get('alias'), $oldResource->toArray() + array('isfolder' => 1)); + $resourceNewBasePath = $resource->getAliasPath($resource->get('alias'), $resource->toArray() + array('isfolder' => 1)); + $childResources = $modx->getIterator('modResource', array( + 'uri:LIKE' => $resourceOldBasePath . '%', + 'uri_override' => '0', + 'published' => '1', + 'deleted' => '0', + 'context_key' => $resource->get('context_key') + )); + foreach ($childResources as $childResource) { + $url = urlencode($modx->getOption('site_url').$childResource->get('uri')); + if (!$modx->getCount('seoUrl', array('url' => $url))) { + $data = array( + 'url' => $url, + 'resource' => $childResource->get('id'), + 'context_key' => $resource->get('context_key'), + ); + $redirect = $modx->newObject('seoUrl'); + $redirect->fromArray($data); + $redirect->save(); + } + } + } + } + $resource->setProperties($newProperties, 'stercseo'); + break; + + case 'OnDocFormSave': + if (!$stercseo->isAllowed($resource->context_key)) { + return; + } + + $url = urlencode($modx->makeUrl($resource->id, $resource->context_key, '', 'full')); + $urlExists = $modx->getObject('seoUrl', [ + 'url' => $url, + 'context_key' => $resource->context_key + ]); + + if ($urlExists) { + $modx->removeObject('seoUrl', [ + 'url' => $url, + 'context_key' => $resource->context_key + ]); + } + break; + + case 'OnLoadWebDocument': + if ($modx->resource) { + if (!$stercseo->isAllowed($modx->resource->get('context_key'))) { + return; + } + $properties = $modx->resource->getProperties('stercseo'); + if (empty($properties)) { + // Properties not available + // This means an this resource has nog SEO Tab properties, which means it is a pre-SEO Tab resource + // Fallback to system defaults + $properties = array( + 'index' => $modx->getOption('stercseo.index', null, 1), + 'follow' => $modx->getOption('stercseo.follow', null, 1) + ); + } + $metaContent = array('noodp', 'noydir'); + $metaContent[] = (intval($properties['index']) ? 'index' : 'noindex'); + $metaContent[] = (intval($properties['follow']) ? 'follow' : 'nofollow'); + + $modx->setPlaceholder('seoTab.robotsTag', implode(',', $metaContent)); + } + break; + + case 'OnPageNotFound': + $options = array(); + $url = $modx->getOption('server_protocol').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; + $convertedUrl = urlencode($url); + + $w = array( + 'url' => $convertedUrl + ); + + if ($modx->getOption('stercseo.context-aware-alias', null, '0')) { + $w['context_key'] = $modx->context->key; + } + + $alreadyExists = $modx->getObject('seoUrl', $w); + + if (isset($alreadyExists) && ($modx->context->key !== $alreadyExists->get('context_key'))) { + $q = $modx->newQuery('modContextSetting'); + $q->where([ + 'context_key' => $alreadyExists->get('context_key'), + 'key' => 'site_url' + ]); + $q->prepare(); + + $siteUrl = $modx->getObject('modContextSetting', $q); + if ($siteUrl) { + $options['site_url'] = $siteUrl->get('value'); + } + } + + if ($alreadyExists) { + $url = $modx->makeUrl($alreadyExists->get('resource'), $alreadyExists->get('context_key'), '', 'full', $options); + + $modx->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently'); + } + break; + + case 'OnResourceBeforeSort': + list($sourceCtx, $resource) = explode('_', $modx->getOption('source', $_POST)); + list($targetCtx, $target) = explode('_', $modx->getOption('target', $_POST)); + switch ($modx->getOption('point', $_POST)) { + case 'above': + case 'below': + $tmpRes = $modx->getObject('modResource', $target); + $target = $tmpRes->get('parent'); + unset($tmpRes); + break; + } + $oldResource = $modx->getObject('modResource', $resource); + $resource = $modx->getObject('modResource', $resource); + $resource->set('parent', $target); + $resource->set('uri', ''); + $uriChanged = false; + if ($oldResource->get('uri') != $resource->get('uri') && $oldResource->get('uri') != '') { + $uriChanged = true; + } + + // Recursive set redirects for drag/dropped resource, and its children (where uri_override is not set) + if ($uriChanged && $modx->getOption('use_alias_path')) { + $oldResource->set('isfolder', true); + $resourceOldBasePath = $oldResource->getAliasPath( + $oldResource->get('alias'), + $oldResource->toArray() + ); + $resourceNewBasePath = $resource->getAliasPath( + $resource->get('alias'), + $resource->toArray() + array('isfolder' => 1) + ); + $cond = $modx->newQuery('modResource'); + $cond->where(array( + array( + 'uri:LIKE' => $resourceOldBasePath . '%', + 'OR:id:=' => $oldResource->id + ), + 'uri_override' => '0', + 'published' => '1', + 'deleted' => '0', + 'context_key' => $resource->get('context_key') + )); + + $childResources = $modx->getIterator('modResource', $cond); + foreach ($childResources as $childResource) { + $url = urlencode($modx->getOption('site_url').$childResource->get('uri')); + if (!$modx->getCount('seoUrl', array('url' => $url))) { + $data = array( + 'url' => $url, + 'resource' => $childResource->get('id'), + 'context_key' => $targetCtx + ); + $redirect = $modx->newObject('seoUrl'); + $redirect->fromArray($data); + $redirect->save(); + } + } + } + break; + + case 'OnResourceDuplicate': + if (!$stercseo->isAllowed($newResource->get('context_key'))) { + return; + } + $props = $newResource->getProperties('stercseo'); + $newResource->setProperties($props, 'stercseo'); + $newResource->save(); + break; + + case 'OnManagerPageBeforeRender': + if (!$stercseo->checkUserAccess()) { + return; + } + // If migration status is false, show migrate alert message bar in manager + if (!$stercseo->redirectMigrationStatus()) { + $modx->regClientStartupHTMLBlock($stercseo->getChunk('migrate/alert', array('message' => $modx->lexicon('stercseo.migrate_alert')))); + $modx->regClientCSS($stercseo->config['cssUrl'].'migrate.css'); + } + break; + + case 'OnEmptyTrash': + if (count($ids) > 0) { + foreach ($ids as $id) { + $modx->removeCollection('seoUrl', array( + 'resource' => $id + )); + } + } +} +return; \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/elements/snippets/StercSeoSiteMap.snippet.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/elements/snippets/StercSeoSiteMap.snippet.php new file mode 100644 index 0000000..1e2c356 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/elements/snippets/StercSeoSiteMap.snippet.php @@ -0,0 +1,9 @@ +getOption('stercseo.core_path', null, $modx->getOption('core_path').'components/stercseo/').'model/stercseo/stercseo.class.php'; +$stercseo = new StercSeo($modx, $scriptProperties); +$allowSymlinks = (isset($allowSymlinks)) ? $allowSymlinks : 0; +$contexts = (isset($contexts)) ? explode(',',str_replace(' ', '', $contexts)) : array($modx->resource->get('context_key')); +$outerTpl = (isset($outerTpl)) ? $outerTpl : 'sitemap/outertpl'; +$rowTpl = (isset($rowTpl)) ? $rowTpl : 'sitemap/rowtpl'; + +return $stercseo->sitemap($contexts, $rowTpl, $outerTpl, $allowSymlinks); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/index.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/index.class.php new file mode 100644 index 0000000..6c90c2e --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/index.class.php @@ -0,0 +1,33 @@ +stercseo = new StercSEO($this->modx); + + $this->addCss($this->stercseo->getOption('cssUrl').'mgr.css'); + $this->addJavascript($this->stercseo->getOption('jsUrl').'mgr/stercseo.js'); + $this->addHtml(''); + + parent::initialize(); + } + public function getLanguageTopics() + { + return array('stercseo:default'); + } + public function checkPermissions() + { + return true; + } +} diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/de/default.inc.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/de/default.inc.php new file mode 100644 index 0000000..ddfcdf9 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/de/default.inc.php @@ -0,0 +1,102 @@ + + * @author Thomas Jakobi + * + * @package stercseo + * @subpackage lexicon + */ + +$_lang['stercseo.seo'] = 'StercSEO'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Verwalten Sie alle Ihre SEO Tab 301 redirects.'; + +//Tab Findability +$_lang['stercseo.findability'] = 'Sichtbarkeit'; + +$_lang['stercseo.index'] = 'In Suchmaschinen anzeigen'; +$_lang['stercseo.index_yes'] = 'Ja, Seite soll indexiert werden'; +$_lang['stercseo.index_no'] = 'Nein, Seite soll nicht indexiert werden (noindex)'; +$_lang['stercseo.index_desc'] = 'Hinweis: Unwichtige Seiten sollten von der Indexierung für Suchmaschinen und von der Sitemap ausgeschlossen werden. Beispiele für unwichtige Seiten sind: Impressum, Haftungsausschluss, AGB, Datenschutzerklärungen.'; + +$_lang['stercseo.follow'] = 'Links folgen'; +$_lang['stercseo.follow_yes'] = 'Ja, Links von dieser Seite folgen'; +$_lang['stercseo.follow_no'] = 'Nein, Links von dieser Seite nicht folgen (nofollow)'; +$_lang['stercseo.follow_desc'] = 'Legen Sie fest ob Suchmaschinen den Links auf dieser Seite folgen sollen.'; + +$_lang['stercseo.searchable'] = 'Seite in interner Suche auflisten'; +$_lang['stercseo.searchable_yes'] = 'Ja, Seite soll über die interne Suche gefunden werden'; +$_lang['stercseo.searchable_no'] = 'Nein, Seite soll nicht über die interne Suche gefunden werden'; +$_lang['stercseo.searchable_desc'] = 'Legen Sie fest ob diese Seite über die Suchfunktion auf dieser Website gefunden werden soll oder nicht. Ein Beispiel für eine Seite die ausgeschlossen werden sollte ist z.B. die Bestätigungsseite nach einem Kontaktformular.'; + +//Tab Sitemap +$_lang['stercseo.sitemap'] = 'Google Sitemap'; + +$_lang['stercseo.sitemap_include'] = 'Seite zur Google Sitemap XML hinzufügen'; +$_lang['stercseo.sitemap_include_yes'] = 'Ja, Seite zur Google Sitemap hinzufügen'; +$_lang['stercseo.sitemap_include_no'] = 'Nein, Seite nicht zur Sitemap hinzufügen'; +$_lang['stercseo.sitemap_include_desc'] = 'Legen Sie fest ob diese Seite zur XML Sitemap für Google hinzugefügt werden soll oder nicht.'; + +$_lang['stercseo.priority'] = 'Priorität'; +$_lang['stercseo.priority_important'] = '1.0 - Hoch'; +$_lang['stercseo.priority_normal'] = '0.5 - Normal'; +$_lang['stercseo.priority_nopriority'] = '0.25 - Niedrig'; +$_lang['stercseo.priority_desc'] = 'Mit der Priorität geben Sie Suchmaschinen einen Hinweis auf die Bedeutung dieser Seite. Bitte beachten Sie: Suchmaschinen akzeptieren diese Priorität nicht blind und automatisch.'; + +$_lang['stercseo.changefreq'] = 'Update Frequenz'; +$_lang['stercseo.changefreq_daily'] = 'Täglich'; +$_lang['stercseo.changefreq_weekly'] = 'Wöchentlich'; +$_lang['stercseo.changefreq_monthly'] = 'Monatlich'; +$_lang['stercseo.changefreq_desc'] = 'Geben Sie an wie oft der Inhalt dieser Seite sich voraussichtlich ändern wird.'; + +//Tab Redirects +$_lang['stercseo.redirects'] = '301 Weiterleitungen'; +$_lang['stercseo.uri_add'] = 'Alte URL hinzufügen'; +$_lang['stercseo.uri_header'] = 'Dies ist eine Liste von alten URLs für diese Seite'; +$_lang['stercseo.grid_noresults'] = '

Keine Weiterleitungen

Es gibt keine Weiterleitungen für diese Seite

'; +$_lang['stercseo.redirects_desc'] = 'Jede Änderung an einer Seite beeinflusst Suchmaschinen. Wenn die URL einer Seite geändert wird verliert Sie Ihren gesamten Wert für Suchmaschinen. Mit 301 Weiterleitungen verliert Sie Ihren Wert nicht. 301 Weiterleitungen werden automatisch hinzufügt wenn Sie die URL ändern.'; +$_lang['stercseo.alreadyexists'] = '[[++site_URI]][[+URI]] existiert bereits für folgende Seite: [[+pagetitle]] ([[+id]])'; +$_lang['stercseo.uri_label'] = 'Alte URL'; +$_lang['stercseo.uri_label_desc'] = 'Geben Sie die komplette URL. z.B. "https://www.google.com/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect url. Please add http:// or https://'; + +//Tab Freeze URL +$_lang['stercseo.freeze_uri'] = 'Feste URL'; +$_lang['stercseo.uri_override'] = 'Legen Sie eine feste URL für diese Seite fest'; +$_lang['stercseo.uri_after'] = 'URL nach '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create short URLs. +For example, to set this page URL to [[+site_url]]short-url", enter "short-url" in the field below.'; + +//Settings +$_lang['setting_stercseo.context-aware-alias'] = '301 Weiterleitungen sind eindeutig pro Kontext'; +$_lang['setting_stercseo.context-aware-alias_desc'] = 'Alte URLs sind eindeutig pro Kontext, Weiterleitungen funtkionieren also nur innerhalb eines Kontextes'; +$_lang['setting_stercseo.index'] = 'Voreinstellung: In Suchmaschinen anzeigen'; +$_lang['setting_stercseo.index_desc'] = 'Neue Seiten in Suchmaschine anzeigen? (0, 1)'; +$_lang['setting_stercseo.follow'] = 'Voreinstellung: Links folgen'; +$_lang['setting_stercseo.follow_desc'] = 'Links auf neuen seiten folgen? (0 = nofollow, 1 = follow)'; +$_lang['setting_stercseo.sitemap'] = 'Voreinstellung: Seite zur Google Sitemap XML hinzufügen'; +$_lang['setting_stercseo.sitemap_desc'] = 'Neue Seite in sitemap.xml einschließen (0 = nein, 1 = ja)'; +$_lang['setting_stercseo.priority'] = 'Voreinstellung: Priorität'; +$_lang['setting_stercseo.priority_desc'] = 'Wichtigkeit von neuen Seiten (0.25, 0.5 oder 1)'; +$_lang['setting_stercseo.changefreq'] = 'Voreinstellung: Update Frequenz'; +$_lang['setting_stercseo.changefreq_desc'] = 'Update Frequenz für neue Seiten (daily, weekly, monthly)'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'SEO Tab für diese Benutzergruppen verbergen'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Kommaseparierte Liste von Benutzergruppen, denen nicht erlaubt ist, auf SEO Tab zuzugreifen'; + +// CMP +$_lang['stercseo.redirects.description'] = 'Hier können Sie Ihre 301 Weiterleitungen anschauen und bearbeiten. Weiterleitungen können ebenso auf den Ressourcen Seiten beim Anlegen und Bearbeiten hinzugefügt werden.'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect url'; +$_lang['stercseo.uri'] = 'Alte URL (weitergeleitete URL)'; +$_lang['stercseo.target'] = 'Ziel Ressource / URL'; +$_lang['stercseo.uri_update'] = 'Weiterleitung bearbeiten'; +$_lang['stercseo.uri_remove'] = 'Weiterleitung löschen'; +$_lang['stercseo.uri_remove_confirm'] = 'Sind Sie sicher, dass Sie diese Weiterleitung löschen wollen?'; +$_lang['stercseo.migrate'] = 'Weiterleitung migrieren'; +$_lang['stercseo.migrate_desc'] = 'Sie können Ihre Weiterleitung (SEO Tab version 1.2.2 und niedriger) von Ressourcen Eigenschaften zu eigenständigen seoURL Objekten migireren. Dies wird automatisch die Daten aller Weiterleitungen für Sie migrieren. Es ist keine weitere Aktion notwendig. Bitte lassen Sie diese Seite geöffnet, damit SEO Tab die Migrierung korrekt beenden kann.'; +$_lang['stercseo.migrate_alert'] = 'Ihre SEO Tab Weiterleitungen müssen migriert werden, bitte klicken Sie hier um die Migrierungs Seite anzuzeigen.'; +$_lang['stercseo.migrate_status'] = 'Status'; +$_lang['stercseo.migrate_running'] = 'Der Migrierungs-Prozess läuft momentan. Bitte lassen Sie diese Seite geöffnet, damit der Migrierungs-Prozess abgeschlossen werden kann.'; +$_lang['stercseo.migrate_success'] = 'Migrierung erfolgreich abgeschlossen'; +$_lang['stercseo.migrate_success_msg'] = 'Alle Ihre Weiterleitungen wurden erfolgreich migriert.'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/en/default.inc.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/en/default.inc.php new file mode 100644 index 0000000..9577bc3 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/en/default.inc.php @@ -0,0 +1,101 @@ + - Sterc Internet & Marketing + * + * @package stercseo + * @subpackage lexicon + */ + +$_lang['stercseo.seo'] = 'SEO Tab'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Manage all your SEO Tab 301 redirects.'; + +//Tab Findability +$_lang['stercseo.findability'] = 'Findability'; +$_lang['stercseo.index'] = 'Include this page in search engines? (index/noindex)'; +$_lang['stercseo.index_yes'] = 'Yes (index)'; +$_lang['stercseo.index_no'] = 'No (noindex)'; +$_lang['stercseo.index_desc'] = 'You may wish to exclude pages such as disclaimer, terms and conditions and your privacy policy from being indexed by search engines.'; + +$_lang['stercseo.follow'] = 'Follow links on this page? (follow/nofollow)'; +$_lang['stercseo.follow_yes'] = 'Yes (follow)'; +$_lang['stercseo.follow_no'] = 'No (nofollow)'; +$_lang['stercseo.follow_desc'] = 'Should search engines follow links on this page?'; + +$_lang['stercseo.searchable'] = 'Include this page in internal search results?'; +$_lang['stercseo.searchable_yes'] = 'Yes'; +$_lang['stercseo.searchable_no'] = 'No'; +$_lang['stercseo.searchable_desc'] = '"Thank you"-pages and "404 not found"-pages are good examples of pages which should NOT be included.'; + +//Tab Sitemap +$_lang['stercseo.sitemap'] = 'Google Sitemap'; + +$_lang['stercseo.sitemap_include'] = 'Include this page in the Google Sitemap?'; +$_lang['stercseo.sitemap_include_yes'] = 'Yes'; +$_lang['stercseo.sitemap_include_no'] = 'No'; +$_lang['stercseo.sitemap_include_desc'] = 'Set whether this page may or may not be included in the sitemap for Google.'; + +$_lang['stercseo.priority'] = 'Priority'; +$_lang['stercseo.priority_important'] = '1.0 - High'; +$_lang['stercseo.priority_normal'] = '0.5 - Normal'; +$_lang['stercseo.priority_nopriority'] = '0.25 - Low'; +$_lang['stercseo.priority_desc'] = 'Set the priority level to indicate to search engines how important this page is. Higher is more important. Please note: search engines will not blindly accept your priority level!'; + +$_lang['stercseo.changefreq'] = 'Update frequency'; +$_lang['stercseo.changefreq_daily'] = 'Daily'; +$_lang['stercseo.changefreq_weekly'] = 'Weekly'; +$_lang['stercseo.changefreq_monthly'] = 'Monthly'; +$_lang['stercseo.changefreq_desc'] = 'Specify how often you expect the content of this page to change.'; + +//Tab Redirects +$_lang['stercseo.redirects'] = '301 Redirects'; +$_lang['stercseo.uri_add'] = 'Create a 301 redirect'; +$_lang['stercseo.uri_header'] = 'Old URLs redirecting to this page:'; +$_lang['stercseo.grid_noresults'] = '

No redirects

There are no redirects set for this page.

'; +$_lang['stercseo.redirects_desc'] = 'Changing the URL of a page without adding a 301 redirect, will result in losing ALL acquired search engine value of that page. With SEO Tab\'s 301 redirects that value will be retained! To help you, SEO Tab automatically adds 301 redirects when you change the URL of a page. To delete a 301 redirect, right-click on it.'; +$_lang['stercseo.alreadyexists'] = '[[+url]] has already been added to resource: [[+pagetitle]] (id: [[+id]]) - Edit in new window'; +$_lang['stercseo.uri_label'] = 'Old URL'; +$_lang['stercseo.uri_label_desc'] = 'Enter the full URL, including your domain. Example: "https://www.site.tld/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect URL. Please add: http:// or https://'; + +//Tab Freeze URL +$_lang['stercseo.freeze_uri'] = 'Freeze URL'; +$_lang['stercseo.uri_override'] = 'Set a Freeze URL for this page.'; +$_lang['stercseo.uri_after'] = 'URL after '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create user-friendly URLs. +For example, to set this page URL to [[+site_url]]user-friendly-url", enter "user-friendly-url" in the field above.'; + +//Settings +$_lang['setting_stercseo.context-aware-alias'] = '301 Redirects are unique per context'; +$_lang['setting_stercseo.context-aware-alias_desc'] = 'Make old URLs unique to context'; +$_lang['setting_stercseo.index'] = 'Default resource setting: include in search engines'; +$_lang['setting_stercseo.index_desc'] = 'Include new pages in search engines per default'; +$_lang['setting_stercseo.follow'] = 'Default resource setting: following links'; +$_lang['setting_stercseo.follow_desc'] = 'Follow links on new pages per default'; +$_lang['setting_stercseo.sitemap'] = 'Default resource setting: include pages in Google Sitemap'; +$_lang['setting_stercseo.sitemap_desc'] = 'Include new pages in Google Sitemap per default'; +$_lang['setting_stercseo.priority'] = 'Default resource setting: priority'; +$_lang['setting_stercseo.priority_desc'] = 'Priority of page in sitemap.xml (0.25 or 0.5 or 1)'; +$_lang['setting_stercseo.changefreq'] = 'Default resource setting: update frequency'; +$_lang['setting_stercseo.changefreq_desc'] = 'Default frequency (daily, weekly, monthly)'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEO Tab from these usergroups'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEO Tab'; + +// CMP +$_lang['stercseo.redirects.description'] = 'Manage your SEO Tab 301 redirects. +Redirects can also be added when editing a resource by clicking the tab called "SEO".'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect URL'; +$_lang['stercseo.uri'] = 'Old URL (URL to redirect)'; +$_lang['stercseo.target'] = 'New URL / Resource'; +$_lang['stercseo.uri_update'] = 'Update redirect'; +$_lang['stercseo.uri_remove'] = 'Remove redirect'; +$_lang['stercseo.uri_remove_confirm'] = 'Are you sure you want to remove this redirect?'; +$_lang['stercseo.migrate'] = 'Migrate redirects'; +$_lang['stercseo.migrate_desc'] = 'Upgrading to 2.0.0 from 1.* is highly recommended, but it does introduce some risks. SEO Tab 1.* stored the 301 redirects into the properties-column of a resource. SEO Tab 2 stores it in a seperate database table. This means a migration is needed. The migration-process is memory-intensive and might take a very long time, so just let it roll until it mentions a finished migration.

The migration is running while you read this. This page will automatically migrate all the redirects for you, so no action is required, but please keep this page open for SEO Tab to correctly handle the migration process.'; +$_lang['stercseo.migrate_alert'] = 'SEO Tab was updated, but your 301 redirects need to be migrated. Click here to start the migration.'; +$_lang['stercseo.migrate_status'] = 'Status'; +$_lang['stercseo.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; +$_lang['stercseo.migrate_success'] = 'Migration completed'; +$_lang['stercseo.migrate_success_msg'] = 'All your redirects have been successfully migrated.'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/fr/default.inc.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/fr/default.inc.php new file mode 100644 index 0000000..22edc2a --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/fr/default.inc.php @@ -0,0 +1,101 @@ + - Sterc Internet & Marketing + * + * @package stercseo + * @subpackage lexicon + */ + +$_lang['stercseo.seo'] = 'StercSEO'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Gérer tous vos SEO Tab 301 redirects.'; + +//Tab Findability +$_lang['stercseo.findability'] = 'Trouvabilité'; + +$_lang['stercseo.index'] = 'Inclure dans les moteurs de recherche'; +$_lang['stercseo.index_yes'] = 'Oui, cette page peut être indéxée'; +$_lang['stercseo.index_no'] = 'Non, cette page ne doit pas être indéxée (noindex)'; +$_lang['stercseo.index_desc'] = 'Note : certaines pages de votre site ne doivent pas être visibles dans les moteurs de recherche et plan de site (sitemap). Par exemple : disclaimer, termes & conditions d\'utilisation, politique de confidentialité.'; + +$_lang['stercseo.follow'] = 'Suivre les liens'; +$_lang['stercseo.follow_yes'] = 'Oui, suivre les liens de cette page'; +$_lang['stercseo.follow_no'] = 'Non, ne pas suivre les liens de cette page (nofollow)'; +$_lang['stercseo.follow_desc'] = 'Définissez ci les moteurs de recherche doivent (ou ne doivent pas) suivre les liens de cette page'; + +$_lang['stercseo.searchable'] = 'Inclure les pages dans la recherche interne du site'; +$_lang['stercseo.searchable_yes'] = 'Oui, inclure cette page dans la recherche interne'; +$_lang['stercseo.searchable_no'] = 'Non, ne pas inclure cette page dans la recherche interne'; +$_lang['stercseo.searchable_desc'] = 'Indiquez peut être inclue dans la recherche interne de votre site. Un exemple de page qui peut être superflue : la page de remerciement d\'un formulaire de contact.'; + +//Tab Sitemap +$_lang['stercseo.sitemap'] = 'Google Sitemap'; + +$_lang['stercseo.sitemap_include'] = 'Inclure les pages dans Google Sitemap'; +$_lang['stercseo.sitemap_include_yes'] = 'Oui, inclure cette page dans Google Sitemap'; +$_lang['stercseo.sitemap_include_no'] = 'Non, masquer cette page dans Google Sitemap'; +$_lang['stercseo.sitemap_include_desc'] = 'Indiquez si vous souhaitez que cette page apparaîsse dans le plan du site (sitemap) pour Google'; + +$_lang['stercseo.priority'] = 'Priorité'; +$_lang['stercseo.priority_important'] = '1.0 - Élevée'; +$_lang['stercseo.priority_normal'] = '0.5 - Normale'; +$_lang['stercseo.priority_nopriority'] = '0.25 - Faible'; +$_lang['stercseo.priority_desc'] = 'En indiquant un niveau de priorité, vous indiquz aux moteurs de recherche l\'importance de la page. Veuillez noter les moteurs de recherche n\'accepteront pas "aveuglément" vos priorités.'; + +$_lang['stercseo.changefreq'] = 'Fréquence de mise à jour'; +$_lang['stercseo.changefreq_daily'] = 'Journalière'; +$_lang['stercseo.changefreq_weekly'] = 'Hebdomadaire'; +$_lang['stercseo.changefreq_monthly'] = 'Mensuelle'; +$_lang['stercseo.changefreq_desc'] = 'Indiquez la fréquence à laquelle vous estimez que le contenu de cette page sera modifié.'; + +//Tab Redirects +$_lang['stercseo.redirects'] = 'Redirections 301'; +$_lang['stercseo.uri_add'] = 'Ajouter l\'ancienne URL'; +$_lang['stercseo.uri_header'] = 'Indiquez ci-dessous la liste des anciennes URLs de cette page'; +$_lang['stercseo.grid_noresults'] = '

Aucune redirection

Il n\'y a aucune redirection pour cette page.

'; +$_lang['stercseo.redirects_desc'] = 'Un changement sur votre page affecte les moteurs de recherche. Changer l\'URL d\'une page entraînera la perte de la valeur acquise auprès des moteurs de recherche. Avec des redirections 301, vous ne perdez pas cette valeur. StercSEO ajoute automatiquement des redirections 301 lorsque l\'URL d\'une page change.'; +$_lang['stercseo.alreadyexists'] = '[[++site_URI]][[+URI]] a déjà été ajouté à la page : [[+pagetitle]] ([[+id]])'; +$_lang['stercseo.uri_label'] = 'Old URL'; +$_lang['stercseo.uri_label_desc'] = 'Enter the full URL, including your domain. Example: "https://www.google.com/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect url. Please add http:// or https://'; + +//Tab Freeze URL +$_lang['stercseo.freeze_uri'] = 'URL fixe'; +$_lang['stercseo.uri_override'] = 'Indiquez une URL fixe pour cette page'; +$_lang['stercseo.uri_after'] = 'URL après '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create short URLs. +For example, to set this page URL to [[+site_url]]short-url", enter "short-url" in the field below.'; + +//Settings +$_lang['setting_stercseo.context-aware-alias'] = '301 Redirects are unique per context'; +$_lang['setting_stercseo.context-aware-alias_desc'] = 'Make old urls unique to context'; +$_lang['setting_stercseo.index'] = 'Default resource setting: Include in search engines'; +$_lang['setting_stercseo.index_desc'] = 'Include new pages in search engines per default'; +$_lang['setting_stercseo.follow'] = 'Default resource setting: Following links'; +$_lang['setting_stercseo.follow_desc'] = 'Follow links on new pages per default'; +$_lang['setting_stercseo.sitemap'] = 'Default resource setting: Include pages in the Google Sitemap'; +$_lang['setting_stercseo.sitemap_desc'] = 'Include new pages in sitemap.xml per default'; +$_lang['setting_stercseo.priority'] = 'Default resource setting: Priority'; +$_lang['setting_stercseo.priority_desc'] = 'Priority of page in sitemap.xml (0.25 or 0.5 or 1)'; +$_lang['setting_stercseo.changefreq'] = 'Default resource setting: Update frequency'; +$_lang['setting_stercseo.changefreq_desc'] = 'Default frequency (daily, weekly, monthly)'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEO Tab from these usergroups'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEO Tab'; + +// CMP +$_lang['stercseo.redirects.description'] = 'Gérez ici vos redirections 301. Les redirections peuvent également être ajoutées depuis les pages de création et d\'édition de ressources.'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect url'; +$_lang['stercseo.uri'] = 'Ancienne URL (URL à rediriger)'; +$_lang['stercseo.target'] = 'Ressource/URL de destination'; +$_lang['stercseo.uri_update'] = 'Mettre à jour'; +$_lang['stercseo.uri_remove'] = 'Supprimer'; +$_lang['stercseo.uri_remove_confirm'] = 'Êtes-vous sûr de vouloir supprimer cette redirection ?'; +$_lang['stercseo.migrate'] = 'Migrer les redirections'; +$_lang['stercseo.migrate_desc'] = 'Vous pouvez migrez vos redirections (des versions 1.2.2 et antérieures) des propriétés de ressources vers les objets seoUrl. Cette page migrera automatiquement les redirections, aucune action de votre part n\'est requise, mais veuillez garder cette page ouverte afin que SEO Tab puisse gérer correctement le processus de migration.'; +$_lang['stercseo.migrate_alert'] = 'Vos redirections ont besoin d\'être migrées. Cliquez ici pour vous rendre à la page de migration.'; +$_lang['stercseo.migrate_status'] = 'Statut'; +$_lang['stercseo.migrate_running'] = 'Processus de migration en cours. Veuillez garder cette page ouverte dans votre navigateur.'; +$_lang['stercseo.migrate_success'] = 'Migration complète'; +$_lang['stercseo.migrate_success_msg'] = 'Toutes vos redirections ont été migrées avec succès.'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/nl/default.inc.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/nl/default.inc.php new file mode 100644 index 0000000..e05fefe --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/nl/default.inc.php @@ -0,0 +1,101 @@ + - Sterc Internet & Marketing + * + * @package stercseo + * @subpackage lexicon + */ + +$_lang['stercseo.seo'] = 'SEO Tab'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Beheer al je SEO Tab 301 redirects.'; + +//Tab Findability +$_lang['stercseo.findability'] = 'Vindbaarheid'; + +$_lang['stercseo.index'] = 'Pagina opnemen in zoekmachines? (index/noindex)'; +$_lang['stercseo.index_yes'] = 'Ja (index)'; +$_lang['stercseo.index_no'] = 'Nee (noindex)'; +$_lang['stercseo.index_desc'] = 'Let op: het is beter om irrelevante pagina\'s van je website niet op te nemen in zoekmachines. Voorbeelden van irrelevante pagina\'s zijn: disclaimer, algemene voorwaarden, privacy policy.'; + +$_lang['stercseo.follow'] = 'Links op deze pagina volgen? (follow/nofollow)'; +$_lang['stercseo.follow_yes'] = 'Ja (follow)'; +$_lang['stercseo.follow_no'] = 'Nee (nofollow)'; +$_lang['stercseo.follow_desc'] = 'Stel in of zoekmachines de links op deze pagina wel of niet mogen volgen.'; + +$_lang['stercseo.searchable'] = 'Pagina opnemen in interne zoekresultaten?'; +$_lang['stercseo.searchable_yes'] = 'Ja'; +$_lang['stercseo.searchable_no'] = 'Nee'; +$_lang['stercseo.searchable_desc'] = '"Bedankt"-pagina\'s en "404: niet gevonden"-pagina\'s zijn goede voorbeelden van pagina\'s die je beter niet kunt opnemen in je interne zoekresultaten.'; + +//Tab Sitemap +$_lang['stercseo.sitemap'] = 'Google Sitemap'; + +$_lang['stercseo.sitemap_include'] = 'Pagina opnemen in Google Sitemap?'; +$_lang['stercseo.sitemap_include_yes'] = 'Ja'; +$_lang['stercseo.sitemap_include_no'] = 'Nee'; +$_lang['stercseo.sitemap_include_desc'] = 'Stel in of deze pagina wel of niet mag worden opgenomen in de sitemap voor Google.'; + +$_lang['stercseo.priority'] = 'Prioriteit'; +$_lang['stercseo.priority_important'] = '1.0 - Hoog'; +$_lang['stercseo.priority_normal'] = '0.5 - Normaal'; +$_lang['stercseo.priority_nopriority'] = '0.25 - Laag'; +$_lang['stercseo.priority_desc'] = 'Geef zoekmachines een indicatie van het belang van deze pagina door de prioriteit in te stellen. Let op: je prioriteit wordt niet blindelings overgenomen door zoekmachines!'; + +$_lang['stercseo.changefreq'] = 'Update frequentie'; +$_lang['stercseo.changefreq_daily'] = 'Dagelijks'; +$_lang['stercseo.changefreq_weekly'] = 'Wekelijks'; +$_lang['stercseo.changefreq_monthly'] = 'Maandelijks'; +$_lang['stercseo.changefreq_desc'] = 'Geef aan hoe vaak je verwacht dat deze pagina van inhoud verandert.'; + +//Tab Redirects +$_lang['stercseo.redirects'] = '301 Redirects'; +$_lang['stercseo.uri_add'] = 'Een 301 redirect toevoegen'; +$_lang['stercseo.uri_header'] = 'Oude URL\'s van deze pagina:'; +$_lang['stercseo.grid_noresults'] = '

Geen redirects

Er zijn geen redirects voor deze pagina ingesteld.

'; +$_lang['stercseo.redirects_desc'] = 'Wanneer je de URL van een pagina wijzigt, heeft dit ten gevolge dat je álle opgebouwde zoekmachine-waarde (juice) kwijtraakt. Met SEO Tab\'s 301 redirects houd je deze waarde vast! Om je te assisteren, voegt SEO Tab automatisch 301 redirects toe wanneer je de URL van een pagina wijzigt. Klik met je rechtermuisknop op een 301 redirect om deze te verwijderen.'; +$_lang['stercseo.alreadyexists'] = '[[+url]] is reeds toegevoegd aan de pagina: [[+pagetitle]] ([[+id]]).'; +$_lang['stercseo.uri_label'] = 'Oude URL'; +$_lang['stercseo.uri_label_desc'] = 'Voer een volledige URL in. Bijvoorbeeld: "https://www.site.tld/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Onjuiste URL. Voeg toe: http:// of https://'; + +//Tab Freeze URL +$_lang['stercseo.freeze_uri'] = 'Freeze URL'; +$_lang['stercseo.uri_override'] = 'Stel een Freeze URL in voor deze pagina.'; +$_lang['stercseo.uri_after'] = 'URL ná '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URL\'s kunnen worden gebruikt om URL\'s gebruiksvriendelijk te maken. +Om bijvoorbeeld de URL "[[+site_url]]gebruiksvriendelijke-url" voor deze pagina in te stellen, voer je "gebruiksvriendelijke-url" in.'; + +//Settings +$_lang['setting_stercseo.context-aware-alias'] = '301 redirects zijn uniek per context'; +$_lang['setting_stercseo.context-aware-alias_desc'] = 'Maak oude URL\'s uniek naar context'; +$_lang['setting_stercseo.index'] = 'Standaard bronnen setting: opnemen in zoekmachines'; +$_lang['setting_stercseo.index_desc'] = 'Neem nieuwe pagina\'s standaard op in zoekmachines'; +$_lang['setting_stercseo.follow'] = 'Standaard bronnen setting: links volgen'; +$_lang['setting_stercseo.follow_desc'] = 'Links op nieuwe pagina\'s standaard volgen'; +$_lang['setting_stercseo.sitemap'] = 'Standaard bronnen setting: pagina\'s opnemen in Google Sitemap'; +$_lang['setting_stercseo.sitemap_desc'] = 'Neem nieuwe pagina\'s standaard op in Google Sitemap'; +$_lang['setting_stercseo.priority'] = 'Standaard bronnen setting: prioriteit'; +$_lang['setting_stercseo.priority_desc'] = 'Prioriteit van de pagina in sitemap.xml (0.25 or 0.5 or 1)'; +$_lang['setting_stercseo.changefreq'] = 'Standaard bronnen setting: update frequentie'; +$_lang['setting_stercseo.changefreq_desc'] = 'Standaard frequentie (dagelijks, wekelijks, maandelijks)'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Verberg SEO Tab voor deze gebruikersgroepen'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Komma gescheiden lijst met gebruikersgroepen die geen toegang hebben tot SEO Tab'; + +// CMP +$_lang['stercseo.redirects.description'] = 'Hier kun je je 301 redirects bekijken en beheren. Redirects kunnen ook worden toegevoegd vanuit de bron maak- en updatepagina\'s.'; +$_lang['stercseo.redirects.window_title'] = 'Redirect URL toevoegen'; +$_lang['stercseo.uri'] = 'Oude URL (URL naar redirect)'; +$_lang['stercseo.target'] = 'Nieuwe URL / Bron'; +$_lang['stercseo.uri_update'] = 'Update redirect'; +$_lang['stercseo.uri_remove'] = 'Verwijder redirect'; +$_lang['stercseo.uri_remove_confirm'] = 'Weet je zeker dat je deze redirect wil verwijderen?'; +$_lang['stercseo.migrate'] = 'Migreer redirects'; +$_lang['stercseo.migrate_desc'] = 'Hier kun je je redirects (SEO Tab versie 1.2.2 en ouder) migreren van resource properties naar seoUrl objects. Deze pagina migreert al je redirects automatisch, een handeling is dus niet vereist. Houd a.u.b. wel deze pagina open zodat SEO Tab het migratieproces correct kan afhandelen.'; +$_lang['stercseo.migrate_alert'] = 'Je SEO Tab redirects moeten worden gemigreerd. Klik hier om de migratie te starten.'; +$_lang['stercseo.migrate_status'] = 'Status'; +$_lang['stercseo.migrate_running'] = 'Het migratieproces is momenteel bezig op de achtergrond. Houd deze pagina a.u.b. open in je browser. SLUIT DIT VENSTER NIET!'; +$_lang['stercseo.migrate_success'] = 'Migratieproces voltooid.'; +$_lang['stercseo.migrate_success_msg'] = 'Al je redirects zijn succesvol gemigreerd.'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/ru/default.inc.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/ru/default.inc.php new file mode 100644 index 0000000..0c605f2 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/lexicon/ru/default.inc.php @@ -0,0 +1,101 @@ + - Sterc Internet & Marketing + * + * @package stercseo + * @subpackage lexicon + */ + +$_lang['stercseo.seo'] = 'StercSEO'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Manage all your SEO Tab 301 redirects.'; + +//Tab Findability +$_lang['stercseo.findability'] = 'Видимость'; + +$_lang['stercseo.index'] = 'Индексируемость поисковиками'; +$_lang['stercseo.index_yes'] = 'Да, эта страница может быть индексирована'; +$_lang['stercseo.index_no'] = 'Нет, запретить индексирование (noindex)'; +$_lang['stercseo.index_desc'] = 'Замечание: нерелевантные страницы Вашего сайта должны быть исключены из поисковых систем и sitemap.xml (карты сайта). Примеры нерелевантных страниц: Отказ от ответственности, сроки и условия, политика конфиденциальности.'; + +$_lang['stercseo.follow'] = 'Следование по ссылкам'; +$_lang['stercseo.follow_yes'] = 'Да, следовать ссылкам на этой странице'; +$_lang['stercseo.follow_no'] = 'Нет, не следовать ссылкам на этой странице (nofollow)'; +$_lang['stercseo.follow_desc'] = 'Указывает, смогут ли поисковые системы или нет следовать по ссылкам на этой странице'; + +$_lang['stercseo.searchable'] = 'Участие страницы во внутреннем поиске по сайту'; +$_lang['stercseo.searchable_yes'] = 'Да, эта страница должна участвовать во внутреннем поиске по сайту'; +$_lang['stercseo.searchable_no'] = 'Нет, исключить эту страницу из внутреннего поиске по сайту'; +$_lang['stercseo.searchable_desc'] = 'Указывает, будет ли эта страница учавствовать во внутреннем поиске по вашему сайту. Пример лишней страницы в результатах внутреннего поиска, является страница "Подтверждение отправки заказа/заявки/сообщения".'; + +//Tab Sitemap +$_lang['stercseo.sitemap'] = 'Карта сайта'; + +$_lang['stercseo.sitemap_include'] = 'Включение страницы в Sitemap.xml'; +$_lang['stercseo.sitemap_include_yes'] = 'Да, показывать эту страницу в Sitemap.xml'; +$_lang['stercseo.sitemap_include_no'] = 'Нет, скрыть эту страницу в Sitemap.xml'; +$_lang['stercseo.sitemap_include_desc'] = 'Указывает, будет ли или нет эта страница включена в Sitemap.xml'; + +$_lang['stercseo.priority'] = 'Приоритет'; +$_lang['stercseo.priority_important'] = '1.0 - Высокий'; +$_lang['stercseo.priority_normal'] = '0.5 - Средний'; +$_lang['stercseo.priority_nopriority'] = '0.25 - Низкий'; +$_lang['stercseo.priority_desc'] = 'Присваивая высокий приоритет, Вы показываете поисковым системам важность этой страницы. Однако, обратите внимание: поисковые системы не будут точно следовать вашим установкам, а воспримут это как рекомендацию.'; + +$_lang['stercseo.changefreq'] = 'Частота обновления содержимого'; +$_lang['stercseo.changefreq_daily'] = 'Ежедневно'; +$_lang['stercseo.changefreq_weekly'] = 'Еженедельно'; +$_lang['stercseo.changefreq_monthly'] = 'Ежемесячно'; +$_lang['stercseo.changefreq_desc'] = 'Указывает, как часто (вы ожидаете) может меняться конетент (содержимое) этой страницы'; + +//Tab Redirects +$_lang['stercseo.redirects'] = '301 редиректы'; +$_lang['stercseo.uri_add'] = 'Добавить старый URL'; +$_lang['stercseo.uri_header'] = 'Ниже список старых URL этой страницы'; +$_lang['stercseo.grid_noresults'] = '

Нет редиректов

Для этой страницы редиректы не указаны.

'; +$_lang['stercseo.redirects_desc'] = 'Любые изменения вашей страницы влияют на выдачу в поисковых системах. Изменение URL адреса страницы приведёт к утрате всех наработанных факторов ранжирования. С помощью 301 редиректа Вы не потеряете то, что уже успели заработать. StercSEO автоматически добавляет 301 редиректы (переадресацию), после того, как адрес страницы (URL) изменился.'; +$_lang['stercseo.alreadyexists'] = '[[++site_URI]][[+URI]] был добавлен для страницы: [[+pagetitle]] ([[+id]])'; +$_lang['stercseo.uri_label'] = 'Old URL'; +$_lang['stercseo.uri_label_desc'] = 'Enter the full URL, including your domain. Example: "https://www.google.com/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect url. Please add http:// or https://'; + +//Tab Freeze URL +$_lang['stercseo.freeze_uri'] = 'Заморозить URL'; +$_lang['stercseo.uri_override'] = 'Заморозить URL псевдоним для этой страницы'; +$_lang['stercseo.uri_after'] = 'Часть адреса URL следующая после '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create short URLs. +For example, to set this page URL to [[+site_url]]short-url", enter "short-url" in the field below.'; + +//Settings +$_lang['setting_stercseo.context-aware-alias'] = '301 Redirects are unique per context'; +$_lang['setting_stercseo.context-aware-alias_desc'] = 'Make old urls unique to context'; +$_lang['setting_stercseo.index'] = 'Default resource setting: Include in search engines'; +$_lang['setting_stercseo.index_desc'] = 'Include new pages in search engines per default'; +$_lang['setting_stercseo.follow'] = 'Default resource setting: Following links'; +$_lang['setting_stercseo.follow_desc'] = 'Follow links on new pages per default'; +$_lang['setting_stercseo.sitemap'] = 'Default resource setting: Include pages in the Google Sitemap'; +$_lang['setting_stercseo.sitemap_desc'] = 'Include new pages in sitemap.xml per default'; +$_lang['setting_stercseo.priority'] = 'Default resource setting: Priority'; +$_lang['setting_stercseo.priority_desc'] = 'Priority of page in sitemap.xml (0.25 or 0.5 or 1)'; +$_lang['setting_stercseo.changefreq'] = 'Default resource setting: Update frequency'; +$_lang['setting_stercseo.changefreq_desc'] = 'Default frequency (daily, weekly, monthly)'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEO Tab from these usergroups'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEO Tab'; + +// CMP +$_lang['stercseo.redirects.description'] = 'Here you can view and manage your 301 redirects. Redirects can also be added from the resource create and update pages.'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect url'; +$_lang['stercseo.uri'] = 'Old url (url to redirect)'; +$_lang['stercseo.target'] = 'Target resource / url'; +$_lang['stercseo.uri_update'] = 'Update redirect'; +$_lang['stercseo.uri_remove'] = 'Remove redirect'; +$_lang['stercseo.uri_remove_confirm'] = 'Are you sure you want to remove this redirect?'; +$_lang['stercseo.migrate'] = 'Migrate redirects'; +$_lang['stercseo.migrate_desc'] = 'Here you can migrate your redirects (SEO Tab version 1.2.2 and below) from resource properties to seoUrl objects. This page will automatically migrate all the redirects for you, so no action is required, but please keep this page open for SEO Tab to correctly handle the migration process.'; +$_lang['stercseo.migrate_alert'] = 'Your SEO Tab redirects need to be migrated. Click here to visit the migration page.'; +$_lang['stercseo.migrate_status'] = 'Status'; +$_lang['stercseo.migrate_running'] = 'Currently running migration process. Please keep this page open in your browser.'; +$_lang['stercseo.migrate_success'] = 'Migration completed'; +$_lang['stercseo.migrate_success_msg'] = 'All your redirects have been successfully migrated.'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/schema/stercseo.mysql.schema.xml b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/schema/stercseo.mysql.schema.xml new file mode 100644 index 0000000..ccef200 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/schema/stercseo.mysql.schema.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/metadata.mysql.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/metadata.mysql.php new file mode 100644 index 0000000..b6fce80 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/metadata.mysql.php @@ -0,0 +1,8 @@ + + array ( + 0 => 'seoUrl', + ), +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/mysql/seourl.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/mysql/seourl.class.php new file mode 100644 index 0000000..3d030c9 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/mysql/seourl.class.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/mysql/seourl.map.inc.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/mysql/seourl.map.inc.php new file mode 100644 index 0000000..9e6a84c --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/mysql/seourl.map.inc.php @@ -0,0 +1,43 @@ + 'stercseo', + 'version' => NULL, + 'table' => 'seo_urls', + 'extends' => 'xPDOSimpleObject', + 'fields' => + array ( + 'resource' => 0, + 'url' => '', + 'context_key' => '', + ), + 'fieldMeta' => + array ( + 'resource' => + array ( + 'dbtype' => 'integer', + 'precision' => '10', + 'phptype' => 'int', + 'null' => false, + 'default' => 0, + ), + 'url' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'context_key' => + array ( + 'dbtype' => 'varchar', + 'precision' => '100', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + ), +); diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/seourl.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/seourl.class.php new file mode 100644 index 0000000..e8cac41 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/seourl.class.php @@ -0,0 +1,6 @@ + diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/stercseo.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/stercseo.class.php new file mode 100644 index 0000000..c6518c0 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/model/stercseo/stercseo.class.php @@ -0,0 +1,273 @@ + + * + * This file is part of StercSEO. + * + * StercSEO is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * StercSEO is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * StercSEO; if not, write to the Free Software Foundation, Inc., 59 Temple Place, + * Suite 330, Boston, MA 02111-1307 USA + * + * @package stercseo + */ +/** + * This file is the main class file for StercSEO. + * + * + * @author Sterc + * + * @package stercseo + */ +class StercSEO +{ + + /** + * @access protected + * @var array A collection of preprocessed chunk values. + */ + protected $chunks = array(); + /** + * @access public + * @var modX A reference to the modX object. + */ + public $modx = null; + /** + * @access public + * @var array A collection of properties to adjust StercSEO behaviour. + */ + public $config = array(); + /** + * @access public + * @var modTemplateVar A reference to the stercseo TV which is used to store linked resources. + * The linked resources are stored using this syntax: [contextKey1]:[resourceId1];[contextKey2]:[resourceId2] + * Example: web:1;de:4;es:7;fr:10 + */ + public $stercseoTv = null; + + public $defaults = array(); + + /** + * The StercSEO Constructor. + * + * This method is used to create a new StercSEO object. + * + * @param modX &$modx A reference to the modX object. + * @param array $config A collection of properties that modify StercSEO + * behaviour. + * @return StercSEO A unique StercSEO instance. + */ + public function __construct(modX &$modx, array $config = array()) + { + $this->modx =& $modx; + + $corePath = $this->modx->getOption('stercseo.core_path', null, $modx->getOption('core_path').'components/stercseo/'); + $assetsPath = $this->modx->getOption('stercseo.assets_path', null, $this->modx->getOption('assets_path') . 'components/stercseo/'); + $assetsUrl = $this->modx->getOption('stercseo.assets_url', null, $modx->getOption('assets_url').'components/stercseo/'); + $connectorUrl = $assetsUrl.'connector.php'; + + $this->config = array_merge(array( + 'assetsPath' => $assetsPath, + 'assetsUrl' => $assetsUrl, + 'cssUrl' => $assetsUrl.'css/', + 'jsUrl' => $assetsUrl.'js/', + 'imagesUrl' => $assetsUrl.'images/', + + 'connectorUrl' => $connectorUrl, + + 'corePath' => $corePath, + 'modelPath' => $corePath.'model/', + 'chunksPath' => $corePath.'elements/chunks/', + 'chunkSuffix' => '.chunk.tpl', + 'snippetsPath' => $corePath.'elements/snippets/', + 'processorsPath' => $corePath.'processors/', + 'templatesPath' => $corePath.'templates/', + ), $config); + $this->modx->addPackage('stercseo', $this->config['modelPath']); + /* load stercseo lexicon */ + if ($this->modx->lexicon) { + $this->modx->lexicon->load('stercseo:default'); + } + + $this->defaults = array( + 'index' => $this->modx->getOption('stercseo.index', null, '1'), + 'follow' => $this->modx->getOption('stercseo.follow', null, '1'), + 'search' => $this->modx->getOption('stercseo.search', null, '1'), + 'sitemap' => $this->modx->getOption('stercseo.sitemap', null, '1'), + 'changefreq' => $this->modx->getOption('stercseo.changefreq', null, 'weekly'), + 'priority' => $this->modx->getOption('stercseo.priority', null, '0.5'), + ); + } + + /** + * Get a local configuration option or a namespaced system setting by key. + * + * @param string $key The option key to search for. + * @param array $options An array of options that override local options. + * @param mixed $default The default value returned if the option is not found locally or as a + * namespaced system setting; by default this value is null. + * @return mixed The option value or the default value specified. + */ + public function getOption($key, $options = array(), $default = null) + { + $option = $default; + if (!empty($key) && is_string($key)) { + if ($options != null && array_key_exists($key, $options)) { + $option = $options[$key]; + } elseif (array_key_exists($key, $this->config)) { + $option = $this->config[$key]; + } elseif (array_key_exists("{$this->namespace}.{$key}", $this->modx->config)) { + $option = $this->modx->getOption("{$this->namespace}.{$key}"); + } + } + return $option; + } + + /** + * Gets a Chunk and caches it; also falls back to file-based templates + * for easier debugging. + * + * @access public + * @param string $name The name of the Chunk + * @param array $properties The properties for the Chunk + * @return string The processed content of the Chunk + */ + public function getChunk($name, $properties = array()) + { + $chunk = null; + if (!isset($this->chunks[$name])) { + $chunk = $this->_getTplChunk($name); + if (empty($chunk)) { + $chunk = $this->modx->getObject('modChunk', array('name' => $name), true); + if ($chunk == false) { + return false; + } + } + $this->chunks[$name] = $chunk->getContent(); + } else { + $o = $this->chunks[$name]; + $chunk = $this->modx->newObject('modChunk'); + $chunk->setContent($o); + } + $chunk->setCacheable(false); + return $chunk->process($properties); + } + + /** + * Returns a modChunk object from a template file. + * + * @access private + * @param string $name The name of the Chunk. Will parse to name.chunk.tpl + * @param string $postFix + * @return modChunk/boolean Returns the modChunk object if found, otherwise + * false. + */ + private function _getTplChunk($name, $postFix = '.chunk.tpl') + { + $chunk = false; + $f = $this->config['chunksPath'].strtolower($name).$postFix; + if (file_exists($f)) { + $o = file_get_contents($f); + /** @var modChunk $chunk */ + $chunk = $this->modx->newObject('modChunk'); + $chunk->set('name', $name); + $chunk->setContent($o); + } + return $chunk; + } + + public function sitemap($contextKey = array('web'), $rowTpl = '', $outerTpl = '', $allowSymlinks = '') + { + $c = $this->modx->newQuery('modResource'); + $c->where(array( + array('context_key:IN' => $contextKey, 'published' => 1, 'deleted' => 0), + array('properties:LIKE' => '%"sitemap":"1"%', 'OR:properties:LIKE' => '%"sitemap":null%', 'OR:properties:IS' => null) + )); + if (!$allowSymlinks) { + $c->where(array('class_key:!=' => 'modSymLink')); + } + $resources = $this->modx->getCollection('modResource', $c); + foreach ($resources as $resource) { + $properties = $resource->getProperties('stercseo'); + $editedon = $resource->get('editedon'); + $createdon = $resource->get('createdon'); + $output .= $this->getChunk($rowTpl, array( + 'url' => $this->modx->makeUrl($resource->get('id'), '', '', 'full'), + 'lastmod' => date('c', strtotime((($editedon > 0) ? $editedon : $createdon))), + 'changefreq' => (!empty($properties['changefreq']) ? $properties['changefreq'] : $this->defaults['changefreq']), + 'priority' => (!empty($properties['priority']) ? $properties['priority'] : $this->defaults['priority']), + )); + } + return $this->getChunk($outerTpl, array('wrapper' => $output)); + } + + public function isAllowed($context_key) + { + $allowedContexts = $this->modx->getOption('stercseo.allowed_contexts'); + if ($allowedContexts && !empty($allowedContexts)) { + if (in_array($context_key, explode(',', $allowedContexts))) { + return true; + } else { + return false; + } + } + return true; + } + + public function checkUserAccess($user = false) + { + if (!$user) { + $user = $this->modx->getUser(); + } + $exclUsergroups = explode(',', $this->modx->getOption('stercseo.hide_from_usergroups')); + if (!empty($exclUsergroups)) { + foreach ($exclUsergroups as $exclUserGroup) { + if ($user->isMember($exclUserGroup)) { + return false; + } + } + } + return true; + } + + public function redirectMigrationStatus() + { + $migrationStatus = true; + $migrationStatusSetting = $this->modx->getObject('modSystemSetting', array( + 'key' => 'stercseo.migration_status', + 'namespace' => 'stercseo_custom', + 'value' => '1' + )); + if (!$migrationStatusSetting) { + // Search for modResources with an URL's array within the properties + // If matches are found, it means the migration hasn't finished yet (false) + $resource = $this->modx->getObject('modResource', array( + 'context_key:!=' => 'mgr', + 'properties:LIKE' => '%urls":[{"url":"%' + )); + $migrationStatus = (is_object($resource)) ? false : true; + + // save new migration status + $migrationStatusSetting = $this->modx->getObject('modSystemSetting', array('key' => 'stercseo.migration_status', 'namespace' => 'stercseo_custom')); + if (!$migrationStatusSetting) { + // if there is no system setting, create it + $migrationStatusSetting = $this->modx->newObject('modSystemSetting'); + $migrationStatusSetting->set('key', 'stercseo.migration_status'); + $migrationStatusSetting->set('namespace', 'stercseo_custom'); + } + $migrationStatusSetting->set('value', (int)$migrationStatus); + $migrationStatusSetting->save(); + } + return $migrationStatus; + } +} diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/create.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/create.class.php new file mode 100644 index 0000000..9f3bf45 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/create.class.php @@ -0,0 +1,55 @@ +modx->getObject('modResource', $this->getProperty('resource')); + $encodedUrl = urlencode($this->getProperty('url')); + $url = parse_url($this->getProperty('url')); + + if ($url['scheme'] === null) { + $this->addFieldError('url', $this->modx->lexicon('stercseo.url_missing_protocol')); + + // $encodedUrl = urlencode($this->modx->config['server_protocol'] . '://' . $this->getProperty('url')); + } + + if ($resource) { + $this->object->set('context_key', $resource->get('context_key')); + $pagetitle = $resource->get('pagetitle'); + } + + $seoUrl = $this->modx->getObject($this->classKey, array('url' => $encodedUrl)); + + if ($seoUrl) { + $this->addFieldError( + 'url', + $this->modx->lexicon( + 'stercseo.alreadyexists', + array( + 'url' => $this->getProperty('url'), + 'id' => $seoUrl->get('resource'), + 'pagetitle' => $pagetitle, + 'link' => $this->modx->getOption('manager_url') . '?a=resource/update&id=' . $seoUrl->get('resource') + ) + ) + ); + } + + $this->object->set('url', $encodedUrl); + + return parent::beforeSave(); + } +} + +return 'StercSeoCreateProcessor'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/getlist.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/getlist.class.php new file mode 100644 index 0000000..1ab0ed2 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/getlist.class.php @@ -0,0 +1,62 @@ +getProperty('query'); + if (!empty($query)) { + $c->where(array( + 'url:LIKE' => '%'.$query.'%', + 'OR:resource:LIKE' => '%'.$query.'%', + )); + } + $context_key = $this->getProperty('context_key'); + if (!empty($context_key)) { + $c->where(array( + 'context_key' => $context_key, + )); + } + $resource_id = $this->getProperty('resource_id'); + if (!empty($resource_id)) { + $c->where(array( + 'resource' => $resource_id, + )); + } + return $c; + } + + public function prepareRow(xPDOObject $object) + { + $resourceId = $object->get('resource'); + if ($resourceId) { + $resourceObject = $this->modx->getObject('modResource', $resourceId); + if ($resourceObject) { + $pagetitle = $resourceObject->get('pagetitle'); + $object->set('target', $pagetitle.' ('.$resourceId.')
'.$this->modx->makeUrl($resourceId, '', '', 'full').''); + } + } + $object->set('url', urldecode($object->get('url'))); + + /* Get context name from context. Defaults to context_key */ + $contextName = $object->get('context_key'); + $context = $this->modx->getContext($object->get('context_key')); + if ($context && $context->get('name')) { + $contextName = $context->get('name'); + } + $object->set('context_name', $contextName); + return parent::prepareRow($object); + } +} +return 'StercSeoGetListProcessor'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/migrate.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/migrate.class.php new file mode 100644 index 0000000..7e1c9e9 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/migrate.class.php @@ -0,0 +1,122 @@ +modx->getOption('site_url'); + + $site_urls = array(); + $contexts = $this->modx->getCollection('modContext', array('key:!=' => 'mgr')); + foreach ($contexts as $ctx) { + $context_key = $ctx->get('key'); + $context = $this->modx->getContext($context_key); + if ($context) { + $site_url = $context->getOption('site_url', null, ''); + $base_url = $context->getOption('base_url', null, ''); + } + if (isset($base_url) && !empty($base_url)) { + $site_url = str_replace($base_url, '/', $site_url); + } + $site_urls[$context_key] = $site_url; + } + + $c = $this->modx->newQuery('modResource'); + $c->prepare(); + + $sql = $c->toSql() . ' WHERE ( `modResource`.`context_key` != \'mgr\' AND `modResource`.`properties` LIKE \'%urls":[{"url":"%\' ) LIMIT ' . $queryLimit; + $results = $this->modx->query($sql); + + while ($row = $results->fetch(PDO::FETCH_ASSOC)) { + if ($count > $limit) { + break; + } + $context_key = $row['modResource_context_key']; + + $site_url = $site_urls[$context_key]; + + $properties = json_decode($row['modResource_properties'], true); + + if ($properties['stercseo']['urls']) { + foreach ($properties['stercseo']['urls'] as $urls) { + foreach ($urls as $url) { + $encoded_url = urlencode($site_url.ltrim($url, '/')); + $q = $this->modx->newQuery('seoUrl'); + $q->where(array( + 'url' => $encoded_url + )); + + $query = $q->toSql(); + + // fix for hhvm, which will throw a 500 error if there is an empty query + if (strlen($query) > 0) { + $redirect = $this->modx->query($query); + if (is_object($redirect)) { + continue; + } + } + + // if no matches are found in the block above, this will insert a redirect + $this->modx->exec("INSERT INTO {$this->modx->getTableName('seoUrl')} + SET {$this->modx->escape('url')} = {$this->modx->quote($encoded_url)}, + {$this->modx->escape('resource')} = {$this->modx->quote($row['modResource_id'])}, + {$this->modx->escape('context_key')} = {$this->modx->quote($context_key)}"); + + $count++; + } + } + // reset the urls in properties + $properties['stercseo']['urls'] = ''; + $this->modx->exec("UPDATE {$this->modx->getTableName('modResource')} + SET {$this->modx->escape('properties')} = {$this->modx->quote(json_encode($properties))} + WHERE {$this->modx->escape('id')} = {$this->modx->quote($row['modResource_id'])} "); + } + } + + if ($count == 0) { + $migrationStatus = $this->modx->getObject('modSystemSetting', array('key' => 'stercseo.migration_status', 'namespace' => 'stercseo_custom')); + if (!$migrationStatus) { + $migrationStatus = $this->modx->newObject('modSystemSetting'); + $migrationStatus->set('key', 'stercseo.migration_status'); + $migrationStatus->set('namespace', 'stercseo_custom'); + } + $migrationStatus->set('value', '1'); + $migrationStatus->save(); + $this->log('No 301 redirect urls found in resource properties.'); + } else { + $this->log('-------------------------------------------------------------'); + $this->log($count.' Redirect urls migrated from resource properties to seoUrl objects.'); + } + + return $this->outputArray(array(), $count); + } + + private function log($message) + { + // Decrease log level to enable INFO level logging + // First get the current log level + $logLevel = $this->modx->getOption('log_level'); + $this->modx->setLogLevel(MODx::LOG_LEVEL_INFO); + $logTarget = array( + 'target' => 'FILE', + 'options' => array( + 'filepath' => $this->modx->stercseo->config['assetsPath'], + 'filename' => 'migration.log' + ) + ); + $this->modx->log(MODx::LOG_LEVEL_INFO, $message, $logTarget); + // Set log level back to original + $this->modx->setLogLevel($logLevel); + return; + } +} +return 'StercSeoMigrateProcessor'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/remove.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/remove.class.php new file mode 100644 index 0000000..14d03dd --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/redirect/remove.class.php @@ -0,0 +1,14 @@ +object->get('url')); + if ($existing = $this->modx->getObject($this->classKey, array('url' => $url))) { + $this->addFieldError( + 'url', + $this->modx->lexicon( + 'stercseo.alreadyexists', + array( + 'url' => $this->object->get('url'), + 'id' => $existing->get('resource'), + 'pagetitle' => '', + 'link' => $this->modx->getOption('manager_url') . '?a=resource/update&id=' . $existing->get('resource') + ) + ) + ); + } + $this->object->set('url', $url); + $resource = $this->modx->getObject('modResource', $this->object->get('resource')); + if ($resource) { + $this->object->set('context_key', $resource->get('context_key')); + } + return parent::beforeSave(); + } +} +return 'StercSeoUpdateProcessor'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/resource/getlist.class.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/resource/getlist.class.php new file mode 100644 index 0000000..99e910d --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/resource/getlist.class.php @@ -0,0 +1,43 @@ +where(array( + 'published' => 1, + 'deleted' => 0, + )); + $query = $this->getProperty('query'); + if (!empty($query)) { + $c->where(array( + 'pagetitle:LIKE' => '%'.$query.'%', + 'OR:longtitle:LIKE' => '%'.$query.'%' + )); + } + return $c; + } + + public function prepareRow(xPDOObject $object) + { + $context_key = $object->get('context_key'); + $context = $this->modx->getContext($context_key); + if ($context && $context->get('name')) { + $object->set('pagetitle', $object->get('pagetitle').' ('.$context->get('name').')'); + } + + return parent::prepareRow($object); + } + +} +return 'StercSeoResourceGetListProcessor'; diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/url/return.php b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/url/return.php new file mode 100644 index 0000000..5c9745f --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/processors/mgr/url/return.php @@ -0,0 +1,31 @@ +error->failure($this->modx->lexicon('stercseo.url_missing_protocol')); +} + +$w = array( + 'url' => $convertedUrl +); + +$resource = $modx->getObject('modResource', $scriptProperties['id']); +if ($modx->getOption('stercseo.context-aware-alias', null, '0') && $resource) { + $w['context_key'] = $resource->get('context_key'); +} + +$alreadyExists = $modx->getObject('seoUrl', $w); +if ($alreadyExists) { + $target = $modx->getObject('modResource', $alreadyExists->get('resource')); + return $modx->error->failure( + $modx->lexicon('stercseo.alreadyexists', array( + 'url' => $scriptProperties['url'], + 'id' => $alreadyExists->get('resource'), + 'pagetitle' => ($target ? $target->get('pagetitle') : ''), + 'link' => $modx->getOption('manager_url') . '?a=resource/update&id=' . $alreadyExists->get('resource') + )) + ); +} + +return $modx->error->success('', $scriptProperties); diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/templates/home.tpl b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/templates/home.tpl new file mode 100644 index 0000000..53381b0 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/templates/home.tpl @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/templates/migrate.tpl b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/templates/migrate.tpl new file mode 100644 index 0000000..f7cb09b --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modCategory/907ce229a7a4529ab87c0773ee03532c/1/stercseo/templates/migrate.tpl @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modMenu/4295eeadad7599cd0d50b84583f1738f.vehicle b/_packages/stercseo-2.0.0-pl/modMenu/4295eeadad7599cd0d50b84583f1738f.vehicle new file mode 100644 index 0000000..1ab5b91 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modMenu/4295eeadad7599cd0d50b84583f1738f.vehicle @@ -0,0 +1,30 @@ + true, + 'update_object' => true, + 'unique_key' => 'text', + 'related_objects' => true, + 'related_object_attributes' => + array ( + 'Action' => + array ( + 'preserve_keys' => false, + 'update_object' => true, + 'unique_key' => + array ( + 0 => 'namespace', + 1 => 'controller', + ), + ), + ), + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => '42f8af5cb82410f04f56d2cd12a5f7c0', + 'package' => 'modx', + 'class' => 'modMenu', + 'signature' => '4295eeadad7599cd0d50b84583f1738f', + 'native_key' => 'stercseo.seotab', + 'object' => '{"text":"stercseo.seotab","parent":"components","action":"home","description":"stercseo.menu_desc","icon":"","menuindex":0,"params":"","handler":"","permissions":"","namespace":"stercseo"}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modNamespace/33f4d63e4de81d8b17c04af4481e53ca.vehicle b/_packages/stercseo-2.0.0-pl/modNamespace/33f4d63e4de81d8b17c04af4481e53ca.vehicle new file mode 100644 index 0000000..f65e374 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modNamespace/33f4d63e4de81d8b17c04af4481e53ca.vehicle @@ -0,0 +1,18 @@ + 'name', + 'preserve_keys' => true, + 'update_object' => true, + 'resolve_files' => true, + 'resolve_php' => true, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => '5fe23d6c6c42fd01a925faed1b5e9f9e', + 'package' => 'modx', + 'class' => 'modNamespace', + 'signature' => '33f4d63e4de81d8b17c04af4481e53ca', + 'native_key' => 'stercseo', + 'object' => '{"name":"stercseo","path":"{core_path}components\\/stercseo\\/","assets_path":"{assets_path}components\\/stercseo\\/"}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/199b364dbc43edb4b562dae594587009.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/199b364dbc43edb4b562dae594587009.vehicle new file mode 100644 index 0000000..3ae442e --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/199b364dbc43edb4b562dae594587009.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => 'b9cae45b1c3dada918e5b10468908523', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => '199b364dbc43edb4b562dae594587009', + 'native_key' => 'stercseo.priority', + 'object' => '{"key":"stercseo.priority","value":"0.5","xtype":"textfield","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/2e871a83945f6f5a206ba70ba5f910c7.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/2e871a83945f6f5a206ba70ba5f910c7.vehicle new file mode 100644 index 0000000..ab5b53c --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/2e871a83945f6f5a206ba70ba5f910c7.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => 'd950948f56aec653622f502b796e445f', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => '2e871a83945f6f5a206ba70ba5f910c7', + 'native_key' => 'stercseo.context-aware-alias', + 'object' => '{"key":"stercseo.context-aware-alias","value":"0","xtype":"combo-boolean","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/4cf80a2dc46ecf7f2b67e2813af1e32a.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/4cf80a2dc46ecf7f2b67e2813af1e32a.vehicle new file mode 100644 index 0000000..89584e1 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/4cf80a2dc46ecf7f2b67e2813af1e32a.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => 'cb09a1c2694b93ed8d2edcbaae41719b', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => '4cf80a2dc46ecf7f2b67e2813af1e32a', + 'native_key' => 'stercseo.allowed_contexts', + 'object' => '{"key":"stercseo.allowed_contexts","value":"","xtype":"textfield","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/5067d31a012bfebe4c1d0cf10373c4de.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/5067d31a012bfebe4c1d0cf10373c4de.vehicle new file mode 100644 index 0000000..a7fc417 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/5067d31a012bfebe4c1d0cf10373c4de.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => '8bb37867c400e9d5ce0061269b7a5805', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => '5067d31a012bfebe4c1d0cf10373c4de', + 'native_key' => 'stercseo.index', + 'object' => '{"key":"stercseo.index","value":"1","xtype":"combo-boolean","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/52f4b68c4dbee4806ccf960aae6ff3d0.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/52f4b68c4dbee4806ccf960aae6ff3d0.vehicle new file mode 100644 index 0000000..1d9ece3 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/52f4b68c4dbee4806ccf960aae6ff3d0.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => '2d2439546666b5169991e7b1dc98700f', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => '52f4b68c4dbee4806ccf960aae6ff3d0', + 'native_key' => 'stercseo.sitemap', + 'object' => '{"key":"stercseo.sitemap","value":"1","xtype":"combo-boolean","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/546e44b0e6790bdde0a844e87f891b33.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/546e44b0e6790bdde0a844e87f891b33.vehicle new file mode 100644 index 0000000..09500ce --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/546e44b0e6790bdde0a844e87f891b33.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => 'c00357e141699d0b135e49885e3107f9', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => '546e44b0e6790bdde0a844e87f891b33', + 'native_key' => 'stercseo.follow', + 'object' => '{"key":"stercseo.follow","value":"1","xtype":"combo-boolean","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/71bb5cfe8ab0eb4c370b065e5e00477b.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/71bb5cfe8ab0eb4c370b065e5e00477b.vehicle new file mode 100644 index 0000000..67ed5b2 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/71bb5cfe8ab0eb4c370b065e5e00477b.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => 'ebd23d14c1d635761352f15da02a72d3', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => '71bb5cfe8ab0eb4c370b065e5e00477b', + 'native_key' => 'stercseo.user_email', + 'object' => '{"key":"stercseo.user_email","value":"","xtype":"textfield","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/cea64ec9761f7f4ec5274c674df13862.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/cea64ec9761f7f4ec5274c674df13862.vehicle new file mode 100644 index 0000000..29d4a31 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/cea64ec9761f7f4ec5274c674df13862.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => '59dea56b67953da6da9b688744249689', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => 'cea64ec9761f7f4ec5274c674df13862', + 'native_key' => 'stercseo.user_name', + 'object' => '{"key":"stercseo.user_name","value":"","xtype":"textfield","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/d645cc92f250c430b7ff6dc03ca1ccc2.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/d645cc92f250c430b7ff6dc03ca1ccc2.vehicle new file mode 100644 index 0000000..6819c84 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/d645cc92f250c430b7ff6dc03ca1ccc2.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => 'f838e17170d8e15dde982cc5b71fe7bc', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => 'd645cc92f250c430b7ff6dc03ca1ccc2', + 'native_key' => 'stercseo.hide_from_usergroups', + 'object' => '{"key":"stercseo.hide_from_usergroups","value":"","xtype":"textfield","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/modSystemSetting/eb8aa5a25c0f6595ee43bdf74da507cc.vehicle b/_packages/stercseo-2.0.0-pl/modSystemSetting/eb8aa5a25c0f6595ee43bdf74da507cc.vehicle new file mode 100644 index 0000000..2504b8e --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/modSystemSetting/eb8aa5a25c0f6595ee43bdf74da507cc.vehicle @@ -0,0 +1,16 @@ + 'key', + 'preserve_keys' => true, + 'update_object' => false, + 'namespace' => 'stercseo', + 'resolve' => NULL, + 'validate' => NULL, + 'vehicle_package' => 'transport', + 'vehicle_class' => 'xPDOObjectVehicle', + 'guid' => '63d8b810a3c563b62f7ed19616b8601f', + 'package' => 'modx', + 'class' => 'modSystemSetting', + 'signature' => 'eb8aa5a25c0f6595ee43bdf74da507cc', + 'native_key' => 'stercseo.changefreq', + 'object' => '{"key":"stercseo.changefreq","value":"weekly","xtype":"textfield","namespace":"stercseo","area":"general","editedon":null}', +); \ No newline at end of file diff --git a/_packages/stercseo-2.0.0-pl/setup-options.php b/_packages/stercseo-2.0.0-pl/setup-options.php new file mode 100644 index 0000000..da96b31 --- /dev/null +++ b/_packages/stercseo-2.0.0-pl/setup-options.php @@ -0,0 +1,63 @@ + setup options + * + * @package StercSEO + * @subpackage build + */ +$package = 'StercSEO'; + +$settings = array( + array( + 'key' => 'user_name', + 'value' => '', + 'name' => 'Name' + ), + array( + 'key' => 'user_email', + 'value' => '', + 'name' => 'Email address' + ), +); +switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + foreach ($settings as $key => $setting) { + $settingObject = $modx->getObject( + 'modSystemSetting', + array('key' => strtolower($package) . '.' . $setting['key']) + ); + if ($settingObject) { + $settings[$key]['value'] = $settingObject->get('value'); + } + } + break; + case xPDOTransport::ACTION_UNINSTALL: + break; +} + +/* Hide default setuptoptions text */ +$output[] = ' + + + + +

Get free priority updates

+

Enter your name and email address below to receive priority updates about our extras. +Be the first to know about updates and new features. +It is NOT required to enter your name and email to use this extra.

'; + +foreach ($settings as $setting) { + $str = ''; + $str .= ''; + + $output[] = $str; +} + +return implode('

', $output); diff --git a/assets/components/stercseo/js/mgr/sections/resource.js b/assets/components/stercseo/js/mgr/sections/resource.js index a79e0e1..e351b85 100644 --- a/assets/components/stercseo/js/mgr/sections/resource.js +++ b/assets/components/stercseo/js/mgr/sections/resource.js @@ -3,14 +3,6 @@ Ext.onReady(function() { MODx.hideField("modx-panel-resource",["uri_override"]); MODx.hideField("modx-panel-resource", ["searchable"]); - // if(Ext.getCmp('modx-panel-resource').record.properties){ - // StercSEO.record = Ext.getCmp('modx-panel-resource').record.properties.stercseo; - // } - // //console.log(); - // Ext.getCmp('modx-panel-resource').on('success', function(record){ - // console.log(record); - // }); - //Add new tab MODx.addTab("modx-resource-tabs",{ title:"SEO" @@ -133,7 +125,6 @@ Ext.onReady(function() { },{ xtype: 'label' ,forId: 'pagetitle' - ,text: _('stercseo.sitemap_include_desc') ,cls: 'desc-under' },{ xtype: 'modx-combo' @@ -229,9 +220,11 @@ Ext.onReady(function() { check: function(){ if(this.getValue()){ Ext.getCmp('stercseo-uri').show(); + Ext.getCmp('stercseo-uri-desc').show(); Ext.getCmp('stercseo-uri').setValue(Ext.getCmp('modx-panel-resource').record.uri); }else{ Ext.getCmp('stercseo-uri').hide(); + Ext.getCmp('stercseo-uri-desc').hide(); Ext.getCmp('stercseo-uri').setValue(); } MODx.fireResourceFormChange(); @@ -239,7 +232,7 @@ Ext.onReady(function() { } },{ xtype: 'textfield' - ,fieldLabel: _('stercseo.uri_after')+MODx.config.site_url + ,fieldLabel: _('stercseo.freeze_uri') ,name: 'uri' ,id: 'stercseo-uri' ,maxLength: 255 @@ -249,7 +242,8 @@ Ext.onReady(function() { },{ xtype: 'label' ,forId: 'pagetitle' - ,text: _('stercseo.uri_after_desc') + ,id: 'stercseo-uri-desc' + ,text: _('stercseo.uri_after_desc',{ site_url: MODx.config.site_url }) ,cls: 'desc-under' },{ xtype: 'hidden' diff --git a/assets/components/stercseo/js/mgr/widgets/redirects.grid.js b/assets/components/stercseo/js/mgr/widgets/redirects.grid.js index 76f0449..7213d6d 100644 --- a/assets/components/stercseo/js/mgr/widgets/redirects.grid.js +++ b/assets/components/stercseo/js/mgr/widgets/redirects.grid.js @@ -11,26 +11,25 @@ StercSEO.grid.Redirects = function(config) { } ,save_action: 'mgr/redirect/updatefromgrid' ,autosave: true - ,fields: ['id','resource','target','url','context_key'] + ,fields: ['id','resource','target','url','context_key','context_name'] ,autoHeight: true ,paging: true ,remoteSort: true ,columns: [{ - header: _('id') - ,dataIndex: 'id' - ,width: 40 - },{ - header: _('stercseo.uri') + header: _('stercseo.uri_label') ,dataIndex: 'url' ,width: 280 + ,menuDisabled:true },{ header: _('stercseo.target') ,dataIndex: 'target' ,width: 240 + ,menuDisabled:true },{ header: _('context') - ,dataIndex: 'context_key' + ,dataIndex: 'context_name' ,width: 80 + ,menuDisabled:true }] ,tbar: [{ text: _('stercseo.uri_add') @@ -45,6 +44,7 @@ StercSEO.grid.Redirects = function(config) { ,hiddenName: 'context_key' ,id: config.id + '-context-filter' ,editable: false + ,width: 250 ,anchor: '100%' ,baseParams: { action: 'context/getlist' @@ -107,7 +107,6 @@ Ext.extend(StercSEO.grid.Redirects,MODx.grid.Grid,{ }); this.addContextMenuItem(m); } - ,createRedirect: function(btn,e) { var createRedirect = MODx.load({ @@ -119,7 +118,6 @@ Ext.extend(StercSEO.grid.Redirects,MODx.grid.Grid,{ createRedirect.show(e.target); } - ,updateRedirect: function(btn,e,isUpdate) { if (!this.menu.record || !this.menu.record.id) return false; @@ -182,9 +180,10 @@ Ext.reg('stercseo-grid-redirects',StercSEO.grid.Redirects); StercSEO.window.Redirect = function(config) { config = config || {}; Ext.applyIf(config,{ - title: _('stercseo.uri_add') + title: _('stercseo.redirects.window_title') ,closeAction: 'close' ,width: 600 + ,autoHeight: true ,url: StercSEO.config.connectorUrl ,action: 'mgr/redirect/create' ,fields: [{ @@ -193,14 +192,20 @@ StercSEO.window.Redirect = function(config) { ,hidden: true },{ xtype: 'textfield' - ,fieldLabel: _('stercseo.uri') + ,fieldLabel: _('stercseo.uri_label') ,name: 'url' ,anchor: '100%' ,height: 'auto' ,allowBlank: false + ,value: MODx.config.site_url + ,listeners: { + afterrender: function(field) { + field.focus(false, 500); + } + } },{ xtype: 'label' - ,text: _('stercseo.uri_label') + ,text: _('stercseo.uri_label_desc') ,cls: 'desc-under' },{ xtype: 'modx-combo' @@ -221,6 +226,9 @@ StercSEO.window.Redirect = function(config) { ,allowBlank: false ,paging: true ,pageSize: 20 + ,typeAhead: true + ,editable: true + ,forceSelection: true }] }); StercSEO.window.Redirect.superclass.constructor.call(this,config); diff --git a/assets/components/stercseo/js/mgr/widgets/resource.grid.js b/assets/components/stercseo/js/mgr/widgets/resource.grid.js index 35c53d7..3ca34a7 100644 --- a/assets/components/stercseo/js/mgr/widgets/resource.grid.js +++ b/assets/components/stercseo/js/mgr/widgets/resource.grid.js @@ -63,14 +63,10 @@ Ext.extend(StercSEO.grid.Items,MODx.grid.Grid,{ var newRecord = new myRecord({ url: r.a.result.object.url }); - var store = Ext.getCmp(id).getStore(); - store.insert(store.getCount(), newRecord); - var JsonData = Ext.encode(Ext.pluck(store.data.items, 'data')); Ext.getCmp('sterceseo-urls').setValue(JsonData); - MODx.fireResourceFormChange(); },scope:this} @@ -85,27 +81,35 @@ Ext.extend(StercSEO.grid.Items,MODx.grid.Grid,{ var id = this.id; if (!this.menu.record) return false; - var selected = Ext.getCmp(id).getSelectionModel().getSelections(); - - if(selected.length>0) { - for(var i=0;i - License: GNU GPLv2 -------------------- +SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google. + +More info and documentation on Github: https://github.com/Sterc/SEOTab + + +Key features of SEO Tab +----------------------- +- Manage search engine visibility (noindex, nofollow) +- Manage internal search engine behavior +- Manage your Google XML Sitemap(s) +- Manage 301 redirects +- Automatically generate 301 redirects when changing a resource URL +- Freeze URL functionality is moved into the SEO-tab + -More info : https://github.com/Sterc/SEOTab \ No newline at end of file +Bugs and feature requests +------------------------- +We greatly value your feedback, feature requests and bug reports. Please issue them on GitHub (https://github.com/Sterc/SEOTab/issues/new). \ No newline at end of file diff --git a/core/components/stercseo/elements/plugins/stercseo.plugin.php b/core/components/stercseo/elements/plugins/stercseo.plugin.php index 41d232a..92486dd 100644 --- a/core/components/stercseo/elements/plugins/stercseo.plugin.php +++ b/core/components/stercseo/elements/plugins/stercseo.plugin.php @@ -1,32 +1,32 @@ * - * This file is part of SEOTab. + * This file is part of SEO Tab. * - * SEOTab is free software; you can redistribute it and/or modify it under the + * SEO Tab is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * - * SEOTab is distributed in the hope that it will be useful, but WITHOUT ANY + * SEO Tab is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with - * SEOTab; if not, write to the Free Software Foundation, Inc., 59 Temple Place, + * SEO Tab; if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * @package stercseo */ /** - * SEOTab Plugin + * SEO Tab Plugin * * * Events: - * OnDocFormPrerender,OnDocFormSave,OnHandleRequest,OnPageNotFound + * OnDocFormPrerender,OnDocFormSave,OnHandleRequest,OnPageNotFound, OnResourceDuplicate, OnEmptyThrash, OnResourceBeforeSort * * @author Sterc internet & marketing * @@ -47,7 +47,7 @@ $resource =& $modx->event->params['resource']; if ($resource) { - //First check if SEOTab is allowed in this context + //First check if SEO Tab is allowed in this context if (!$stercseo->isAllowed($resource->get('context_key'))) { return; } @@ -136,10 +136,10 @@ 'changefreq' => (isset($_POST['changefreq']) ? $_POST['changefreq'] : $modx->getOption('stercseo.changefreq', null, 'weekly')) ); } - + // If uri is changed or alias (with freeze uri off) has changed, add a new redirect if (($oldResource->get('uri') != $resource->get('uri') || - ($oldResource->get('uri_override') == 0 && $oldResource->get('alias') != $resource->get('alias'))) && + ($oldResource->get('uri_override') == 0 && $oldResource->get('alias') != $resource->get('alias'))) && $oldResource->get('uri') != '') { $url = urlencode($modx->getOption('site_url').$oldResource->get('uri')); if (!$modx->getCount('seoUrl', array('url' => $url))) { @@ -181,39 +181,81 @@ $resource->setProperties($newProperties, 'stercseo'); break; + case 'OnDocFormSave': + if (!$stercseo->isAllowed($resource->context_key)) { + return; + } + + $url = urlencode($modx->makeUrl($resource->id, $resource->context_key, '', 'full')); + $urlExists = $modx->getObject('seoUrl', [ + 'url' => $url, + 'context_key' => $resource->context_key + ]); + + if ($urlExists) { + $modx->removeObject('seoUrl', [ + 'url' => $url, + 'context_key' => $resource->context_key + ]); + } + break; + case 'OnLoadWebDocument': if ($modx->resource) { if (!$stercseo->isAllowed($modx->resource->get('context_key'))) { return; } $properties = $modx->resource->getProperties('stercseo'); - $metaContent = array('noopd', 'noydir'); - if (!$properties['index']) { - $metaContent[] = 'noindex'; - } - if (!$properties['follow']) { - $metaContent[] = 'nofollow'; + if (empty($properties)) { + // Properties not available + // This means an this resource has nog SEO Tab properties, which means it is a pre-SEO Tab resource + // Fallback to system defaults + $properties = array( + 'index' => $modx->getOption('stercseo.index', null, 1), + 'follow' => $modx->getOption('stercseo.follow', null, 1) + ); } + $metaContent = array('noodp', 'noydir'); + $metaContent[] = (intval($properties['index']) ? 'index' : 'noindex'); + $metaContent[] = (intval($properties['follow']) ? 'follow' : 'nofollow'); + $modx->setPlaceholder('seoTab.robotsTag', implode(',', $metaContent)); } break; case 'OnPageNotFound': - $url = $modx->getOption('server_protocol').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; + $options = array(); + $url = $modx->getOption('server_protocol').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $convertedUrl = urlencode($url); - + $w = array( 'url' => $convertedUrl ); - + if ($modx->getOption('stercseo.context-aware-alias', null, '0')) { $w['context_key'] = $modx->context->key; } - + $alreadyExists = $modx->getObject('seoUrl', $w); + + if (isset($alreadyExists) && ($modx->context->key !== $alreadyExists->get('context_key'))) { + $q = $modx->newQuery('modContextSetting'); + $q->where([ + 'context_key' => $alreadyExists->get('context_key'), + 'key' => 'site_url' + ]); + $q->prepare(); + + $siteUrl = $modx->getObject('modContextSetting', $q); + if ($siteUrl) { + $options['site_url'] = $siteUrl->get('value'); + } + } + if ($alreadyExists) { - $id = $modx->makeUrl($alreadyExists->get('resource'), $alreadyExists->get('context_key'), '', 'full'); - $modx->sendRedirect($id, 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently'); + $url = $modx->makeUrl($alreadyExists->get('resource'), $alreadyExists->get('context_key'), '', 'full', $options); + + $modx->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently'); } break; @@ -236,7 +278,7 @@ if ($oldResource->get('uri') != $resource->get('uri') && $oldResource->get('uri') != '') { $uriChanged = true; } - + // Recursive set redirects for drag/dropped resource, and its children (where uri_override is not set) if ($uriChanged && $modx->getOption('use_alias_path')) { $oldResource->set('isfolder', true); @@ -295,5 +337,15 @@ $modx->regClientStartupHTMLBlock($stercseo->getChunk('migrate/alert', array('message' => $modx->lexicon('stercseo.migrate_alert')))); $modx->regClientCSS($stercseo->config['cssUrl'].'migrate.css'); } + break; + + case 'OnEmptyTrash': + if (count($ids) > 0) { + foreach ($ids as $id) { + $modx->removeCollection('seoUrl', array( + 'resource' => $id + )); + } + } } -return; +return; \ No newline at end of file diff --git a/core/components/stercseo/lexicon/de/default.inc.php b/core/components/stercseo/lexicon/de/default.inc.php index 6a41e76..ddfcdf9 100644 --- a/core/components/stercseo/lexicon/de/default.inc.php +++ b/core/components/stercseo/lexicon/de/default.inc.php @@ -10,10 +10,10 @@ */ $_lang['stercseo.seo'] = 'StercSEO'; -$_lang['stercseo.seotab'] = 'SEOTab'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Verwalten Sie alle Ihre SEO Tab 301 redirects.'; //Tab Findability - $_lang['stercseo.findability'] = 'Sichtbarkeit'; $_lang['stercseo.index'] = 'In Suchmaschinen anzeigen'; @@ -51,7 +51,6 @@ $_lang['stercseo.changefreq_monthly'] = 'Monatlich'; $_lang['stercseo.changefreq_desc'] = 'Geben Sie an wie oft der Inhalt dieser Seite sich voraussichtlich ändern wird.'; - //Tab Redirects $_lang['stercseo.redirects'] = '301 Weiterleitungen'; $_lang['stercseo.uri_add'] = 'Alte URL hinzufügen'; @@ -59,12 +58,16 @@ $_lang['stercseo.grid_noresults'] = '

Keine Weiterleitungen

Es gibt keine Weiterleitungen für diese Seite

'; $_lang['stercseo.redirects_desc'] = 'Jede Änderung an einer Seite beeinflusst Suchmaschinen. Wenn die URL einer Seite geändert wird verliert Sie Ihren gesamten Wert für Suchmaschinen. Mit 301 Weiterleitungen verliert Sie Ihren Wert nicht. 301 Weiterleitungen werden automatisch hinzufügt wenn Sie die URL ändern.'; $_lang['stercseo.alreadyexists'] = '[[++site_URI]][[+URI]] existiert bereits für folgende Seite: [[+pagetitle]] ([[+id]])'; -$_lang['stercseo.uri_label'] = 'Geben Sie die komplette URL (z.B. http://www.google.com) an, auf die Sie weiterleiten wollen'; +$_lang['stercseo.uri_label'] = 'Alte URL'; +$_lang['stercseo.uri_label_desc'] = 'Geben Sie die komplette URL. z.B. "https://www.google.com/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect url. Please add http:// or https://'; //Tab Freeze URL $_lang['stercseo.freeze_uri'] = 'Feste URL'; $_lang['stercseo.uri_override'] = 'Legen Sie eine feste URL für diese Seite fest'; $_lang['stercseo.uri_after'] = 'URL nach '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create short URLs. +For example, to set this page URL to [[+site_url]]short-url", enter "short-url" in the field below.'; //Settings $_lang['setting_stercseo.context-aware-alias'] = '301 Weiterleitungen sind eindeutig pro Kontext'; @@ -79,19 +82,20 @@ $_lang['setting_stercseo.priority_desc'] = 'Wichtigkeit von neuen Seiten (0.25, 0.5 oder 1)'; $_lang['setting_stercseo.changefreq'] = 'Voreinstellung: Update Frequenz'; $_lang['setting_stercseo.changefreq_desc'] = 'Update Frequenz für neue Seiten (daily, weekly, monthly)'; -$_lang['setting_stercseo.hide_from_usergroups'] = 'SEOTab für diese Benutzergruppen verbergen'; -$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Kommaseparierte Liste von Benutzergruppen, denen nicht erlaubt ist, auf SEOTab zuzugreifen'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'SEO Tab für diese Benutzergruppen verbergen'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Kommaseparierte Liste von Benutzergruppen, denen nicht erlaubt ist, auf SEO Tab zuzugreifen'; // CMP $_lang['stercseo.redirects.description'] = 'Hier können Sie Ihre 301 Weiterleitungen anschauen und bearbeiten. Weiterleitungen können ebenso auf den Ressourcen Seiten beim Anlegen und Bearbeiten hinzugefügt werden.'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect url'; $_lang['stercseo.uri'] = 'Alte URL (weitergeleitete URL)'; $_lang['stercseo.target'] = 'Ziel Ressource / URL'; $_lang['stercseo.uri_update'] = 'Weiterleitung bearbeiten'; $_lang['stercseo.uri_remove'] = 'Weiterleitung löschen'; $_lang['stercseo.uri_remove_confirm'] = 'Sind Sie sicher, dass Sie diese Weiterleitung löschen wollen?'; $_lang['stercseo.migrate'] = 'Weiterleitung migrieren'; -$_lang['stercseo.migrate_desc'] = 'Sie können Ihre Weiterleitung (SEOTab version 1.2.2 und niedriger) von Ressourcen Eigenschaften zu eigenständigen seoURL Objekten migireren. Dies wird automatisch die Daten aller Weiterleitungen für Sie migrieren. Es ist keine weitere Aktion notwendig. Bitte lassen Sie diese Seite geöffnet, damit SEOTab die Migrierung korrekt beenden kann.'; -$_lang['stercseo.migrate_alert'] = 'Ihre SEOTab Weiterleitungen müssen migriert werden, bitte klicken Sie hier um die Migrierungs Seite anzuzeigen.'; +$_lang['stercseo.migrate_desc'] = 'Sie können Ihre Weiterleitung (SEO Tab version 1.2.2 und niedriger) von Ressourcen Eigenschaften zu eigenständigen seoURL Objekten migireren. Dies wird automatisch die Daten aller Weiterleitungen für Sie migrieren. Es ist keine weitere Aktion notwendig. Bitte lassen Sie diese Seite geöffnet, damit SEO Tab die Migrierung korrekt beenden kann.'; +$_lang['stercseo.migrate_alert'] = 'Ihre SEO Tab Weiterleitungen müssen migriert werden, bitte klicken Sie hier um die Migrierungs Seite anzuzeigen.'; $_lang['stercseo.migrate_status'] = 'Status'; $_lang['stercseo.migrate_running'] = 'Der Migrierungs-Prozess läuft momentan. Bitte lassen Sie diese Seite geöffnet, damit der Migrierungs-Prozess abgeschlossen werden kann.'; $_lang['stercseo.migrate_success'] = 'Migrierung erfolgreich abgeschlossen'; diff --git a/core/components/stercseo/lexicon/en/default.inc.php b/core/components/stercseo/lexicon/en/default.inc.php index 286453a..9577bc3 100644 --- a/core/components/stercseo/lexicon/en/default.inc.php +++ b/core/components/stercseo/lexicon/en/default.inc.php @@ -8,90 +8,94 @@ * @subpackage lexicon */ -$_lang['stercseo.seo'] = 'StercSEO'; -$_lang['stercseo.seotab'] = 'SEOTab'; +$_lang['stercseo.seo'] = 'SEO Tab'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Manage all your SEO Tab 301 redirects.'; //Tab Findability - $_lang['stercseo.findability'] = 'Findability'; +$_lang['stercseo.index'] = 'Include this page in search engines? (index/noindex)'; +$_lang['stercseo.index_yes'] = 'Yes (index)'; +$_lang['stercseo.index_no'] = 'No (noindex)'; +$_lang['stercseo.index_desc'] = 'You may wish to exclude pages such as disclaimer, terms and conditions and your privacy policy from being indexed by search engines.'; -$_lang['stercseo.index'] = 'Include in search engines'; -$_lang['stercseo.index_yes'] = 'Yes, this page may be indexed'; -$_lang['stercseo.index_no'] = 'No, this page should not be indexed (noindex)'; -$_lang['stercseo.index_desc'] = 'Note: irrelevant pages of your site should be excluded from the search engines and sitemap. Examples of irrelevant pages are: disclaimer, terms and conditions , privacy policy.'; - -$_lang['stercseo.follow'] = 'Following links'; -$_lang['stercseo.follow_yes'] = 'Yes, follow links on this page'; -$_lang['stercseo.follow_no'] = 'No, don’t follow links on this page (nofollow)'; -$_lang['stercseo.follow_desc'] = 'Set whether the search engines may or may not follow links on this page'; +$_lang['stercseo.follow'] = 'Follow links on this page? (follow/nofollow)'; +$_lang['stercseo.follow_yes'] = 'Yes (follow)'; +$_lang['stercseo.follow_no'] = 'No (nofollow)'; +$_lang['stercseo.follow_desc'] = 'Should search engines follow links on this page?'; -$_lang['stercseo.searchable'] = 'Include pages in internal search engine'; -$_lang['stercseo.searchable_yes'] = 'Yes, include this page in the internal search engine'; -$_lang['stercseo.searchable_no'] = 'No, hide this page for the internal search engine'; -$_lang['stercseo.searchable_desc'] = 'Set whether this page may be included in the internal search results of your website. An example of a page which is redundant in your search results, is the ‘thank you’ page of a contact form.'; +$_lang['stercseo.searchable'] = 'Include this page in internal search results?'; +$_lang['stercseo.searchable_yes'] = 'Yes'; +$_lang['stercseo.searchable_no'] = 'No'; +$_lang['stercseo.searchable_desc'] = '"Thank you"-pages and "404 not found"-pages are good examples of pages which should NOT be included.'; //Tab Sitemap $_lang['stercseo.sitemap'] = 'Google Sitemap'; -$_lang['stercseo.sitemap_include'] = 'Include pages in the Google Sitemap'; -$_lang['stercseo.sitemap_include_yes'] = 'Yes, include this page in the Google Sitemap'; -$_lang['stercseo.sitemap_include_no'] = 'No, hide this page for the Google Sitemap'; -$_lang['stercseo.sitemap_include_desc'] = 'Set whether this page may or may not be included in the sitemap for Google'; +$_lang['stercseo.sitemap_include'] = 'Include this page in the Google Sitemap?'; +$_lang['stercseo.sitemap_include_yes'] = 'Yes'; +$_lang['stercseo.sitemap_include_no'] = 'No'; +$_lang['stercseo.sitemap_include_desc'] = 'Set whether this page may or may not be included in the sitemap for Google.'; $_lang['stercseo.priority'] = 'Priority'; $_lang['stercseo.priority_important'] = '1.0 - High'; $_lang['stercseo.priority_normal'] = '0.5 - Normal'; $_lang['stercseo.priority_nopriority'] = '0.25 - Low'; -$_lang['stercseo.priority_desc'] = 'By giving the priority level, you give search engines an indication of the importance of the page. Please note: search engines will not blindly accept your priority level.'; +$_lang['stercseo.priority_desc'] = 'Set the priority level to indicate to search engines how important this page is. Higher is more important. Please note: search engines will not blindly accept your priority level!'; $_lang['stercseo.changefreq'] = 'Update frequency'; $_lang['stercseo.changefreq_daily'] = 'Daily'; $_lang['stercseo.changefreq_weekly'] = 'Weekly'; $_lang['stercseo.changefreq_monthly'] = 'Monthly'; -$_lang['stercseo.changefreq_desc'] = 'Specify how often (you expect) the content of this page will be changed.'; - +$_lang['stercseo.changefreq_desc'] = 'Specify how often you expect the content of this page to change.'; //Tab Redirects $_lang['stercseo.redirects'] = '301 Redirects'; -$_lang['stercseo.uri_add'] = 'Add redirect url'; -$_lang['stercseo.uri_header'] = 'Below is a list of old URLs for this page'; +$_lang['stercseo.uri_add'] = 'Create a 301 redirect'; +$_lang['stercseo.uri_header'] = 'Old URLs redirecting to this page:'; $_lang['stercseo.grid_noresults'] = '

No redirects

There are no redirects set for this page.

'; -$_lang['stercseo.redirects_desc'] = 'Any change on your page affect search engines. Changing the URL of a page will lead to losing ALL acquired search engine value. With 301 redirects you don’t lose this value. SEOTab automatically adds 301 redirects after changing the URL of a page ..'; -$_lang['stercseo.alreadyexists'] = '[[+url]] has already been added to resource: [[+pagetitle]] ([[+id]])'; -$_lang['stercseo.uri_label'] = 'Enter the full url (ex. http://www.google.com) you want to redirect'; +$_lang['stercseo.redirects_desc'] = 'Changing the URL of a page without adding a 301 redirect, will result in losing ALL acquired search engine value of that page. With SEO Tab\'s 301 redirects that value will be retained! To help you, SEO Tab automatically adds 301 redirects when you change the URL of a page. To delete a 301 redirect, right-click on it.'; +$_lang['stercseo.alreadyexists'] = '[[+url]] has already been added to resource: [[+pagetitle]] (id: [[+id]]) - Edit in new window'; +$_lang['stercseo.uri_label'] = 'Old URL'; +$_lang['stercseo.uri_label_desc'] = 'Enter the full URL, including your domain. Example: "https://www.site.tld/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect URL. Please add: http:// or https://'; //Tab Freeze URL $_lang['stercseo.freeze_uri'] = 'Freeze URL'; -$_lang['stercseo.uri_override'] = 'Set a Freeze URL for this page'; +$_lang['stercseo.uri_override'] = 'Set a Freeze URL for this page.'; $_lang['stercseo.uri_after'] = 'URL after '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create user-friendly URLs. +For example, to set this page URL to [[+site_url]]user-friendly-url", enter "user-friendly-url" in the field above.'; //Settings $_lang['setting_stercseo.context-aware-alias'] = '301 Redirects are unique per context'; -$_lang['setting_stercseo.context-aware-alias_desc'] = 'Make old urls unique to context'; -$_lang['setting_stercseo.index'] = 'Default resource setting: Include in search engines'; +$_lang['setting_stercseo.context-aware-alias_desc'] = 'Make old URLs unique to context'; +$_lang['setting_stercseo.index'] = 'Default resource setting: include in search engines'; $_lang['setting_stercseo.index_desc'] = 'Include new pages in search engines per default'; -$_lang['setting_stercseo.follow'] = 'Default resource setting: Following links'; +$_lang['setting_stercseo.follow'] = 'Default resource setting: following links'; $_lang['setting_stercseo.follow_desc'] = 'Follow links on new pages per default'; -$_lang['setting_stercseo.sitemap'] = 'Default resource setting: Include pages in the Google Sitemap'; -$_lang['setting_stercseo.sitemap_desc'] = 'Include new pages in sitemap.xml per default'; -$_lang['setting_stercseo.priority'] = 'Default resource setting: Priority'; +$_lang['setting_stercseo.sitemap'] = 'Default resource setting: include pages in Google Sitemap'; +$_lang['setting_stercseo.sitemap_desc'] = 'Include new pages in Google Sitemap per default'; +$_lang['setting_stercseo.priority'] = 'Default resource setting: priority'; $_lang['setting_stercseo.priority_desc'] = 'Priority of page in sitemap.xml (0.25 or 0.5 or 1)'; -$_lang['setting_stercseo.changefreq'] = 'Default resource setting: Update frequency'; +$_lang['setting_stercseo.changefreq'] = 'Default resource setting: update frequency'; $_lang['setting_stercseo.changefreq_desc'] = 'Default frequency (daily, weekly, monthly)'; -$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEOTab from these usergroups'; -$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEOTab'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEO Tab from these usergroups'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEO Tab'; // CMP -$_lang['stercseo.redirects.description'] = 'Here you can view and manage your 301 redirects. Redirects can also be added from the resource create and update pages.'; -$_lang['stercseo.uri'] = 'Old url (url to redirect)'; -$_lang['stercseo.target'] = 'Target resource / url'; +$_lang['stercseo.redirects.description'] = 'Manage your SEO Tab 301 redirects. +Redirects can also be added when editing a resource by clicking the tab called "SEO".'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect URL'; +$_lang['stercseo.uri'] = 'Old URL (URL to redirect)'; +$_lang['stercseo.target'] = 'New URL / Resource'; $_lang['stercseo.uri_update'] = 'Update redirect'; $_lang['stercseo.uri_remove'] = 'Remove redirect'; $_lang['stercseo.uri_remove_confirm'] = 'Are you sure you want to remove this redirect?'; $_lang['stercseo.migrate'] = 'Migrate redirects'; -$_lang['stercseo.migrate_desc'] = 'Here you can migrate your redirects (SEOTab version 1.2.2 and below) from resource properties to seoUrl objects. This page will automatically migrate all the redirects for you, so no action is required, but please keep this page open for SEOTab to correctly handle the migration process.'; -$_lang['stercseo.migrate_alert'] = 'Your SEOTab redirects need to be migrated. Click here to visit the migration page.'; +$_lang['stercseo.migrate_desc'] = 'Upgrading to 2.0.0 from 1.* is highly recommended, but it does introduce some risks. SEO Tab 1.* stored the 301 redirects into the properties-column of a resource. SEO Tab 2 stores it in a seperate database table. This means a migration is needed. The migration-process is memory-intensive and might take a very long time, so just let it roll until it mentions a finished migration.

The migration is running while you read this. This page will automatically migrate all the redirects for you, so no action is required, but please keep this page open for SEO Tab to correctly handle the migration process.'; +$_lang['stercseo.migrate_alert'] = 'SEO Tab was updated, but your 301 redirects need to be migrated. Click here to start the migration.'; $_lang['stercseo.migrate_status'] = 'Status'; -$_lang['stercseo.migrate_running'] = 'Currently running migration process. Please keep this page open in your browser.'; +$_lang['stercseo.migrate_running'] = 'Currently running migration process in the background. Please keep this page open in your browser. DO NOT CLOSE THIS PAGE!'; $_lang['stercseo.migrate_success'] = 'Migration completed'; $_lang['stercseo.migrate_success_msg'] = 'All your redirects have been successfully migrated.'; diff --git a/core/components/stercseo/lexicon/fr/default.inc.php b/core/components/stercseo/lexicon/fr/default.inc.php index d74ae1c..22edc2a 100644 --- a/core/components/stercseo/lexicon/fr/default.inc.php +++ b/core/components/stercseo/lexicon/fr/default.inc.php @@ -1,6 +1,6 @@ - Sterc Internet & Marketing * @@ -9,10 +9,10 @@ */ $_lang['stercseo.seo'] = 'StercSEO'; -$_lang['stercseo.seotab'] = 'SEOTab'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Gérer tous vos SEO Tab 301 redirects.'; //Tab Findability - $_lang['stercseo.findability'] = 'Trouvabilité'; $_lang['stercseo.index'] = 'Inclure dans les moteurs de recherche'; @@ -50,7 +50,6 @@ $_lang['stercseo.changefreq_monthly'] = 'Mensuelle'; $_lang['stercseo.changefreq_desc'] = 'Indiquez la fréquence à laquelle vous estimez que le contenu de cette page sera modifié.'; - //Tab Redirects $_lang['stercseo.redirects'] = 'Redirections 301'; $_lang['stercseo.uri_add'] = 'Ajouter l\'ancienne URL'; @@ -58,12 +57,16 @@ $_lang['stercseo.grid_noresults'] = '

Aucune redirection

Il n\'y a aucune redirection pour cette page.

'; $_lang['stercseo.redirects_desc'] = 'Un changement sur votre page affecte les moteurs de recherche. Changer l\'URL d\'une page entraînera la perte de la valeur acquise auprès des moteurs de recherche. Avec des redirections 301, vous ne perdez pas cette valeur. StercSEO ajoute automatiquement des redirections 301 lorsque l\'URL d\'une page change.'; $_lang['stercseo.alreadyexists'] = '[[++site_URI]][[+URI]] a déjà été ajouté à la page : [[+pagetitle]] ([[+id]])'; -$_lang['stercseo.uri_label'] = 'Enter the full url (ex. http://www.google.com) you want to redirect'; +$_lang['stercseo.uri_label'] = 'Old URL'; +$_lang['stercseo.uri_label_desc'] = 'Enter the full URL, including your domain. Example: "https://www.google.com/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect url. Please add http:// or https://'; //Tab Freeze URL $_lang['stercseo.freeze_uri'] = 'URL fixe'; $_lang['stercseo.uri_override'] = 'Indiquez une URL fixe pour cette page'; $_lang['stercseo.uri_after'] = 'URL après '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create short URLs. +For example, to set this page URL to [[+site_url]]short-url", enter "short-url" in the field below.'; //Settings $_lang['setting_stercseo.context-aware-alias'] = '301 Redirects are unique per context'; @@ -78,18 +81,19 @@ $_lang['setting_stercseo.priority_desc'] = 'Priority of page in sitemap.xml (0.25 or 0.5 or 1)'; $_lang['setting_stercseo.changefreq'] = 'Default resource setting: Update frequency'; $_lang['setting_stercseo.changefreq_desc'] = 'Default frequency (daily, weekly, monthly)'; -$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEOTab from these usergroups'; -$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEOTab'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEO Tab from these usergroups'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEO Tab'; // CMP $_lang['stercseo.redirects.description'] = 'Gérez ici vos redirections 301. Les redirections peuvent également être ajoutées depuis les pages de création et d\'édition de ressources.'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect url'; $_lang['stercseo.uri'] = 'Ancienne URL (URL à rediriger)'; $_lang['stercseo.target'] = 'Ressource/URL de destination'; $_lang['stercseo.uri_update'] = 'Mettre à jour'; $_lang['stercseo.uri_remove'] = 'Supprimer'; $_lang['stercseo.uri_remove_confirm'] = 'Êtes-vous sûr de vouloir supprimer cette redirection ?'; $_lang['stercseo.migrate'] = 'Migrer les redirections'; -$_lang['stercseo.migrate_desc'] = 'Vous pouvez migrez vos redirections (des versions 1.2.2 et antérieures) des propriétés de ressources vers les objets seoUrl. Cette page migrera automatiquement les redirections, aucune action de votre part n\'est requise, mais veuillez garder cette page ouverte afin que SEOTab puisse gérer correctement le processus de migration.'; +$_lang['stercseo.migrate_desc'] = 'Vous pouvez migrez vos redirections (des versions 1.2.2 et antérieures) des propriétés de ressources vers les objets seoUrl. Cette page migrera automatiquement les redirections, aucune action de votre part n\'est requise, mais veuillez garder cette page ouverte afin que SEO Tab puisse gérer correctement le processus de migration.'; $_lang['stercseo.migrate_alert'] = 'Vos redirections ont besoin d\'être migrées. Cliquez ici pour vous rendre à la page de migration.'; $_lang['stercseo.migrate_status'] = 'Statut'; $_lang['stercseo.migrate_running'] = 'Processus de migration en cours. Veuillez garder cette page ouverte dans votre navigateur.'; diff --git a/core/components/stercseo/lexicon/nl/default.inc.php b/core/components/stercseo/lexicon/nl/default.inc.php index 91a1f12..e05fefe 100644 --- a/core/components/stercseo/lexicon/nl/default.inc.php +++ b/core/components/stercseo/lexicon/nl/default.inc.php @@ -1,6 +1,6 @@ - Sterc Internet & Marketing * @@ -8,90 +8,94 @@ * @subpackage lexicon */ -$_lang['stercseo.seo'] = 'StercSEO'; -$_lang['stercseo.seotab'] = 'SEOTab'; +$_lang['stercseo.seo'] = 'SEO Tab'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Beheer al je SEO Tab 301 redirects.'; //Tab Findability - $_lang['stercseo.findability'] = 'Vindbaarheid'; -$_lang['stercseo.index'] = 'Opnemen in zoekmachines'; -$_lang['stercseo.index_yes'] = 'Ja, deze pagina mag geïndexeerd worden'; -$_lang['stercseo.index_no'] = 'Nee, deze pagina mag niet geïndexeerd worden (noindex)'; -$_lang['stercseo.index_desc'] = 'Let op: irrelevante pagina\'s van je site moeten worden weggelaten uit de zoekmachines én sitemap. Voorbeelden van irrelevante pagina\'s zijn: disclaimer, algemene voorwaarden, privacy policy.'; +$_lang['stercseo.index'] = 'Pagina opnemen in zoekmachines? (index/noindex)'; +$_lang['stercseo.index_yes'] = 'Ja (index)'; +$_lang['stercseo.index_no'] = 'Nee (noindex)'; +$_lang['stercseo.index_desc'] = 'Let op: het is beter om irrelevante pagina\'s van je website niet op te nemen in zoekmachines. Voorbeelden van irrelevante pagina\'s zijn: disclaimer, algemene voorwaarden, privacy policy.'; -$_lang['stercseo.follow'] = 'Links volgen'; -$_lang['stercseo.follow_yes'] = 'Ja, volg links op deze pagina'; -$_lang['stercseo.follow_no'] = 'Nee, geen links volgen op deze pagina (nofollow)'; -$_lang['stercseo.follow_desc'] = 'Stel in of zoekmachines de links op deze pagina wel of niet mogen volgen'; +$_lang['stercseo.follow'] = 'Links op deze pagina volgen? (follow/nofollow)'; +$_lang['stercseo.follow_yes'] = 'Ja (follow)'; +$_lang['stercseo.follow_no'] = 'Nee (nofollow)'; +$_lang['stercseo.follow_desc'] = 'Stel in of zoekmachines de links op deze pagina wel of niet mogen volgen.'; -$_lang['stercseo.searchable'] = 'Opnemen in interne zoekmachine'; -$_lang['stercseo.searchable_yes'] = 'Ja, deze pagina opnemen in de interne zoekmachine'; -$_lang['stercseo.searchable_no'] = 'Nee, verberg deze pagina voor de interne zoekmachine'; -$_lang['stercseo.searchable_desc'] = 'Stel in of deze pagina mag worden opgenomen in de interne zoekresultaten van je website. Een voorbeeld van een pagina die overbodig is in je zoekresultaten is de bedankpagina van een contactformulier'; +$_lang['stercseo.searchable'] = 'Pagina opnemen in interne zoekresultaten?'; +$_lang['stercseo.searchable_yes'] = 'Ja'; +$_lang['stercseo.searchable_no'] = 'Nee'; +$_lang['stercseo.searchable_desc'] = '"Bedankt"-pagina\'s en "404: niet gevonden"-pagina\'s zijn goede voorbeelden van pagina\'s die je beter niet kunt opnemen in je interne zoekresultaten.'; //Tab Sitemap $_lang['stercseo.sitemap'] = 'Google Sitemap'; -$_lang['stercseo.sitemap_include'] = 'Opnemen in Google Sitemap'; -$_lang['stercseo.sitemap_include_yes'] = 'Ja, neem deze pagina op in Google Sitemap'; -$_lang['stercseo.sitemap_include_no'] = 'Nee, verberg deze pagina voor Google Sitemap'; -$_lang['stercseo.sitemap_include_desc'] = 'Stel in of deze pagina wel of niet opgenomen mag worden in de sitemap voor Google'; +$_lang['stercseo.sitemap_include'] = 'Pagina opnemen in Google Sitemap?'; +$_lang['stercseo.sitemap_include_yes'] = 'Ja'; +$_lang['stercseo.sitemap_include_no'] = 'Nee'; +$_lang['stercseo.sitemap_include_desc'] = 'Stel in of deze pagina wel of niet mag worden opgenomen in de sitemap voor Google.'; $_lang['stercseo.priority'] = 'Prioriteit'; $_lang['stercseo.priority_important'] = '1.0 - Hoog'; $_lang['stercseo.priority_normal'] = '0.5 - Normaal'; $_lang['stercseo.priority_nopriority'] = '0.25 - Laag'; -$_lang['stercseo.priority_desc'] = 'Geef zoekmachines een indicatie van het belang van deze pagina door de prioriteit in te stellen. Let op: je prioriteit wordt niet blindelings overgenomen door zoekmachines.'; +$_lang['stercseo.priority_desc'] = 'Geef zoekmachines een indicatie van het belang van deze pagina door de prioriteit in te stellen. Let op: je prioriteit wordt niet blindelings overgenomen door zoekmachines!'; $_lang['stercseo.changefreq'] = 'Update frequentie'; $_lang['stercseo.changefreq_daily'] = 'Dagelijks'; $_lang['stercseo.changefreq_weekly'] = 'Wekelijks'; $_lang['stercseo.changefreq_monthly'] = 'Maandelijks'; -$_lang['stercseo.changefreq_desc'] = 'Geef aan hoe vaak je verwacht dat deze pagina verandert van inhoud.'; - +$_lang['stercseo.changefreq_desc'] = 'Geef aan hoe vaak je verwacht dat deze pagina van inhoud verandert.'; //Tab Redirects $_lang['stercseo.redirects'] = '301 Redirects'; -$_lang['stercseo.uri_add'] = 'Oude URL toevoegen'; -$_lang['stercseo.uri_header'] = 'Hieronder staat een overzicht van oude URL\'s voor deze pagina'; +$_lang['stercseo.uri_add'] = 'Een 301 redirect toevoegen'; +$_lang['stercseo.uri_header'] = 'Oude URL\'s van deze pagina:'; $_lang['stercseo.grid_noresults'] = '

Geen redirects

Er zijn geen redirects voor deze pagina ingesteld.

'; -$_lang['stercseo.redirects_desc'] = 'Elke wijziging op je pagina heeft invloed op zoekmachines. Bij het wijzigen van de URL van een pagina betekent dit dat je álle opgebouwde zoekmachine-waarde (juice) kwijtraakt. Met 301 redirects raak je deze waarde niet kwijt. StercSEO voegt automatisch 301 redirects toe na het wijzigen van de URI van je pagina.'; -$_lang['stercseo.alreadyexists'] = '[[++site_URI]][[+URI]] is al toegevoegd aan de pagina: [[+pagetitle]] ([[+id]])'; -$_lang['stercseo.uri_label'] = 'Vul de volledige url (bv. http://www.google.com) die je als redirect wilt toevoegen'; +$_lang['stercseo.redirects_desc'] = 'Wanneer je de URL van een pagina wijzigt, heeft dit ten gevolge dat je álle opgebouwde zoekmachine-waarde (juice) kwijtraakt. Met SEO Tab\'s 301 redirects houd je deze waarde vast! Om je te assisteren, voegt SEO Tab automatisch 301 redirects toe wanneer je de URL van een pagina wijzigt. Klik met je rechtermuisknop op een 301 redirect om deze te verwijderen.'; +$_lang['stercseo.alreadyexists'] = '[[+url]] is reeds toegevoegd aan de pagina: [[+pagetitle]] ([[+id]]).'; +$_lang['stercseo.uri_label'] = 'Oude URL'; +$_lang['stercseo.uri_label_desc'] = 'Voer een volledige URL in. Bijvoorbeeld: "https://www.site.tld/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Onjuiste URL. Voeg toe: http:// of https://'; //Tab Freeze URL $_lang['stercseo.freeze_uri'] = 'Freeze URL'; -$_lang['stercseo.uri_override'] = 'Stel een Freeze URL in voor deze pagina'; +$_lang['stercseo.uri_override'] = 'Stel een Freeze URL in voor deze pagina.'; $_lang['stercseo.uri_after'] = 'URL ná '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URL\'s kunnen worden gebruikt om URL\'s gebruiksvriendelijk te maken. +Om bijvoorbeeld de URL "[[+site_url]]gebruiksvriendelijke-url" voor deze pagina in te stellen, voer je "gebruiksvriendelijke-url" in.'; //Settings -$_lang['setting_stercseo.context-aware-alias'] = '301 Redirects are unique per context'; -$_lang['setting_stercseo.context-aware-alias_desc'] = 'Make old urls unique to context'; -$_lang['setting_stercseo.index'] = 'Default resource setting: Include in search engines'; -$_lang['setting_stercseo.index_desc'] = 'Include new pages in search engines per default'; -$_lang['setting_stercseo.follow'] = 'Default resource setting: Following links'; -$_lang['setting_stercseo.follow_desc'] = 'Follow links on new pages per default'; -$_lang['setting_stercseo.sitemap'] = 'Default resource setting: Include pages in the Google Sitemap'; -$_lang['setting_stercseo.sitemap_desc'] = 'Include new pages in sitemap.xml per default'; -$_lang['setting_stercseo.priority'] = 'Default resource setting: Priority'; -$_lang['setting_stercseo.priority_desc'] = 'Priority of page in sitemap.xml (0.25 or 0.5 or 1)'; -$_lang['setting_stercseo.changefreq'] = 'Default resource setting: Update frequency'; -$_lang['setting_stercseo.changefreq_desc'] = 'Default frequency (daily, weekly, monthly)'; -$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEOTab from these usergroups'; -$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEOTab'; +$_lang['setting_stercseo.context-aware-alias'] = '301 redirects zijn uniek per context'; +$_lang['setting_stercseo.context-aware-alias_desc'] = 'Maak oude URL\'s uniek naar context'; +$_lang['setting_stercseo.index'] = 'Standaard bronnen setting: opnemen in zoekmachines'; +$_lang['setting_stercseo.index_desc'] = 'Neem nieuwe pagina\'s standaard op in zoekmachines'; +$_lang['setting_stercseo.follow'] = 'Standaard bronnen setting: links volgen'; +$_lang['setting_stercseo.follow_desc'] = 'Links op nieuwe pagina\'s standaard volgen'; +$_lang['setting_stercseo.sitemap'] = 'Standaard bronnen setting: pagina\'s opnemen in Google Sitemap'; +$_lang['setting_stercseo.sitemap_desc'] = 'Neem nieuwe pagina\'s standaard op in Google Sitemap'; +$_lang['setting_stercseo.priority'] = 'Standaard bronnen setting: prioriteit'; +$_lang['setting_stercseo.priority_desc'] = 'Prioriteit van de pagina in sitemap.xml (0.25 or 0.5 or 1)'; +$_lang['setting_stercseo.changefreq'] = 'Standaard bronnen setting: update frequentie'; +$_lang['setting_stercseo.changefreq_desc'] = 'Standaard frequentie (dagelijks, wekelijks, maandelijks)'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Verberg SEO Tab voor deze gebruikersgroepen'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Komma gescheiden lijst met gebruikersgroepen die geen toegang hebben tot SEO Tab'; // CMP -$_lang['stercseo.redirects.description'] = 'Here you can view and manage your 301 redirects. Redirects can also be added from the resource create and update pages.'; -$_lang['stercseo.uri'] = 'Old url (url to redirect)'; -$_lang['stercseo.target'] = 'Target resource / url'; +$_lang['stercseo.redirects.description'] = 'Hier kun je je 301 redirects bekijken en beheren. Redirects kunnen ook worden toegevoegd vanuit de bron maak- en updatepagina\'s.'; +$_lang['stercseo.redirects.window_title'] = 'Redirect URL toevoegen'; +$_lang['stercseo.uri'] = 'Oude URL (URL naar redirect)'; +$_lang['stercseo.target'] = 'Nieuwe URL / Bron'; $_lang['stercseo.uri_update'] = 'Update redirect'; -$_lang['stercseo.uri_remove'] = 'Remove redirect'; -$_lang['stercseo.uri_remove_confirm'] = 'Are you sure you want to remove this redirect?'; -$_lang['stercseo.migrate'] = 'Migrate redirects'; -$_lang['stercseo.migrate_desc'] = 'Here you can migrate your redirects (SEOTab version 1.2.2 and below) from resource properties to seoUrl objects. This page will automatically migrate all the redirects for you, so no action is required, but please keep this page open for SEOTab to correctly handle the migration process.'; -$_lang['stercseo.migrate_alert'] = 'Your SEOTab redirects need to be migrated. Click here to visit the migration page.'; +$_lang['stercseo.uri_remove'] = 'Verwijder redirect'; +$_lang['stercseo.uri_remove_confirm'] = 'Weet je zeker dat je deze redirect wil verwijderen?'; +$_lang['stercseo.migrate'] = 'Migreer redirects'; +$_lang['stercseo.migrate_desc'] = 'Hier kun je je redirects (SEO Tab versie 1.2.2 en ouder) migreren van resource properties naar seoUrl objects. Deze pagina migreert al je redirects automatisch, een handeling is dus niet vereist. Houd a.u.b. wel deze pagina open zodat SEO Tab het migratieproces correct kan afhandelen.'; +$_lang['stercseo.migrate_alert'] = 'Je SEO Tab redirects moeten worden gemigreerd. Klik hier om de migratie te starten.'; $_lang['stercseo.migrate_status'] = 'Status'; -$_lang['stercseo.migrate_running'] = 'Currently running migration process. Please keep this page open in your browser.'; -$_lang['stercseo.migrate_success'] = 'Migration completed'; -$_lang['stercseo.migrate_success_msg'] = 'All your redirects have been successfully migrated.'; +$_lang['stercseo.migrate_running'] = 'Het migratieproces is momenteel bezig op de achtergrond. Houd deze pagina a.u.b. open in je browser. SLUIT DIT VENSTER NIET!'; +$_lang['stercseo.migrate_success'] = 'Migratieproces voltooid.'; +$_lang['stercseo.migrate_success_msg'] = 'Al je redirects zijn succesvol gemigreerd.'; diff --git a/core/components/stercseo/lexicon/ru/default.inc.php b/core/components/stercseo/lexicon/ru/default.inc.php index 64ca6fa..0c605f2 100644 --- a/core/components/stercseo/lexicon/ru/default.inc.php +++ b/core/components/stercseo/lexicon/ru/default.inc.php @@ -1,6 +1,6 @@ - Sterc Internet & Marketing * @@ -9,10 +9,10 @@ */ $_lang['stercseo.seo'] = 'StercSEO'; -$_lang['stercseo.seotab'] = 'SEOTab'; +$_lang['stercseo.seotab'] = 'SEO Tab'; +$_lang['stercseo.menu_desc'] = 'Manage all your SEO Tab 301 redirects.'; //Tab Findability - $_lang['stercseo.findability'] = 'Видимость'; $_lang['stercseo.index'] = 'Индексируемость поисковиками'; @@ -50,7 +50,6 @@ $_lang['stercseo.changefreq_monthly'] = 'Ежемесячно'; $_lang['stercseo.changefreq_desc'] = 'Указывает, как часто (вы ожидаете) может меняться конетент (содержимое) этой страницы'; - //Tab Redirects $_lang['stercseo.redirects'] = '301 редиректы'; $_lang['stercseo.uri_add'] = 'Добавить старый URL'; @@ -58,12 +57,16 @@ $_lang['stercseo.grid_noresults'] = '

Нет редиректов

Для этой страницы редиректы не указаны.

'; $_lang['stercseo.redirects_desc'] = 'Любые изменения вашей страницы влияют на выдачу в поисковых системах. Изменение URL адреса страницы приведёт к утрате всех наработанных факторов ранжирования. С помощью 301 редиректа Вы не потеряете то, что уже успели заработать. StercSEO автоматически добавляет 301 редиректы (переадресацию), после того, как адрес страницы (URL) изменился.'; $_lang['stercseo.alreadyexists'] = '[[++site_URI]][[+URI]] был добавлен для страницы: [[+pagetitle]] ([[+id]])'; -$_lang['stercseo.uri_label'] = 'Enter the full url (ex. http://www.google.com) you want to redirect'; +$_lang['stercseo.uri_label'] = 'Old URL'; +$_lang['stercseo.uri_label_desc'] = 'Enter the full URL, including your domain. Example: "https://www.google.com/old-pages/about-us".'; +$_lang['stercseo.url_missing_protocol'] = 'Incorrect url. Please add http:// or https://'; //Tab Freeze URL $_lang['stercseo.freeze_uri'] = 'Заморозить URL'; $_lang['stercseo.uri_override'] = 'Заморозить URL псевдоним для этой страницы'; $_lang['stercseo.uri_after'] = 'Часть адреса URL следующая после '; +$_lang['stercseo.uri_after_desc'] = 'Freeze URLs can be used to create short URLs. +For example, to set this page URL to [[+site_url]]short-url", enter "short-url" in the field below.'; //Settings $_lang['setting_stercseo.context-aware-alias'] = '301 Redirects are unique per context'; @@ -78,19 +81,20 @@ $_lang['setting_stercseo.priority_desc'] = 'Priority of page in sitemap.xml (0.25 or 0.5 or 1)'; $_lang['setting_stercseo.changefreq'] = 'Default resource setting: Update frequency'; $_lang['setting_stercseo.changefreq_desc'] = 'Default frequency (daily, weekly, monthly)'; -$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEOTab from these usergroups'; -$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEOTab'; +$_lang['setting_stercseo.hide_from_usergroups'] = 'Hide SEO Tab from these usergroups'; +$_lang['setting_stercseo.hide_from_usergroups_desc'] = 'Comma separated list of usergroups who are not allowed to access SEO Tab'; // CMP $_lang['stercseo.redirects.description'] = 'Here you can view and manage your 301 redirects. Redirects can also be added from the resource create and update pages.'; +$_lang['stercseo.redirects.window_title'] = 'Add redirect url'; $_lang['stercseo.uri'] = 'Old url (url to redirect)'; $_lang['stercseo.target'] = 'Target resource / url'; $_lang['stercseo.uri_update'] = 'Update redirect'; $_lang['stercseo.uri_remove'] = 'Remove redirect'; $_lang['stercseo.uri_remove_confirm'] = 'Are you sure you want to remove this redirect?'; $_lang['stercseo.migrate'] = 'Migrate redirects'; -$_lang['stercseo.migrate_desc'] = 'Here you can migrate your redirects (SEOTab version 1.2.2 and below) from resource properties to seoUrl objects. This page will automatically migrate all the redirects for you, so no action is required, but please keep this page open for SEOTab to correctly handle the migration process.'; -$_lang['stercseo.migrate_alert'] = 'Your SEOTab redirects need to be migrated. Click here to visit the migration page.'; +$_lang['stercseo.migrate_desc'] = 'Here you can migrate your redirects (SEO Tab version 1.2.2 and below) from resource properties to seoUrl objects. This page will automatically migrate all the redirects for you, so no action is required, but please keep this page open for SEO Tab to correctly handle the migration process.'; +$_lang['stercseo.migrate_alert'] = 'Your SEO Tab redirects need to be migrated. Click here to visit the migration page.'; $_lang['stercseo.migrate_status'] = 'Status'; $_lang['stercseo.migrate_running'] = 'Currently running migration process. Please keep this page open in your browser.'; $_lang['stercseo.migrate_success'] = 'Migration completed'; diff --git a/core/components/stercseo/model/stercseo/stercseo.class.php b/core/components/stercseo/model/stercseo/stercseo.class.php index c70e6fa..c6518c0 100644 --- a/core/components/stercseo/model/stercseo/stercseo.class.php +++ b/core/components/stercseo/model/stercseo/stercseo.class.php @@ -243,18 +243,24 @@ public function checkUserAccess($user = false) public function redirectMigrationStatus() { $migrationStatus = true; - $migrationStatusSetting = $this->modx->getObject('modSystemSetting', array('key' => 'stercseo.migration_status', 'namespace' => 'stercseo_custom', 'value' => '1')); + $migrationStatusSetting = $this->modx->getObject('modSystemSetting', array( + 'key' => 'stercseo.migration_status', + 'namespace' => 'stercseo_custom', + 'value' => '1' + )); if (!$migrationStatusSetting) { - $resources = $this->modx->getIterator('modResource', array('context_key:!=' => 'mgr')); - foreach ($resources as $resource) { - $properties = $resource->getProperties('stercseo'); - if ($properties['urls'] && count($properties['urls']) > 0) { - $migrationStatus = false; - break; - } - } + // Search for modResources with an URL's array within the properties + // If matches are found, it means the migration hasn't finished yet (false) + $resource = $this->modx->getObject('modResource', array( + 'context_key:!=' => 'mgr', + 'properties:LIKE' => '%urls":[{"url":"%' + )); + $migrationStatus = (is_object($resource)) ? false : true; + + // save new migration status $migrationStatusSetting = $this->modx->getObject('modSystemSetting', array('key' => 'stercseo.migration_status', 'namespace' => 'stercseo_custom')); if (!$migrationStatusSetting) { + // if there is no system setting, create it $migrationStatusSetting = $this->modx->newObject('modSystemSetting'); $migrationStatusSetting->set('key', 'stercseo.migration_status'); $migrationStatusSetting->set('namespace', 'stercseo_custom'); diff --git a/core/components/stercseo/processors/mgr/redirect/create.class.php b/core/components/stercseo/processors/mgr/redirect/create.class.php index 633173c..9f3bf45 100644 --- a/core/components/stercseo/processors/mgr/redirect/create.class.php +++ b/core/components/stercseo/processors/mgr/redirect/create.class.php @@ -13,22 +13,43 @@ class StercSeoCreateProcessor extends modObjectCreateProcessor public function beforeSave() { - $url = urlencode($this->object->get('url')); - if ($existing = $this->modx->getObject($this->classKey, array('url' => $url))) { + $pagetitle = ''; + $resource = $this->modx->getObject('modResource', $this->getProperty('resource')); + $encodedUrl = urlencode($this->getProperty('url')); + $url = parse_url($this->getProperty('url')); + + if ($url['scheme'] === null) { + $this->addFieldError('url', $this->modx->lexicon('stercseo.url_missing_protocol')); + + // $encodedUrl = urlencode($this->modx->config['server_protocol'] . '://' . $this->getProperty('url')); + } + + if ($resource) { + $this->object->set('context_key', $resource->get('context_key')); + $pagetitle = $resource->get('pagetitle'); + } + + $seoUrl = $this->modx->getObject($this->classKey, array('url' => $encodedUrl)); + + if ($seoUrl) { $this->addFieldError( 'url', $this->modx->lexicon( 'stercseo.alreadyexists', - array('url' => $this->object->get('url'), 'id' => $existing->get('resource'), 'pagetitle' => '') + array( + 'url' => $this->getProperty('url'), + 'id' => $seoUrl->get('resource'), + 'pagetitle' => $pagetitle, + 'link' => $this->modx->getOption('manager_url') . '?a=resource/update&id=' . $seoUrl->get('resource') + ) ) ); } - $this->object->set('url', $url); - $resource = $this->modx->getObject('modResource', $this->object->get('resource')); - if ($resource) { - $this->object->set('context_key', $resource->get('context_key')); - } + + $this->object->set('url', $encodedUrl); + return parent::beforeSave(); } } + return 'StercSeoCreateProcessor'; diff --git a/core/components/stercseo/processors/mgr/redirect/getlist.class.php b/core/components/stercseo/processors/mgr/redirect/getlist.class.php index faa0427..1ab0ed2 100644 --- a/core/components/stercseo/processors/mgr/redirect/getlist.class.php +++ b/core/components/stercseo/processors/mgr/redirect/getlist.class.php @@ -48,6 +48,14 @@ public function prepareRow(xPDOObject $object) } } $object->set('url', urldecode($object->get('url'))); + + /* Get context name from context. Defaults to context_key */ + $contextName = $object->get('context_key'); + $context = $this->modx->getContext($object->get('context_key')); + if ($context && $context->get('name')) { + $contextName = $context->get('name'); + } + $object->set('context_name', $contextName); return parent::prepareRow($object); } } diff --git a/core/components/stercseo/processors/mgr/redirect/migrate.class.php b/core/components/stercseo/processors/mgr/redirect/migrate.class.php index c53520f..7e1c9e9 100644 --- a/core/components/stercseo/processors/mgr/redirect/migrate.class.php +++ b/core/components/stercseo/processors/mgr/redirect/migrate.class.php @@ -11,22 +11,19 @@ class StercSeoMigrateProcessor extends modProcessor public function process() { $count = 0; - $limit = 2000; + $limit = 1000; + $queryLimit = 100; $site_url = $this->modx->getOption('site_url'); - $site_urls = []; + $site_urls = array(); $contexts = $this->modx->getCollection('modContext', array('key:!=' => 'mgr')); foreach ($contexts as $ctx) { $context_key = $ctx->get('key'); - $site_url_setting = $this->modx->getObject('modContextSetting', array('context_key' => $context_key, 'key' => 'site_url')); - if ($site_url_setting) { - $site_url = $site_url_setting->get('value'); + $context = $this->modx->getContext($context_key); + if ($context) { + $site_url = $context->getOption('site_url', null, ''); + $base_url = $context->getOption('base_url', null, ''); } - $base_url_setting = $this->modx->getObject('modContextSetting', array('context_key' => $context_key, 'key' => 'base_url')); - if ($base_url_setting) { - $base_url = $base_url_setting->get('value'); - } - if (isset($base_url) && !empty($base_url)) { $site_url = str_replace($base_url, '/', $site_url); } @@ -34,19 +31,17 @@ public function process() } $c = $this->modx->newQuery('modResource'); - $c->where(array( - 'context_key:!=' => 'mgr' - )); - $c->prepare(); - $results = $this->modx->query($c->toSql()); + + $sql = $c->toSql() . ' WHERE ( `modResource`.`context_key` != \'mgr\' AND `modResource`.`properties` LIKE \'%urls":[{"url":"%\' ) LIMIT ' . $queryLimit; + $results = $this->modx->query($sql); while ($row = $results->fetch(PDO::FETCH_ASSOC)) { if ($count > $limit) { break; } $context_key = $row['modResource_context_key']; - + $site_url = $site_urls[$context_key]; $properties = json_decode($row['modResource_properties'], true); @@ -59,21 +54,30 @@ public function process() $q->where(array( 'url' => $encoded_url )); - $redirect = $this->modx->query($q->toSql()); - if (!is_object($redirect)) { - $this->modx->exec("INSERT INTO {$this->modx->getTableName('seoUrl')} - SET {$this->modx->escape('url')} = {$this->modx->quote($encoded_url)}, - {$this->modx->escape('resource')} = {$this->modx->quote($row['modResource_id'])}, - {$this->modx->escape('context_key')} = {$this->modx->quote($context_key)}"); - $count++; + $query = $q->toSql(); + + // fix for hhvm, which will throw a 500 error if there is an empty query + if (strlen($query) > 0) { + $redirect = $this->modx->query($query); + if (is_object($redirect)) { + continue; + } } + + // if no matches are found in the block above, this will insert a redirect + $this->modx->exec("INSERT INTO {$this->modx->getTableName('seoUrl')} + SET {$this->modx->escape('url')} = {$this->modx->quote($encoded_url)}, + {$this->modx->escape('resource')} = {$this->modx->quote($row['modResource_id'])}, + {$this->modx->escape('context_key')} = {$this->modx->quote($context_key)}"); + + $count++; } } // reset the urls in properties $properties['stercseo']['urls'] = ''; - $this->modx->exec("UPDATE {$this->modx->getTableName('modResource')} - SET {$this->modx->escape('properties')} = {$this->modx->quote(json_encode($properties))} + $this->modx->exec("UPDATE {$this->modx->getTableName('modResource')} + SET {$this->modx->escape('properties')} = {$this->modx->quote(json_encode($properties))} WHERE {$this->modx->escape('id')} = {$this->modx->quote($row['modResource_id'])} "); } } diff --git a/core/components/stercseo/processors/mgr/redirect/update.class.php b/core/components/stercseo/processors/mgr/redirect/update.class.php index fcbc725..f502cd3 100644 --- a/core/components/stercseo/processors/mgr/redirect/update.class.php +++ b/core/components/stercseo/processors/mgr/redirect/update.class.php @@ -19,7 +19,12 @@ public function beforeSave() 'url', $this->modx->lexicon( 'stercseo.alreadyexists', - array('url' => $this->object->get('url'), 'id' => $existing->get('resource'), 'pagetitle' => '') + array( + 'url' => $this->object->get('url'), + 'id' => $existing->get('resource'), + 'pagetitle' => '', + 'link' => $this->modx->getOption('manager_url') . '?a=resource/update&id=' . $existing->get('resource') + ) ) ); } diff --git a/core/components/stercseo/processors/mgr/resource/getlist.class.php b/core/components/stercseo/processors/mgr/resource/getlist.class.php index 2344f1e..99e910d 100644 --- a/core/components/stercseo/processors/mgr/resource/getlist.class.php +++ b/core/components/stercseo/processors/mgr/resource/getlist.class.php @@ -12,5 +12,32 @@ class StercSeoResourceGetListProcessor extends modObjectGetListProcessor public $defaultSortField = 'menuindex'; public $defaultSortDirection = 'ASC'; + public function prepareQueryBeforeCount(xPDOQuery $c) + { + $c->where(array( + 'published' => 1, + 'deleted' => 0, + )); + $query = $this->getProperty('query'); + if (!empty($query)) { + $c->where(array( + 'pagetitle:LIKE' => '%'.$query.'%', + 'OR:longtitle:LIKE' => '%'.$query.'%' + )); + } + return $c; + } + + public function prepareRow(xPDOObject $object) + { + $context_key = $object->get('context_key'); + $context = $this->modx->getContext($context_key); + if ($context && $context->get('name')) { + $object->set('pagetitle', $object->get('pagetitle').' ('.$context->get('name').')'); + } + + return parent::prepareRow($object); + } + } return 'StercSeoResourceGetListProcessor'; diff --git a/core/components/stercseo/processors/mgr/url/return.php b/core/components/stercseo/processors/mgr/url/return.php index d83bd1c..5c9745f 100644 --- a/core/components/stercseo/processors/mgr/url/return.php +++ b/core/components/stercseo/processors/mgr/url/return.php @@ -1,21 +1,31 @@ error->failure($this->modx->lexicon('stercseo.url_missing_protocol')); +} + $w = array( 'url' => $convertedUrl ); + $resource = $modx->getObject('modResource', $scriptProperties['id']); if ($modx->getOption('stercseo.context-aware-alias', null, '0') && $resource) { $w['context_key'] = $resource->get('context_key'); } + $alreadyExists = $modx->getObject('seoUrl', $w); if ($alreadyExists) { $target = $modx->getObject('modResource', $alreadyExists->get('resource')); return $modx->error->failure( $modx->lexicon('stercseo.alreadyexists', array( - 'url' => $scriptProperties['url'], - 'id' => $alreadyExists->get('resource'), - 'pagetitle' => ($target ? $target->get('pagetitle') : '') + 'url' => $scriptProperties['url'], + 'id' => $alreadyExists->get('resource'), + 'pagetitle' => ($target ? $target->get('pagetitle') : ''), + 'link' => $modx->getOption('manager_url') . '?a=resource/update&id=' . $alreadyExists->get('resource') )) ); } + return $modx->error->success('', $scriptProperties);