Пример #1
0
 function main_parts($content)
 {
     if ($this->template == 'admin' && $this->request == 'admin/plugins') {
         $fields['plugins'] = array('type' => 'custom', 'label' => '<a name="plugin_contents">Plugin Settings:</a>', 'html' => '');
         $moduletypes = qa_list_module_types();
         foreach ($moduletypes as $moduletype) {
             $plugins[] = qa_load_modules_with($moduletype, 'option_default');
         }
         $anchors = array();
         foreach ($content as $key => $part) {
             if (strpos($key, 'form_') === 0) {
                 $content[$key]['title'] .= ' <font size="1" style="cursor:pointer; color:blue" onclick="jQuery(document).scrollTop(0)">top</font>';
                 foreach ($content[$key]['fields'] as $idx => $field) {
                     if (isset($field['tags']) && preg_match('|name="([^"]+)"|i', $field['tags'], $name)) {
                         $name = $name[1];
                         foreach ($plugins as $modules) {
                             foreach ($modules as $module) {
                                 $value = $module->option_default($name);
                                 $value = preg_replace('|\\n|', '\\\\n', $value);
                                 $value = str_replace('"', '&quot;', $value);
                                 $value = str_replace('\'', '\\\'', $value);
                                 if (strlen($value)) {
                                     $content[$key]['fields'][$idx]['label'] = @$content[$key]['fields'][$idx]['label'] . '&nbsp;<input type="button" onclick="$(\'[name=' . $name . ']\').val(\'' . $value . '\')" value="r" style="font-size:8pt; width:10px" title="reset to default value">';
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     qa_html_theme_base::main_parts($content);
 }
Пример #2
0
 function main_parts($content)
 {
     if (qa_opt('buddypress_integration_enable') && $this->template == 'user' && !qa_get('tab')) {
         $content = $this->user_buddypress_form($content);
     }
     qa_html_theme_base::main_parts($content);
 }
 function main_parts($content)
 {
     $userid = qa_get_logged_in_userid();
     if (qa_opt('news_plugin_active') && $this->template == 'user' && qa_opt('news_plugin_send') && !qa_get('tab') && $content['raw']['userid'] == $userid) {
         $content['form-newsletter'] = $this->newsletterForm();
     }
     qa_html_theme_base::main_parts($content);
 }
 function main_parts($content)
 {
     if ($this->template == 'user' && qa_get('tab') == 'history' && qa_opt('event_logger_to_database') && qa_opt('user_act_list_active')) {
         $content = array();
         $content['form-activity-list'] = $this->user_activity_form();
     }
     qa_html_theme_base::main_parts($content);
 }
Пример #5
0
 function main_parts($content)
 {
     if (qa_opt('priv_active') && $this->template == 'user' && qa_get('tab') == 'privileges') {
         $content = array();
         $content['form-privileges-list'] = $this->user_priv_form();
         // this shouldn't happen
     }
     qa_html_theme_base::main_parts($content);
 }
Пример #6
0
 function main_parts($content)
 {
     if (qa_opt('badge_active') && $this->template == 'user' && qa_opt('badge_admin_user_field') && (qa_get('tab') == 'badges' || qa_opt('badge_admin_user_field_no_tab')) && isset($content['raw']['userid'])) {
         $userid = $content['raw']['userid'];
         if (!qa_opt('badge_admin_user_field_no_tab')) {
             foreach ($content as $i => $v) {
                 if (strpos($i, 'form') === 0) {
                     unset($content[$i]);
                 }
             }
         }
         $content['form-badges-list'] = qa_badge_plugin_user_form($userid);
     }
     qa_html_theme_base::main_parts($content);
 }
Пример #7
0
    function main_parts($content)
    {
        qa_html_theme_base::main_parts($content);
        if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN and $this->template == 'question' and qa_opt('useo_meta_editor_enable')) {
            $this->output('<div class="qa-widgets-main qa-widgets-main-low">');
            $this->output('<form name="useo-meta-editor" action="' . qa_self_html() . '" method="post">');
            $this->output('
			<h2> Page Title And Meta Tags </h2>
			<strong>Only administrators can see this section.</strong>
			<table class="qa-form-tall-table">
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Page Title
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . $this->content['q_view']['raw']['title'] . '" id="useo-meta-editor-title" class="qa-form-tall-text" type="text" value="' . $this->meta_title . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>

				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Description Meta Tag
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<textarea placeholder="' . $this->content['description'] . '" id="useo-meta-editor-description" class="qa-form-tall-text" cols="40" rows="3" name="useo-meta-editor-description">' . $this->meta_description . '</textarea>
						</td>
					</tr>
				</tbody>
				<tbody id="useo-meta-keywords">
					<tr>
						<td class="qa-form-tall-label">
							Keywords Meta Tag
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . $this->content['keywords'] . '" id="useo-meta-editor-keywords" class="qa-form-tall-text" type="text" value="' . $this->meta_keywords . '" name="useo-meta-editor-keywords">
							<div class="qa-form-tall-note">A comma separated list of your most important keywords</div>
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td  id="useo_buttons_container_meta" class="qa-form-tall-buttons" colspan="1">
							<input id="useo_save_meta" class="qa-form-tall-button qa-form-tall-button-save" type="submit" title="" value="Save Options">
						</td>
					</tr>
				</tbody>
			</table>
			');
            $this->output('</form>');
            $this->output('<hr /></div>');
        }
        if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN and $this->template == 'question' and qa_opt('useo_social_enable_editor')) {
            $this->output('<div class="qa-widgets-main qa-widgets-main-low">');
            $this->output('<form name="useo-meta-editor" action="' . qa_self_html() . '" method="post">');
            $this->output('
			<h2> Social Tags Editor </h2>
			<p>Only administrators can see this section.</p>
			<h3>Open Graph</h3>
			<table class="qa-form-tall-table">
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Site Title
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['og-sitename']['content'] . '" id="useo-og-sitename" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['og-sitename'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Page Title
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['og-title']['content'] . '" id="useo-og-title" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['og-title'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Description Meta Tag
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<textarea placeholder="' . @$this->metas['og-description']['content'] . '" id="useo-og-description" class="qa-form-tall-text" cols="40" rows="3" name="useo-meta-editor-description">' . @$this->social_metas['og-description'] . '</textarea>
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Shared Page\'s URL
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['og-url']['content'] . '" id="useo-og-url" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['og-url'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Thumbnail Image
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['og-image']['content'] . '" id="useo-og-image" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['og-image'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
			</table>
			<h3>Twitter Cards</h3>
			<table class="qa-form-tall-table">
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Page Title
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['tc-title']['content'] . '" id="useo-tc-title" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['tc-title'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Description
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<textarea placeholder="' . @$this->metas['tc-description']['content'] . '" id="useo-tc-description" class="qa-form-tall-text" cols="40" rows="3" name="useo-meta-editor-description">' . @$this->social_metas['tc-description'] . '</textarea>
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Thumbnail Image
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['tc-image']['content'] . '" id="useo-tc-image" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['tc-image'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Twitter Handler
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['tc-handler']['content'] . '" id="useo-tc-handler" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['tc-handler'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
			</table>
			<h3>Google+ Schemas</h3>
			<table class="qa-form-tall-table">
				<tbody>
					<tr>
						<td class="qa-form-tall-label">
							Thumbnail Image
						</td>
					</tr>
					<tr>
						<td class="qa-form-tall-data">
							<input placeholder="' . @$this->metas['gp-image']['content'] . '" id="useo-gp-image" class="qa-form-tall-text" type="text" value="' . @$this->social_metas['gp-image'] . '" name="useo-meta-editor-title">
						</td>
					</tr>
				</tbody>
				<tbody>
					<tr>
						<td  id="useo_buttons_container_social" class="qa-form-tall-buttons" colspan="1">
							<input id="useo_save_social" class="qa-form-tall-button qa-form-tall-button-save" type="submit" title="" value="Save Options">
						</td>
					</tr>
				</tbody>

			</table>
			');
            $this->output('</form>');
            $this->output('<hr /></div>');
        }
    }
Пример #8
0
 function main_parts($content)
 {
     $this->output('<article class="qa-q-content-article' . (qa_opt('it_layout_lists') == 'qlist' ? ' qlist-defaul' : '') . '">');
     qa_html_theme_base::main_parts($content);
     $this->output('</article>');
 }
 function main_parts($content)
 {
     if ($this->template == 'user' && qa_get_logged_in_handle() === $this->_user_handle()) {
         if (qa_get('tab') == qa_opt('expert_question_page_url')) {
             $our_form = $this->expert_question_form();
             $content = array();
             if ($our_form) {
                 $content['form-expert-list'] = $our_form;
             }
         }
     }
     qa_html_theme_base::main_parts($content);
 }
Пример #10
0
 function main_parts($content)
 {
     if (qa_opt('bookmarks_plugin_enable') && $this->template == 'user' && !qa_get('tab')) {
         if ($content['q_list']) {
             // paranoia
             $keys = array_keys($content);
             $vals = array_values($content);
             $insertBefore = array_search('q_list', $keys);
             $keys2 = array_splice($keys, $insertBefore);
             $vals2 = array_splice($vals, $insertBefore);
             $keys[] = 'form-bookmarks-list';
             $vals[] = $this->bookmarks_plugin_form();
             $content = array_merge(array_combine($keys, $vals), array_combine($keys2, $vals2));
         } else {
             $content['form-bookmarks-list'] = $this->bookmarks_plugin_form();
         }
         // this shouldn't happen
     }
     qa_html_theme_base::main_parts($content);
 }
Пример #11
0
 function main_parts($content)
 {
     if ($this->is_print_view) {
         foreach ($content as $key => $part) {
             if (strpos($key, 'custom') === 0) {
                 $this->output_raw($part);
             } elseif (strpos($key, 'form') === 0) {
                 $this->form($part);
             } elseif (strpos($key, 'q_view') === 0) {
                 $this->q_view($part);
             } elseif (strpos($key, 'a_list') === 0) {
                 $this->a_list($part);
             } elseif (strpos($key, 'ranking') === 0) {
                 $this->ranking($part);
             }
         }
     } else {
         qa_html_theme_base::main_parts($content);
     }
 }