public function onFilter_DropdownPages($output, $r, $pages)
 {
     if (!StrataRouter::isFrontendAjax()) {
         $currentLocale = Strata::i18n()->getCurrentLocale();
         if ($currentLocale->isDefault()) {
             $selectAsArray = explode("\n", $output);
             foreach ($pages as $idx => $page) {
                 $translation = $currentLocale->getTranslatedPost($page->ID);
                 if (is_null($translation) || (int) $translation->ID !== (int) $page->ID) {
                     $output = preg_replace('/<option.+?value="' . $page->ID . '".+?<\\/option>/', '', $output);
                 }
             }
             return $output;
         }
         return __("Parent page is determined by the default locale.", "polyglot");
     }
     return $output;
 }
예제 #2
0
 /**
  * Returns the localization key in the session array.
  * @return string
  */
 private function getSessionKey()
 {
     if (is_admin() && !Router::isFrontendAjax()) {
         return self::DOMAIN . "_admin";
     }
     return self::DOMAIN . "_front";
 }