function render_start_clone_all_from() { $vars = array('target_lang', 'page'); extract(gpsa($vars)); if (empty($target_lang)) { $this->clone_by_id = gTxt('l10n-no_langs_selected'); return $this->render_article_table(); } # # Init language related vars... # $langs = MLPLanguageHandler::get_site_langs(); $full_lang_count = count($langs); $default_lang = MLPLanguageHandler::get_site_default_lang(); # remove the target from the src list... $langs = array_diff($langs, array($target_lang)); # remove empty source languages from the src list... $langs = array_intersect($langs, array_keys($this->get_rendition_counts())); $langs = MLPLanguageHandler::do_fleshout_names($langs); $name = MLPLanguageHandler::get_native_name_of_lang($target_lang); $o[] = startTable('l10n_clone_all_table', '', '', '5px'); $o[] = '<caption><strong>' . gTxt('l10n-clone_all_from', array('{lang}' => $name . ' [' . $target_lang . '] ')) . '</strong></caption>'; $s = selectInput('clone_from_language', $langs, $default_lang, '', '') . ' '; $s .= '<input type="submit" value="' . gTxt('l10n-clone') . '" class="publish" />' . n; $s .= eInput($this->parent->event); $s .= sInput('clone_all_from'); $s .= hInput('page', $page); $s .= hInput('tab', 'article'); $s .= hInput('target_lang', $target_lang); $f[] = tr(tdrs($s, 1)); $verify = ' verify(\'' . doSlash(gTxt('l10n-verify_clone_all', array('{targ_lang}' => $name . ' [' . $target_lang . ']'))) . '\')'; $o[] = tag(form(join('', $f), '', $verify), 'tbody'); $o[] = endTable(); echo join('', $o); }
function _l10n_make_writeselector() { global $l10n_vars, $l10n_article_message, $l10n_view; $view = gps('view'); $preview = $view === 'preview'; $html = $view === 'html'; $lang = $l10n_vars['article_lang']; $user_sel_lang = cs('rendition_lang_selection'); $user_langs = MLPLanguageHandler::do_fleshout_names(_l10n_get_user_languages()); $r = ''; if (!isset($l10n_view)) { $l10n_view = new MLPPlugin('l10n-localisation', L10N_NAME, 'content'); } // <<<< $reassigning_permitted = '1' === $l10n_view->pref('l10n-allow_writetab_changes'); $has_reassign_privs = has_privs('l10n.reassign'); $id_no = '-'; if (isset($l10n_vars['article_id'])) { $id_no = $l10n_vars['article_id']; } $group_id = '-'; if (isset($l10n_vars['article_group'])) { $group_id = $l10n_vars['article_group']; } if (isset($l10n_article_message)) { $r = strong(htmlspecialchars($l10n_article_message)) . n . br; unset($l10n_article_message); } $r .= 'ID: ' . strong($id_no) . ' / '; if ($group_id == '-') { if (!empty($user_sel_lang)) { $lang = $user_sel_lang; } $r .= gTxt('language') . ': ' . selectInput(L10N_COL_LANG, $user_langs, $lang, '', ' onchange="on_lang_selection_change()"', 'l10n_lang_selector') . ' / '; $r .= gTxt('article') . ': ' . strong($group_id); } else { if ($reassigning_permitted and $has_reassign_privs) { if (!empty($user_sel_lang)) { $lang = $user_sel_lang; } $r .= gTxt('language') . ': ' . selectInput(L10N_COL_LANG, $user_langs, $lang, '', ' onchange="on_lang_selection_change()"', 'l10n_lang_selector') . ' / '; $r .= gTxt('article') . ': ' . fInput('edit', L10N_COL_GROUP, $group_id, '', '', '', '4'); } else { $r .= hInput(L10N_COL_LANG, $lang) . gTxt('language') . ': ' . strong(MLPLanguageHandler::get_native_name_of_lang($lang)) . ' / '; $r .= hInput(L10N_COL_GROUP, $group_id) . gTxt('article') . ': ' . strong($group_id); } } if (!$preview and !$html) { # # Inject direction hyper-link... # $r .= ' / <a href="#" onClick="toggleTextElements()" id="title-toggle">' . gTxt('l10n-toggle') . '</a>'; } $r = graf($r); return $r; }