示例#1
0
 function get_prev_text($step, $target_element)
 {
     global $process_dictionary;
     global $local_string;
     $target_meta_array = $process_dictionary[$step]['elements'][$target_element];
     $prev_display_text = "";
     foreach ($target_meta_array['bottom']['options'] as $key => $option_array) {
         if ($option_array['text_type'] == "static") {
             $vname = '';
             if ($this->workflow_object->type == "Time" && isset($option_array['vname_time'])) {
                 $vname = $option_array['vname_time'];
             } else {
                 $vname = $option_array['vname'];
             }
             if ($this->local_strings != null) {
                 $prev_display_text .= get_label($vname, $this->local_strings) . " ";
             } else {
                 $prev_display_text .= translate_label($vname) . " ";
             }
         }
         if ($option_array['text_type'] == "dynamic") {
             $trans_ele = $this->translate_element($option_array);
             if ($trans_ele === false) {
                 return false;
             }
             $prev_display_text .= $trans_ele . " ";
         }
         //end for each option
     }
     return $prev_display_text;
     //end function get_prev_text
 }
示例#2
0
function render_property($graph, $me, $property)
{
    $property = $graph->resource($property);
    echo "<p>" . get_label($property) . ":&nbsp;";
    render_property_values($me, $property, $onto_file);
    echo "</p>";
}
示例#3
0
function render_thing($o)
{
    $label = get_label($o);
    if (!$o->isBnode()) {
        echo "&nbsp;<a href='#" . $o->localname() . "'>" . $label . "</a>&nbsp;";
    }
}
示例#4
0
function mf_shortcodes($atts)
{
    global $post, $FIELD_TYPES;
    extract(shortcode_atts(array('field' => 'no field defined or field name is wrong', 'eip' => FALSE, 'filtered' => FALSE, 'imgtag' => FALSE, 'label' => "", 'loop' => FALSE, 'loopseparator' => "|", 'checked' => "yes", 'groupindex' => 1, 'fieldindex' => 1), $atts));
    if ($loop && RCCWP_CustomField::GetFieldDuplicates($post->ID, $field, $groupindex) > 1) {
        $fieldduplicatedata = get_field_duplicate($field);
    } else {
        $fielddata = RCCWP_CustomField::GetDataField($field, $groupindex, $fieldindex, $post->ID);
    }
    $fieldType = $fielddata['type'];
    $fieldID = $fielddata['id'];
    $fieldObject = $fielddata['properties'];
    $fieldValues = (array) $fielddata['meta_value'];
    $fieldMetaID = $fielddata['meta_id'];
    $fieldresults = GetProcessedFieldValue($fieldValues, $fieldType, $fieldObject);
    $shortcode_data = $fieldresults;
    if ($fielddata['type'] == $FIELD_TYPES['multiline_textbox'] && $filtered) {
        $shortcode_data = apply_filters('the_content', $fieldresults);
    }
    if ($fielddata['type'] == $FIELD_TYPES['image']) {
        $imgresults = split('&', $fieldresults);
        if ($imgtag) {
            $shortcode_data = "<img src=\"{$imgresults['0']}\"/>";
        } else {
            $shortcode_data = $imgresults[0];
        }
    }
    if ($fielddata['type'] == $FIELD_TYPES['listbox']) {
        $shortcode_data = implode(",", $fieldresults);
    }
    if ($fielddata['type'] == $FIELD_TYPES['checkbox_list']) {
        $shortcode_data = implode(",", $fieldresults);
    }
    if ($fielddata['type'] == $FIELD_TYPES['checkbox']) {
        if ($fieldresults) {
            $shortcode_data = $checked;
        }
    }
    if ($shortcode_data || $fieldduplicatedata) {
        if ($label) {
            $shortcode_data = $label . $shortcode_data;
        } else {
            $shortcode_data = get_label($field) . " : " . $shortcode_data;
        }
        /////
        if ($field == "duplicate") {
            if ($loop) {
                return implode($loopseparator, $fieldduplicatedata);
            } else {
                return $shortcode_data;
            }
        } else {
            return $shortcode_data;
        }
        /////
    } else {
        return "no data found, please check the field name";
    }
}
示例#5
0
function render_property_as_row($graph, $me, $p)
{
    $property = $graph->resource($p);
    echo "<p>" . get_label($property) . ":&nbsp;";
    foreach ($me->all($property) as $o) {
        $label = get_label($o);
        if (!$o->isBnode()) {
            echo "&nbsp;" . link_to($label, 'uri=' . urlencode($o)) . "&nbsp;";
        }
    }
    echo "</p>";
}
示例#6
0
function render_property($graph, $me, $p)
{
    $property = $graph->resource($p);
    //echo "<p>" . $property->label('zh') . ":&nbsp;";
    echo "<p>" . get_label($property) . ":&nbsp;";
    foreach ($me->all($property) as $o) {
        $label = $o->label();
        if (!$label) {
            $label = $o->getUri();
        }
        if ($o->isBnode()) {
            //echo "&nbsp;$label&nbsp;";
        } else {
            echo "&nbsp;" . link_to_self($label, 'uri=' . urlencode($o)) . "&nbsp;";
        }
    }
    echo "</p>";
}
示例#7
0
function sak_record_form($params, $field_meta, $field_mapping = null)
{
    global $config;
    $table_info2qf['varchar'] = 'text';
    $table_info2qf['string'] = 'textarea';
    $table_info2qf['int4'] = 'text';
    $table_info2qf['int'] = 'text';
    $table_info2qf['date'] = 'date';
    $table_info2qf['timestamp'] = 'date';
    $table_info2qf['text'] = 'textarea';
    $table_info2qf['blob'] = 'textarea';
    $type_options['date'] = array('language' => 'es', 'format' => 'dMY');
    $type_options['text'] = array('size' => 64);
    $type_options['textarea'] = array('rows' => 5, 'cols' => 64);
    $date_defaults = array('d' => date('d'), 'M' => date('m'), 'Y' => date('Y'));
    $table = $params['table'];
    $primary_key = $params['primary_key'];
    $op = $params['op'];
    if ($op == 'update') {
        $record_id = $params['record_id'];
    }
    $db = DB::connect($config['db']);
    if (PEAR::isError($db)) {
        var_dump($db);
        die($db->getMessage());
    }
    $params_f = params_encode($params);
    $form =& new HTML_QuickForm('form_record', 'post');
    $form->setRequiredNote('<span style="color:#ff0000;">*</span> = campos requeridos.');
    $form->addElement('hidden', 'action', 'table');
    $form->addElement('hidden', 'params', $params_f);
    $table_info = $db->tableInfo($table);
    foreach ($table_info as $field_info) {
        $name = $field_info['name'];
        $element_type = null;
        $element_options = null;
        if (isset($field_meta['type'][$op][$name])) {
            if ($field_meta['type'][$op][$name] == 'disable') {
                continue;
            } else {
                $element_type = $field_meta['type'][$op][$name];
            }
        }
        //        if ($name == $primary_key)
        //            continue;
        $element_type = $element_type == '' ? $table_info2qf[$field_info['type']] : $element_type;
        if (isset($field_mapping[$field_info['name']])) {
            $label = $field_mapping[$field_info['name']];
        } else {
            $label = get_label($field_info['name']);
        }
        $size = $field_info['len'];
        $element_options = $type_options[$element_type];
        if (isset($field_meta['select'][$name])) {
            $element_type = 'select';
            if (isset($field_meta['select'][$name]['data'])) {
                $element_options = $field_meta['select'][$name]['data'];
            } else {
                $lookup_sql = $field_meta['select'][$name]['sql'];
                $element_options = $db->getAssoc($lookup_sql);
            }
        }
        $element_name = "new_row[{$name}]";
        if (isset($field_meta['defaults'][$name])) {
            $defaults[$element_name] = $field_meta['defaults'][$name];
        }
        $form->addElement($element_type, $element_name, $label, $element_options);
        if ($field_info['flags'] != '') {
            $not_null = strpos($field_info['flags'], 'not_null');
            if (!($not_null === false)) {
                $form->addRule($element_name, 'Campo obligatorio', 'required');
            }
        }
        if ($field_info['type'] == 'int4') {
            $form->addRule($element_name, 'Campo numerico', 'numeric');
        }
    }
    if ($op == 'update') {
        $edit_sql = "select * from {$table} where {$primary_key} = ?";
        $edit_sql_data = array($record_id);
        $edit_row = $db->getRow($edit_sql, $edit_sql_data, DB_FETCHMODE_ASSOC);
        foreach ($edit_row as $key => $value) {
            $defaults['new_row[' . $key . ']'] = stripslashes($value);
        }
    }
    //    echo '<pre>';
    //    var_dump($defaults);
    //    echo '</pre>';
    if (isset($defaults)) {
        $form->setDefaults($defaults);
    }
    return $form;
}
示例#8
0
function print_table($link, $data_date, $base_table, $code = '', $mode = 'direct')
{
    # Функция выводит таблицу с результатами поиска элементов с кодами указанного муниципального или административного образования
    # Если параметр mode='html', генерируются html файлы.
    if ($base_table == 'okato') {
        $base_name = 'ОКАТО';
        $alter_table = 'oktmo';
        $alter_name = 'ОКТМО';
        $base_root_page = '00.html';
        $alter_root_page = '00000000.html';
    } elseif ($base_table == 'oktmo') {
        $base_name = 'ОКТМО';
        $alter_table = 'okato';
        $alter_name = 'ОКАТО';
        $base_root_page = '00000000.html';
        $alter_root_page = '00.html';
    }
    # Поскольку в базе данных есть коды, разбитые на части, воспользуемся этим для выяснения уровня образования.
    if ($code != '') {
        $query = 'SELECT ter, kod1, kod2, kod3, name FROM ' . $base_table . ' WHERE mergedcode=\'' . $code . '\'';
        $result = mysqli_query($link, $query);
        $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
        mysqli_free_result($result);
        if ($row['ter'] == '00') {
            $level = 1;
        } elseif ($row['kod1'] == '000') {
            $level = 2;
        } elseif ($row['kod2'] == '000') {
            $level = 3;
        } else {
            $level = 4;
        }
    } else {
        $level = 1;
    }
    # Страшноватый но рабочий блок формирования навигации по уровням образований
    # Ссылка для перехода на альтернативный классификатор
    if ($mode == 'html') {
        $navigation = "<a href=\"../{$alter_table}/{$alter_root_page}\">{$alter_name}</a>\n";
    } else {
        $navigation = "<a href=\"?base={$alter_table}\">{$alter_name}</a>\n";
    }
    if ($level > 1) {
        if ($mode == 'html') {
            $navigation .= "<br>\n<br>\n<a href=\"{$base_root_page}\">{$base_name}</a> /";
        } else {
            $navigation .= "<br>\n<br>\n<a href=\"?base={$base_table}\">{$base_name}</a> /";
        }
    } elseif ($level == 1) {
        $navigation .= "<br>\n<br>\n" . $base_name . ' /';
    }
    if ($level > 2) {
        $query = 'SELECT name, mergedcode FROM ' . $base_table . ' WHERE (ter=\'' . $row['ter'] . '\' AND kod1=\'000\' AND kod2=\'000\' AND kod3=\'000\')';
        $result_n = mysqli_query($link, $query);
        $row_n = mysqli_fetch_array($result_n, MYSQLI_ASSOC);
        mysqli_free_result($result_n);
        if ($mode == 'html') {
            $navigation .= ' <a href="' . $row_n['mergedcode'] . '.html">' . $row_n['name'] . '</a> /';
        } else {
            $navigation .= " <a href=\"?base={$base_table}&amp;code=" . $row_n['mergedcode'] . "\">" . $row_n['name'] . '</a> /';
        }
    } elseif ($level == 2) {
        $query = 'SELECT name, mergedcode FROM ' . $base_table . ' WHERE (ter=\'' . $row['ter'] . '\' AND kod1=\'000\' AND kod2=\'000\' AND kod3=\'000\')';
        $result_n = mysqli_query($link, $query);
        $row_n = mysqli_fetch_array($result_n, MYSQLI_ASSOC);
        mysqli_free_result($result_n);
        $navigation .= ' ' . $row_n['name'] . ' /';
    }
    if ($level > 3) {
        $query = 'SELECT name, mergedcode FROM ' . $base_table . ' WHERE (ter=\'' . $row['ter'] . '\' AND kod1=\'' . $row['kod1'] . '\' AND kod2=\'000\' AND kod3=\'000\')';
        $result_n = mysqli_query($link, $query);
        $row_n = mysqli_fetch_array($result_n, MYSQLI_ASSOC);
        mysqli_free_result($result_n);
        if ($mode == 'html') {
            $navigation .= ' <a href="' . $row_n['mergedcode'] . '.html">' . $row_n['name'] . '</a> /';
        } else {
            $navigation .= " <a href=\"?base={$base_table}&amp;code=" . $row_n['mergedcode'] . "\">" . $row_n['name'] . '</a> /';
        }
    } elseif ($level == 3) {
        $query = 'SELECT name, mergedcode FROM ' . $base_table . ' WHERE (ter=\'' . $row['ter'] . '\' AND kod1=\'' . $row['kod1'] . '\' AND kod2=\'000\' AND kod3=\'000\')';
        $result_n = mysqli_query($link, $query);
        $row_n = mysqli_fetch_array($result_n, MYSQLI_ASSOC);
        mysqli_free_result($result_n);
        $navigation .= ' ' . $row_n['name'] . ' /';
    }
    if ($level == 4) {
        $query = 'SELECT name, mergedcode FROM ' . $base_table . ' WHERE (ter=\'' . $row['ter'] . '\' AND kod1=\'' . $row['kod1'] . '\' AND kod2=\'' . $row['kod2'] . '\' AND kod3=\'000\')';
        $result_n = mysqli_query($link, $query);
        $row_n = mysqli_fetch_array($result_n, MYSQLI_ASSOC);
        mysqli_free_result($result_n);
        $navigation .= ' ' . $row_n['name'] . ' /';
    }
    $navigation .= '<br><br>';
    $html_head = "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title>Валидатор Викиданных по {$base_name}";
    if ($level > 1) {
        $html_head .= ' ' . $code . ' ' . $row['name'];
    }
    $html_head .= "</title>\n<style>\n";
    $html_head .= file_get_contents('style.css');
    $html_head .= "\n</style>\n</head>\n<body>\n";
    if ($mode == 'html') {
        $disclaimer = '<p><a href="../index.html">На главную</a></p>';
    } else {
        $disclaimer = '<p><a href="?base=home">На главную</a></p>';
    }
    $disclaimer .= "<p>Данные Викиданных от {$data_date}. Обновляются раз в неделю.</p>";
    $disclaimer2 = "<div class=\"disclaimer\"><p>Не спешите исправлять ошибки! Проверьте, может так и должно быть.</p></div>\n";
    $legend = '<table class="legend"><tr><td class="dup">Элементы с одинаковым кодом</td><td class="bad">Неожиданный код</td>';
    #$legend.='<td class="alter">Элемента с таким кодом нет,<br>есть с аналогичным кодом</td>';
    $legend .= '</tr></table>';
    # Начинаем выводить html
    if ($mode == 'html') {
        if ($level > 1) {
            $handle = fopen("html/{$base_table}/" . $code . '.html', "w");
        } else {
            $handle = fopen("html/{$base_table}/{$base_root_page}", "w");
        }
        fwrite($handle, $html_head . $disclaimer . $disclaimer2 . $legend);
    } else {
        echo $html_head . $disclaimer . $disclaimer2 . $legend;
    }
    if ($mode == 'html') {
        fwrite($handle, $navigation);
    } else {
        echo $navigation;
    }
    # Формируем шапку таблицы
    $table = '<table class="data"><thead><tr>';
    $table .= '<th>Найдено вложенных элементов</th>';
    if ($base_table == 'okato') {
        $table .= '<th>ОКАТО</th>';
        #$table.='<th>Аналог. ОКТМО</th>';
    } elseif ($base_table == 'oktmo') {
        $table .= '<th>ОКТМО</th>';
        #$table.='<th>Аналог. ОКАТО</th>';
    }
    $table .= '<th>Элемент классификатора</th>';
    $table .= '<th>Элемент Викиданных</th>';
    $table .= '<th><span class="label">Метка</span>, псевдонимы</th>';
    $table .= '<th>Тип территории</th>';
    $table .= '<th>Описание</th>';
    if ($base_table == 'okato') {
        $table .= '<th>ОКАТО в Викиданных</th><th>ОКТМО в Викиданных</th>';
    } elseif ($base_table == 'oktmo') {
        $table .= '<th>ОКТМО в Викиданных</th><th>ОКАТО в Викиданных</th>';
    }
    $table .= '<th><abbr title="Административно-территориальная единица">АТЕ</abbr></th>';
    $table .= '<th>Центр</th>';
    # На некоторых уровнях определённые столбцы не выводятся
    if ($level != 1) {
        $table .= '<th>Широта</th>';
        $table .= '<th>Долгота</th>';
        $table .= '<th>Телефонный код</th>';
        $table .= '<th>Индекс</th>';
    }
    $table .= '</tr></thead>' . "\n";
    if ($mode == 'html') {
        fwrite($handle, $table);
    } else {
        echo $table;
    }
    # Выводим шапку таблицы
    # Формируем запрос для списка объектов, входящих в текущее образование
    # Формируем условие для выборки
    switch ($level) {
        case 1:
            $clause = 'ter<>\'00\' AND kod1=\'000\' AND kod2=\'000\' AND kod3=\'000\'';
            break;
        case 2:
            $clause = 'ter=\'' . $row['ter'] . '\' AND kod1<>\'000\' AND kod2=\'000\' AND kod3=\'000\'';
            break;
        case 3:
            $clause = 'ter=\'' . $row['ter'] . '\' AND kod1=\'' . $row['kod1'] . '\'  AND ( ( kod2<>\'000\' AND kod3=\'000\') OR ( kod2=\'000\' AND kod3<>\'000\') )';
            break;
        case 4:
            $clause = 'ter=\'' . $row['ter'] . '\' AND kod1=\'' . $row['kod1'] . '\'  AND kod2=\'' . $row['kod2'] . '\' AND kod3<>\'000\'';
            break;
    }
    $query = "SELECT type, name, nomdeskr, exist, numfound, mergedcode FROM {$base_table} WHERE {$clause}";
    $result = mysqli_query($link, $query);
    # А теперь для каждого объекта в текущем образовании ищем соответсвующий элемент Викиданных
    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        $base_code = $row['mergedcode'];
        $alter_code = analog($link, $base_table, $base_code);
        $clause = $base_table . '=\'' . $base_code . '\'';
        # Формируем список полей
        $fields = 'item';
        $fields .= ', label';
        $fields .= ', description';
        $fields .= ', oktmo';
        $fields .= ', okato';
        $fields .= ', ate';
        $fields .= ', centrum';
        # На некоторых уровнях определённые поля не запрашиваются
        if ($level != 1) {
            $fields .= ', lat';
            $fields .= ', lon';
            $fields .= ', phone';
            $fields .= ', post';
        }
        # Инициализируем флаги
        # Элементы с дублирующимися кодами
        $base_dup = false;
        $alter_dup = false;
        # С неожиданными (возможно - ошибочными) кодами
        $base_bad = false;
        $alter_bad = false;
        # Элементы, найденные только по аналогичному коду в другом классификаторе
        $alter = false;
        $query = "SELECT {$fields} FROM wikidata WHERE ({$clause})";
        $result_w = mysqli_query($link, $query);
        $num_items = mysqli_num_rows($result_w);
        # Элементов с этим кодом больше одного. Сталоб быть - дубликат.
        if (1 < $num_items) {
            $base_dup = true;
        }
        # Элементов с данным кодом не нашлось. Попробуем найти с аналогичным (если есть такой).
        /*    if ( (0 == $num_items) and ($alter_code !='') ) {
              $clause=$alter_table.'=\''.$alter_code.'\'';
              $query="SELECT $fields FROM wikidata WHERE ($clause)";
              $result_w=mysqli_query ($link, $query);
        
              $num_items=mysqli_num_rows($result_w);
        
              if (0 != $num_items)
        	$alter=true;
        
              if (1 < $num_items)
        	$alter_dup=true;
            }*/
        # Берём первый найденный элемент Викиданных
        $row_w = mysqli_fetch_array($result_w, MYSQLI_ASSOC);
        # Готовимся объединить ячейки с кодами и наименованием объекта классификатора, чтобы не выводить их для каждого дубликата
        $rowspan = '';
        if (1 < $num_items) {
            $rowspan = " rowspan=\"{$num_items}\"";
        }
        # Инициализируем количество вложенных объектов у текущего объекта классификатора и количество найденных элементов у вложенных объектов
        $elements_exist = 0;
        $elements_found = 0;
        do {
            if ($row['exist'] != 0) {
                $elements_exist = $row['exist'];
                $elements_found = $row['numfound'];
            }
            # Элемент может иметь несколько псевдонимов и типов. Берём их из отдельных таблиц.
            $query = 'SELECT alias FROM aliases WHERE (item=\'' . $row_w['item'] . '\')';
            $result_a = mysqli_query($link, $query);
            $query = 'SELECT types.type, atd_items.label FROM types, atd_items WHERE (types.item=\'' . $row_w['item'] . '\' AND types.type=atd_items.item)';
            $result_t = mysqli_query($link, $query);
            # Подготовим всплывающий комментарий к объекту из классификатора
            $title = ' title="' . $row['nomdeskr'] . '"';
            # Считаем статистику существующих и найденных вложенных объектов
            if ($elements_exist != 0) {
                $status_found = $elements_found . ' из ' . $elements_exist . ' ';
                # Если процент найденных элементов не целый, выводим приблизительное значение
                if ($elements_found == 0) {
                    $percents = 0;
                } elseif (100 * $elements_found % $elements_exist != 0) {
                    $status_found .= '~';
                    $percents = round(100 * $elements_found / $elements_exist);
                } else {
                    $percents = 100 * $elements_found / $elements_exist;
                }
                $status_found .= $percents . '%';
            } else {
                $status_found = '';
            }
            # Проверка соответствия кодов элемента классификаторам (проверка на неожиданность).
            if ($row_w[$base_table] != $base_code and isset($row_w[$base_table])) {
                $base_bad = true;
            }
            /*
                  if (($row_w [$alter_table] != $alter_code) and (isset ($row_w [$alter_table])) )
            	$alter_bad=true;
            */
            # Формируем вывод строк таблицы
            # Раскрашиваем строки с дубликатами и элементами, найденными по альтернативному коду
            if ($base_dup or $alter_dup) {
                $output_row = '<tr class="dup">';
            } elseif ($alter) {
                $output_row = '<tr class="alter">';
            } else {
                $output_row = '<tr>';
            }
            # Такой вот мудрёный способ оформления дублирующихся элементов
            if (!(($base_dup or $alter_dup) and $num_items == 1)) {
                $output_row .= '<th' . $rowspan . '>' . $status_found . '</th>';
                $output_row .= '<th' . $rowspan;
                # Раскрашиваем неожиданные коды в части данных классификатора (блок серых ячеек)
                if ($base_bad) {
                    $output_row .= ' class="bad"';
                }
                $output_row .= '>' . $base_code . '</th>';
                /*$output_row.='<th'.$rowspan;
                
                	if ($alter_bad)
                	  $output_row.=' class="bad"';
                
                	$output_row.='>'.$alter_code.'</th>';*/
                $output_row .= '<th';
                # Добавляем всплывающий коммментарий из классификатора, при наличии
                if (isset($row['nomdeskr'])) {
                    $output_row .= $title;
                }
                $output_row .= $rowspan;
                # Если у объекта есть вложенные объекты, его наименование становится ссылкой
                if ($elements_exist != 0) {
                    if ($mode == 'html') {
                        $output_row .= '><a href="' . $row['mergedcode'] . '.html">' . $row['type'] . ' ' . $row['name'] . '</a></th>';
                    } else {
                        $output_row .= '><a href="?base=' . $base_table . '&amp;code=' . $row['mergedcode'] . '">' . $row['type'] . ' ' . $row['name'] . '</a></th>';
                    }
                } else {
                    $output_row .= '>' . $row['type'] . ' ' . $row['name'] . '</th>';
                }
            }
            # Информацию классификатора отобразили. Если элемента Викиданных с таким кодом не нашлось, выводим пустые ячейки и переходим к следующему объекту.
            if (!isset($row_w['item'])) {
                if ($level == 1) {
                    $output_row .= '<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>' . "\n";
                } else {
                    $output_row .= '<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>' . "\n";
                }
                if ($mode == 'html') {
                    fwrite($handle, $output_row);
                } else {
                    echo $output_row;
                }
                # Выводим строку таблицы
                $rowspan = '';
                $num_items = 1;
                continue;
            }
            # Элемент для текущего объекта есть. Выводим его свойства.
            # Идентификатор
            $output_row .= '<td class="numeric"><a href="https://www.wikidata.org/wiki/' . $row_w['item'] . '" target="blank">' . $row_w['item'] . '</a></td>';
            $output_row .= '<td>';
            # Метка
            $output_row .= '<p class="label">' . $row_w['label'] . '</p>';
            # Псевдонимы
            while ($row_a = mysqli_fetch_array($result_a, MYSQLI_ASSOC)) {
                $output_row .= '<p>' . $row_a['alias'] . '</p>';
            }
            mysqli_free_result($result_a);
            $output_row .= '</td>';
            $output_row .= '<td>';
            # Типы объекта (область, город, район, округ, столица ...)
            while ($row_t = mysqli_fetch_array($result_t, MYSQLI_ASSOC)) {
                $output_row .= '<p><a href="https://www.wikidata.org/wiki/' . $row_t['type'] . '" target="blank">' . $row_t['label'] . '</a></p>';
            }
            mysqli_free_result($result_t);
            # Описание
            $output_row .= '</td>';
            $output_row .= '<td>' . $row_w['description'] . '</td>';
            $output_row .= '<td class="numeric';
            # Отметим неожиданный код, если есть
            if ($base_bad) {
                $output_row .= ' bad';
            }
            # Код в Викиданных по текущему классификатору
            $output_row .= '">' . $row_w["{$base_table}"] . '</td>';
            $output_row .= '<td class="numeric';
            if ($alter_bad) {
                $output_row .= ' bad';
            }
            # Код по альтернативному классификатору
            $output_row .= '">' . $row_w["{$alter_table}"] . '</td>';
            # Ссылка на элемент Викиданных в роли административно-территориальной единицы...
            if (isset($row_w['ate'])) {
                $output_row .= '<td><a href="https://www.wikidata.org/wiki/' . $row_w['ate'] . '" target="blank">' . get_label($link, $row_w['ate']) . '</a></td>';
            } else {
                $output_row .= '<td></td>';
            }
            # ... и административного центра
            if (isset($row_w['centrum'])) {
                $output_row .= '<td><a href="https://www.wikidata.org/wiki/' . $row_w['centrum'] . '" target="blank">' . get_label($link, $row_w['centrum']) . '</a></td>';
            } else {
                $output_row .= '<td></td>';
            }
            # Широта, долгота, телефонный код, почтовый индекс
            if ($level != 1) {
                $output_row .= '<td class="numeric">' . $row_w['lat'] . '</td>';
                $output_row .= '<td class="numeric">' . $row_w['lon'] . '</td>';
                $output_row .= '<td class="numeric">' . $row_w['phone'] . '</td>';
                $output_row .= '<td class="numeric">' . $row_w['post'] . '</td>';
            }
            $output_row .= '</tr>' . "\n";
            # В зависимости от режима работы, выводим в файл, либо в браузер.
            if ($mode == 'html') {
                fwrite($handle, $output_row);
            } else {
                echo $output_row;
            }
            # Выводим строку таблицы
            # Вывод дубликатов обработали. инициализируем переменные
            $rowspan = '';
            $num_items = 1;
        } while ($row_w = mysqli_fetch_array($result_w, MYSQLI_ASSOC));
        # Пробуем взять ещё дубликат
        mysqli_free_result($result_w);
    }
    if ($mode == 'html') {
        fwrite($handle, "</table></body></html>\n");
    } else {
        echo '</table></body></html>' . "\n";
    }
    mysqli_free_result($result);
}
$form->assign("TRIGGER_TYPE", $workflow_object->type);
$form->assign("TYPE", $focus->type);
//Check multi_trigger filter conditions
if (!empty($_REQUEST['frame_type']) && $_REQUEST['frame_type'] == "Secondary") {
    $form->assign("FRAME_TYPE", $_REQUEST['frame_type']);
} else {
    $form->assign("FRAME_TYPE", "Primary");
}
insert_popup_header();
$form->parse("embeded");
$form->out("embeded");
////////Middle Items/////////////////////////////
$temp_module = BeanFactory::getBean($workflow_object->base_module);
$display_field_name = $temp_module->field_defs[$focus->field]['vname'];
$current_module_strings = return_module_language($current_language, $workflow_object->base_module);
$display_field_name = "<i><b>\" " . get_label($display_field_name, $current_module_strings) . " \"</i></b>";
$form->assign("SPECIFIC_FIELD", $display_field_name);
if ($workflow_object->type == "Normal") {
    //set exp_meta_type to normal_trigger
    $form->assign("EXP_META_TYPE", "normal_trigger");
} else {
    //set exp_meta_type to time_trigger
    $form->assign("EXP_META_TYPE", "time_trigger");
}
//SET Previous Display Text
require_once 'include/ListView/ProcessView.php';
$ProcessView = new ProcessView($workflow_object, $focus);
$prev_display_text = $ProcessView->get_prev_text("TriggersCreateStep1", $focus->type);
$form->assign("PREV_DISPLAY_TEXT", $prev_display_text);
//////////////////BEGIN Future Object	/////////////////////////////////
$future_object = BeanFactory::getBean('Expressions');
示例#10
0
function sak_display_record($params, $field_mapping = null)
{
    global $config;
    $sql = $params['sql_record'];
    $sql_data = array($params['record_id']);
    $db = DB::connect($config['db']) or die('Could connect to DB');
    // get the record
    $row = $db->getRow($sql, $sql_data, DB_FETCHMODE_ASSOC);
    if (PEAR::isError($row)) {
        die($row->getDebugInfo());
    }
    $html = '<table class="listado">';
    $html .= '<tbody>';
    $i = 0;
    foreach ($row as $field => $value) {
        if ($i % 2) {
            $tr_style = 'f1';
        } else {
            $tr_style = 'f2';
        }
        $i++;
        //        if ($value != '')
        //        {
        $html .= '<tr class="' . $tr_style . '">';
        $html .= '<td class="listado">';
        $html .= get_label($field);
        $html .= '</td>';
        $html .= '<td class="listado">';
        $html .= nl2br(stripslashes($value));
        $html .= '</td>';
        $html .= '</tr>';
        //        }
    }
    $html .= '</tbody>';
    $html .= '</table>';
    return $html;
}
示例#11
0
<?php

/*
 * Template name: Gallery
 */
get_header();
$pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'gallery.php'));
$page = $pages[0];
$page_title = get_label('gallery');
$page_url = get_the_permalink($page);
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$gallery_posts_args = array('post_type' => 'gallery_post', 'posts_per_page' => 9, 'post_status' => array('publish'), 'paged' => $paged);
$gallery_posts_query = new WP_Query($gallery_posts_args);
if ($gallery_posts_query->have_posts()) {
    ?>
 
    <section class="full-page grey-background news gallery">
        <div class="bigger-container">
            <?php 
    include 'parts/breadcrumbs.php';
    ?>
            <div class="white-bg news-section">
                <div class="container">
                    <h1><?php 
    echo $page_title;
    ?>
</h1>
                    <?php 
    if ($page->post_content) {
        echo '<br><br>';
        $content = $page->post_content;
示例#12
0
function sak_display_array_record($params, $field_mapping = null)
{
    global $config;
    // get the record
    $row = $params['data'];
    $html[] = '<table class="table table-striped table-bordered table-condensed">';
    $html[] = '<tbody>';
    foreach ($row as $field => $value) {
        //        if ($value != '')
        //        {
        $html[] = '<tr>';
        $html[] = '<td>';
        if (isset($field_mapping[$field])) {
            $html[] = $field_mapping[$field];
        } else {
            $html[] = get_label($field);
        }
        $html[] = '</td>';
        $html[] = '<td>';
        // setup the link, if any
        if (isset($params['link_view'][$field]) and !empty($value)) {
            $label = !empty($params['link_view'][$field]['label']) ? $params['link_view'][$field]['label'] : $value;
            $href = $params['link_view'][$field]['href'];
            $html[] = "<a href=\"{$href}\">{$label}</a>";
        } else {
            $html[] = nl2br(htmlentities(stripslashes($value)));
        }
        $html[] = '</td>';
        $html[] = '</tr>';
        //        }
    }
    $html[] = '</tbody>';
    $html[] = '</table>';
    return implode($html);
}
示例#13
0
function mf_shortcodes($atts)
{
    global $post, $FIELD_TYPES;
    extract(shortcode_atts(array('field' => 'no field defined or field name is wrong', 'eip' => FALSE, 'filtered' => FALSE, 'imgtag' => FALSE, 'label' => "", 'loop' => FALSE, 'loopseparator' => "|", 'checked' => "yes", 'groupindex' => 1, 'fieldindex' => 1), $atts));
    if ($loop && RCCWP_CustomField::GetFieldDuplicates($post->ID, $field, $groupindex) > 1) {
        $fieldduplicatedata = get_field_duplicate($field);
    } else {
        $fielddata = RCCWP_CustomField::GetDataField($field, $groupindex, $fieldindex, $post->ID);
    }
    $fieldType = $fielddata['type'];
    $fieldID = $fielddata['id'];
    $fieldObject = $fielddata['properties'];
    $fieldValues = (array) $fielddata['meta_value'];
    $fieldMetaID = $fielddata['meta_id'];
    $fieldresults = GetProcessedFieldValue($fieldValues, $fieldType, $fieldObject);
    $shortcode_data = $fieldresults;
    if ($fielddata['type'] == $FIELD_TYPES['multiline_textbox'] && $filtered) {
        $shortcode_data = apply_filters('the_content', $fieldresults);
    }
    if ($fielddata['type'] == $FIELD_TYPES['image']) {
        $imgresults = split('&', $fieldresults);
        if ($imgtag) {
            $shortcode_data = "<img src=\"{$imgresults['0']}\"/>";
        } else {
            $shortcode_data = $imgresults[0];
        }
    }
    if ($fielddata['type'] == $FIELD_TYPES['listbox']) {
        $shortcode_data = implode(",", $fieldresults);
    }
    if ($fielddata['type'] == $FIELD_TYPES['checkbox_list']) {
        $shortcode_data = implode(",", $fieldresults);
    }
    if ($fielddata['type'] == $FIELD_TYPES['checkbox']) {
        if ($fieldresults) {
            $shortcode_data = $checked;
        }
    }
    // Prepare fields for EIP
    $enableEditnplace = RCCWP_Options::Get('enable-editnplace');
    if ($eip && $enableEditnplace == 1 && current_user_can('edit_posts', $post->ID)) {
        switch ($fielddata['type']) {
            case $FIELD_TYPES["textbox"]:
                if (!$results) {
                    $results = "&nbsp";
                }
                $shortcode_data = "<div class='" . EIP_textbox($fieldMetaID) . "' >" . $fieldresults . "</div>";
                break;
            case $FIELD_TYPES["multiline_textbox"]:
                if (!$results) {
                    $results = "&nbsp";
                }
                $shortcode_data = "<div class='" . EIP_mulittextbox($fieldMetaID) . "' >" . $shortcode_data . "</div>";
                break;
        }
    }
    if ($shortcode_data || $fieldduplicatedata) {
        if ($label) {
            $shortcode_data = $label . $shortcode_data;
        } else {
            $shortcode_data = get_label($field) . " : " . $shortcode_data;
        }
        /////
        if ($field == "duplicate") {
            if ($loop) {
                return implode($loopseparator, $fieldduplicatedata);
            } else {
                return $shortcode_data;
            }
        } else {
            return $shortcode_data;
        }
        /////
    } else {
        return "no data found, please check the field name";
    }
}
示例#14
0
function sak_record_form($params)
{
    global $config;
    $table_info2qf['varchar'] = 'text';
    $table_info2qf['int4'] = 'text';
    $table_info2qf['date'] = 'date';
    $table_info2qf['text'] = 'textarea';
    $date_options = array('language' => 'es', 'format' => 'dMY');
    $date_defaults = array('d' => date('d'), 'M' => date('m'), 'Y' => date('Y'));
    $campos_cortos = array('size' => 3);
    $campos_medios = array('size' => 8);
    $campos_largos = array('size' => 64);
    $table = $params['table'];
    $primary_key = $params['primary_key'];
    $op = $params['op'];
    if ($op == 'update') {
        $record_id = $params['record_id'];
    }
    $db = DB::connect($config['db']);
    if (PEAR::isError($db)) {
        die($db->getMessage());
    }
    $params_f = params_encode($params);
    $form =& new HTML_QuickForm('form_record', 'post');
    $form->addElement('hidden', 'action', 'table');
    $form->addElement('hidden', 'params', $params_f);
    $table_info = $db->tableInfo($table);
    foreach ($table_info as $field_info) {
        $name = $field_info['name'];
        $type = null;
        $options = null;
        if (isset($params['type'][$op][$name])) {
            $type = $params['type'][$op][$name];
        }
        if ($type == 'disable') {
            continue;
        }
        if ($name == $primary_key) {
            continue;
        }
        $type = $type == '' ? $table_info2qf[$field_info['type']] : $type;
        $label = get_label($field_info['name']);
        $size = $field_info['len'];
        if ($type == 'date') {
            $options = $date_options;
        }
        if ($type == 'textarea') {
            $options = array('rows' => 6, 'cols' => 70);
        }
        if ($type == 'text') {
            $options = array('size' => 40);
        }
        if (isset($params['options'][$name])) {
            $type = 'select';
            $options = $params['options'][$name];
        }
        if (isset($params['lookup'][$name])) {
            $type = 'select';
            $lookup_table = $params['lookup'][$name]['table'];
            $lookup_field_key = $params['lookup'][$name]['field_key'];
            $lookup_field_list = $params['lookup'][$name]['field_list'];
            $sql_options = "select {$lookup_field_key}, {$lookup_field_list} from {$lookup_table} order by {$lookup_field_list}";
            $options = array('' => '') + $db->getAssoc($sql_options);
        }
        if (isset($params['defaults'][$name])) {
            $defaults[$name] = $params['defaults'][$name];
        }
        $input_name = "new_row[{$name}]";
        $form->addElement($type, $input_name, $label, $options);
        if ($field_info['flags'] != '') {
            $not_null = strpos($field_info['flags'], 'not_null');
            if (!($not_null === false)) {
                $form->addRule($input_name, 'Campo obligatorio', 'required');
            }
        }
        if ($field_info['type'] == 'int4') {
            $form->addRule($input_name, 'Campo numerico', 'numeric');
        }
    }
    if ($op == 'update') {
        $edit_sql = "select * from {$table} where {$primary_key} = ?";
        $edit_sql_data = array($record_id);
        $edit_row = $db->getRow($edit_sql, $edit_sql_data, DB_FETCHMODE_ASSOC);
        foreach ($edit_row as $key => $value) {
            $defaults['new_row[' . $key . ']'] = stripslashes($value);
        }
        $form->setDefaults($defaults);
    }
    $form->addElement('submit', 'btnSubmit', 'Guardar');
    return $form;
}
示例#15
0
function sak_display_array_record($params, $field_mapping = null)
{
    global $config;
    // get the record
    $row = $params['data'];
    $html = '<table class="record">';
    $html .= '<tbody>';
    $i = 0;
    foreach ($row as $field => $value) {
        if ($i % 2) {
            $tr_style = 'record_f1';
        } else {
            $tr_style = 'record_f2';
        }
        $i++;
        //        if ($value != '')
        //        {
        $html .= '<tr class="' . $tr_style . '">';
        $html .= '<td class="record_field_name">';
        if (isset($field_mapping[$field])) {
            $html .= $field_mapping[$field];
        } else {
            $html .= get_label($field);
        }
        $html .= '</td>';
        $html .= '<td class="record_field_value">';
        $html .= nl2br(stripslashes($value));
        $html .= '</td>';
        $html .= '</tr>';
        //        }
    }
    $html .= '</tbody>';
    $html .= '</table>';
    return $html;
}
示例#16
0
function custom_breadcrumbs()
{
    // Settings
    //    $separator = '&gt;';
    $separator = '/';
    $breadcrums_id = 'breadcrumbs';
    $breadcrums_class = 'breadcrumbs';
    $home_title = get_label('Homepage');
    // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)
    $custom_taxonomy = 'project_category';
    // Get the query & post information
    global $post, $wp_query;
    // Do not display on the homepage
    if (!is_front_page()) {
        // Build the breadcrums
        echo '<ul id="' . $breadcrums_id . '" class="' . $breadcrums_class . '">';
        // Home page
        echo '<li class="item-home"><a class="bread-link bread-home" href="' . get_home_url() . '" title="' . $home_title . '">' . $home_title . '</a></li>';
        if (is_archive() && !is_tax() && !is_category() && !is_tag()) {
            echo '<li class="item-current item-archive"><strong class="bread-current bread-archive">' . post_type_archive_title($prefix, false) . '</strong></li>';
        } else {
            if (is_archive() && is_tax() && !is_category() && !is_tag()) {
                // If post is a custom post type
                $post_type = get_post_type();
                //            var_dump($post_type);
                // If it is a custom post type display name and link
                if ($post_type != 'post') {
                    $post_type_object = get_post_type_object($post_type);
                    $post_type_archive = get_post_type_archive_link($post_type);
                }
                if ($post_type == 'project_post') {
                    //Faqja pergjegjese per shfaqjen e programeve
                    $pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'programmes.php'));
                    $page = $pages[0];
                    $pageID = $page->ID;
                    if (function_exists('icl_object_id')) {
                        $pageID = icl_object_id($page->ID, 'news_post', false, ICL_LANGUAGE_CODE);
                    }
                    $page_title = get_the_title($pageID);
                    $page_url = get_the_permalink($pageID);
                }
                echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><a class="bread-cat bread-custom-post-type-' . $post_type . '" href="' . $page_url . '" title="' . $page_title . '">' . $page_title . '</a></li>';
                $custom_tax_name = get_queried_object()->name;
                if ($_GET['period']) {
                    $custom_tax_name .= ' | ' . get_label('ongoing_projects');
                } else {
                    $custom_tax_name .= ' | ' . get_label('past_projects');
                }
                echo '<li class="item-current item-archive"><strong class="bread-current bread-archive">' . $custom_tax_name . '</strong></li>';
            } else {
                if (is_single()) {
                    // If post is a custom post type
                    $post_type = get_post_type();
                    // If it is a custom post type display name and link
                    if ($post_type != 'post') {
                        $post_type_object = get_post_type_object($post_type);
                        $post_type_archive = get_post_type_archive_link($post_type);
                        if ($post_type == 'news_post') {
                            $pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'news.php'));
                            $page = $pages[0];
                            $pageID = $page->ID;
                            if (function_exists('icl_object_id')) {
                                $pageID = icl_object_id($page->ID, 'news_post', false, ICL_LANGUAGE_CODE);
                            }
                            $page_title = get_the_title($pageID);
                            $page_url = get_the_permalink($pageID);
                        } else {
                            if ($post_type == 'project_post') {
                                $pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'projects.php'));
                                //Nese period=ongoing nuk osht set, dmth qe te post eshte hi prej projekteve (all projects),
                                //dhe jo permes kategorizimit kshtu qe shfaqet linku i projekteve
                                if ($_GET['period']) {
                                    $pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'programmes.php'));
                                }
                                $page = $pages[0];
                                $pageID = $page->ID;
                                if (function_exists('icl_object_id')) {
                                    $pageID = icl_object_id($page->ID, 'news_post', false, ICL_LANGUAGE_CODE);
                                }
                                $page_title = get_the_title($pageID);
                                $page_url = get_the_permalink($pageID);
                            } else {
                                if ($post_type == 'gallery_post') {
                                    $pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'gallery.php'));
                                    $page = $pages[0];
                                    $pageID = $page->ID;
                                    if (function_exists('icl_object_id')) {
                                        $pageID = icl_object_id($page->ID, 'news_post', false, ICL_LANGUAGE_CODE);
                                    }
                                    $page_title = get_the_title($pageID);
                                    $page_url = get_the_permalink($pageID);
                                }
                            }
                        }
                        //                echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><a class="bread-cat bread-custom-post-type-' . $post_type . '" href="' . $post_type_archive . '" title="' . $post_type_object->labels->name . '">' . $post_type_object->labels->name . '</a></li>';
                        echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><a class="bread-cat bread-custom-post-type-' . $post_type . '" href="' . $page_url . '" title="' . $page_title . '">' . $page_title . '</a></li>';
                    }
                    // Get post category info
                    $category = get_the_category();
                    if (!empty($category)) {
                        // Get last category post is in
                        $last_category = end(array_values($category));
                        // Get parent any categories and create array
                        $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','), ',');
                        $cat_parents = explode(',', $get_cat_parents);
                        // Loop through parent categories and store in variable $cat_display
                        $cat_display = '';
                        foreach ($cat_parents as $parents) {
                            $cat_display .= '<li class="item-cat">' . $parents . '</li>';
                        }
                    }
                    // If it's a custom post type within a custom taxonomy
                    $taxonomy_exists = taxonomy_exists($custom_taxonomy);
                    if (empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
                        $taxonomy_terms = get_the_terms($post->ID, $custom_taxonomy);
                        $cat_id = $taxonomy_terms[0]->term_id;
                        $cat_nicename = $taxonomy_terms[0]->slug;
                        $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);
                        $cat_name = $taxonomy_terms[0]->name;
                    }
                    // Check if the post is in a category
                    if (!empty($last_category)) {
                        echo $cat_display;
                        echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '" title="' . get_the_title() . '">' . get_the_title() . '</strong></li>';
                        // Else if post is in a custom taxonomy
                    } else {
                        if (!empty($cat_id)) {
                            //Nese ne post eshte hy permes faqes projektet aktuale atehere edhe breadcrumb
                            //te kthen ne ate faqe (faqja e programit te caktuar me parameter get per ongoing/aktual)
                            if ($_GET['period'] == 'ongoing') {
                                if ($_GET['lang'] == '') {
                                    $cat_link .= '&period=ongoing';
                                } else {
                                    $cat_link .= '?period=ongoing';
                                }
                                $cat_name .= ' | ' . get_label('ongoing_projects');
                            } elseif ($_GET['period'] == 'past') {
                                $cat_name .= ' | ' . get_label('past_projects');
                            }
                            //Link per programin shfaqet vetem nese get period eshte e caktume/ Period jepet vetem permes faqes se programeve
                            if ($_GET['period']) {
                                echo '<li class="item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '"><a class="bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '" href="' . $cat_link . '" title="' . $cat_name . '">' . $cat_name . '</a></li>';
                            }
                            echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '" title="' . get_the_title() . '">' . get_the_title() . '</strong></li>';
                        } else {
                            echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '" title="' . get_the_title() . '">' . get_the_title() . '</strong></li>';
                        }
                    }
                } else {
                    if (is_category()) {
                        // Category page
                        echo '<li class="item-current item-cat"><strong class="bread-current bread-cat">' . single_cat_title('', false) . '</strong></li>';
                    } else {
                        if (is_page()) {
                            // Standard page
                            if ($post->post_parent) {
                                // If child page, get parents
                                $anc = get_post_ancestors($post->ID);
                                // Get parents in the right order
                                $anc = array_reverse($anc);
                                // Parent page loop
                                foreach ($anc as $ancestor) {
                                    $parents .= '<li class="item-parent item-parent-' . $ancestor . '"><a class="bread-parent bread-parent-' . $ancestor . '" href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li>';
                                }
                                // Display parent pages
                                echo $parents;
                                // Current page
                                echo '<li class="item-current item-' . $post->ID . '"><strong title="' . get_the_title() . '"> ' . get_the_title() . '</strong></li>';
                            } else {
                                // Just display current page if not parents
                                echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '"> ' . get_the_title() . '</strong></li>';
                            }
                        } else {
                            if (is_tag()) {
                                // Tag page
                                // Get tag information
                                $term_id = get_query_var('tag_id');
                                $taxonomy = 'post_tag';
                                $args = 'include=' . $term_id;
                                $terms = get_terms($taxonomy, $args);
                                $get_term_id = $terms[0]->term_id;
                                $get_term_slug = $terms[0]->slug;
                                $get_term_name = $terms[0]->name;
                                // Display the tag name
                                echo '<li class="item-current item-tag-' . $get_term_id . ' item-tag-' . $get_term_slug . '"><strong class="bread-current bread-tag-' . $get_term_id . ' bread-tag-' . $get_term_slug . '">' . $get_term_name . '</strong></li>';
                            } elseif (is_day()) {
                                // Day archive
                                // Year link
                                echo '<li class="item-year item-year-' . get_the_time('Y') . '"><a class="bread-year bread-year-' . get_the_time('Y') . '" href="' . get_year_link(get_the_time('Y')) . '" title="' . get_the_time('Y') . '">' . get_the_time('Y') . ' Archives</a></li>';
                                // Month link
                                echo '<li class="item-month item-month-' . get_the_time('m') . '"><a class="bread-month bread-month-' . get_the_time('m') . '" href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '" title="' . get_the_time('M') . '">' . get_the_time('M') . ' Archives</a></li>';
                                // Day display
                                echo '<li class="item-current item-' . get_the_time('j') . '"><strong class="bread-current bread-' . get_the_time('j') . '"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';
                            } else {
                                if (is_month()) {
                                    // Month Archive
                                    // Year link
                                    echo '<li class="item-year item-year-' . get_the_time('Y') . '"><a class="bread-year bread-year-' . get_the_time('Y') . '" href="' . get_year_link(get_the_time('Y')) . '" title="' . get_the_time('Y') . '">' . get_the_time('Y') . ' Archives</a></li>';
                                    // Month display
                                    echo '<li class="item-month item-month-' . get_the_time('m') . '"><strong class="bread-month bread-month-' . get_the_time('m') . '" title="' . get_the_time('M') . '">' . get_the_time('M') . ' Archives</strong></li>';
                                } else {
                                    if (is_year()) {
                                        // Display year archive
                                        echo '<li class="item-current item-current-' . get_the_time('Y') . '"><strong class="bread-current bread-current-' . get_the_time('Y') . '" title="' . get_the_time('Y') . '">' . get_the_time('Y') . ' Archives</strong></li>';
                                    } else {
                                        if (is_author()) {
                                            // Auhor archive
                                            // Get the author information
                                            global $author;
                                            $userdata = get_userdata($author);
                                            // Display author name
                                            echo '<li class="item-current item-current-' . $userdata->user_nicename . '"><strong class="bread-current bread-current-' . $userdata->user_nicename . '" title="' . $userdata->display_name . '">' . 'Author: ' . $userdata->display_name . '</strong></li>';
                                        } else {
                                            if (get_query_var('paged')) {
                                                // Paginated archives
                                                echo '<li class="item-current item-current-' . get_query_var('paged') . '"><strong class="bread-current bread-current-' . get_query_var('paged') . '" title="Page ' . get_query_var('paged') . '">' . __('Page') . ' ' . get_query_var('paged') . '</strong></li>';
                                            } else {
                                                if (is_search()) {
                                                    // Search results page
                                                    echo '<li class="item-current item-current-' . get_search_query() . '"><strong class="bread-current bread-current-' . get_search_query() . '" title="Search results for: ' . get_search_query() . '">Search results for: ' . get_search_query() . '</strong></li>';
                                                } elseif (is_404()) {
                                                    // 404 page
                                                    echo '<li>' . 'Error 404' . '</li>';
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        echo '</ul>';
    }
}
示例#17
0
<?php

get_header();
$pages = get_posts(array('post_type' => 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'news.php'));
$page = $pages[0];
$page_url = get_the_permalink($page);
$page_title = get_label('news');
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$news_posts_args = array('post_type' => 'news_post', 'posts_per_page' => 9, 'post_status' => array('publish'), 'paged' => $paged);
$news_posts_query = new WP_Query($news_posts_args);
if ($news_posts_query->have_posts()) {
    ?>
 
    <section class="full-page grey-background news">
        <div class="bigger-container">
            <?php 
    include 'parts/breadcrumbs.php';
    ?>
            <div class="white-bg news-section">
                <div class="container">
                    <h1><?php 
    echo $page_title;
    ?>
</h1>
                    <?php 
    if ($page->post_content) {
        echo '<br><br>';
        $content = $page->post_content;
        $content = apply_filters('the_content', $content);
        echo $content;
        echo '<br>';
示例#18
0
    $id = $data['id'];
    $label = '<div class="ns-item">
			<div class="ns-title"><i class="fa fa-arrows"></i>' . $name . '</div>
			<div class="ns-actions">
				<a href="javascript:void(0)" class="easyui-linkbutton"  plain="true" onclick="editAnjab(' . $id . ')">
					<i class="fa fa-pencil"></i>
				</a>
				<a href="#" class="delete-kategori" title="Delete" data-iddel="' . $id . '">
					<i class="fa fa-trash-o"></i>
				</a>
			</div>
		</div>';
    return $label;
}
foreach ($anjab as $row) {
    $tree->add_item($row['id'], $row['parent_id'], sprintf(' id="kategori_%s" data-category_id="%s"', $row['id'], $row['id']), get_label($row));
}
$kategori = $tree->generate('class="sortable"');
?>
<script src="<?php 
echo asset_url('js/kategori.js');
?>
"></script>
<div class="prod-cat-list">
	<form action="<?php 
echo site_url("anjab/saveOrderBy");
?>
" id="kategori">
		<?php 
echo $kategori;
?>
示例#19
0
<!-- // Opinion // -->

<!-- Category label -->
<?php 
get_label('opinion');
?>
<hr>
<!-- Post list -->
<?php 
get_opinion_mobile();
?>
<!-- Get more posts -->
<?php 
get_more_posts('opinion');
?>
<br/>
function insert_apparels()
{
    $i = 1;
    $search_query = '';
    $apparels = get_apparel();
    foreach ($apparels as $apparel) {
        if ($i > 1) {
            $search_query .= ' or';
        }
        $search_query .= " type='{$apparel}'";
        $i++;
    }
    $query = "select * from items where remove !=1 and ({$search_query}) order by band asc";
    $result = mysql_query($query);
    $apparels = array();
    if ($result) {
        while ($apparel = mysql_fetch_array($result)) {
            $image = get_apparel_image($apparel);
            $band = get_band($apparel);
            $title = get_title($apparel);
            if (isset($title) && !empty($title)) {
                $title = strtoupper($band) . ' "' . $title . '"';
            } else {
                $title = strtoupper($band);
            }
            $type = str_replace('\\', '', $apparel['type']);
            $itemid = $apparel['itemid'];
            $sku = get_sku($apparel) . '-' . strtolower($type);
            $variant_sku = $sku . '-' . strtolower($type);
            $vendor = get_label($apparel);
            $shopify_type = 'Apparel';
            $description = clean_text($apparel['description']);
            $weight = get_weight($type);
            $price = str_replace('$', '', $apparel['price']);
            if ($price == 'FREE') {
                $price = 0;
            }
            $sellprice = $price;
            $tags = "{$band}, {$type}, {$vendor}";
            $alt = null;
            if ($image) {
                $alt = $title;
            }
            if ($apparel['type_2']) {
                $type2 = str_replace('\\', '', $apparel['type_2']);
                $variant_sku2 = $sku . '-' . $type2;
                $tags .= ", {$type2}";
                $weight2 = get_weight($type2);
                $price2 = str_replace('$', '', $apparel['price_2']);
                $price_difference = $price2 - $price;
                if ($apparel['nirprice_2']) {
                    $nirprice = str_replace('$', '', $apparel['nirprice_2']);
                }
            }
            $sizes = explode(' ', $apparel['sizes']);
            $i = 0;
            foreach ($sizes as $size) {
                $i++;
                $variant_price = false;
                switch ($size) {
                    case '3-6month':
                        $size = '3-6 month';
                        break;
                    case '6-12month':
                        $size = '6-12 month';
                        break;
                    case '12-18month':
                        $size = '12-18 month';
                        break;
                    case '2T':
                        $size = '2T';
                        break;
                    case '4T':
                        $size = '4T';
                        break;
                    case '6T':
                        $size = '6T';
                        break;
                    case 'YS':
                        $size = 'Youth Small';
                        break;
                    case 'YM':
                        $size = 'Youth Medium';
                        break;
                    case 'YL':
                        $size = 'Youth Large';
                        break;
                    case 'XS':
                        $size = 'Extra Small';
                        break;
                    case 'S':
                        $size = 'Small';
                        break;
                    case 'M':
                        $size = 'Medium';
                        break;
                    case 'L':
                        $size = 'Large';
                        break;
                    case 'XL':
                        $size = 'Extra Large';
                        break;
                    case 'XXL':
                        $size = 'XX Large';
                        $variant_price = $price + 1;
                        break;
                    case 'XXXL':
                        $size = 'XXX Large';
                        $variant_price = $price + 2;
                        break;
                }
                $saved_price = $price;
                if ($variant_price) {
                    $saved_price = number_format($variant_price, 2);
                }
                $sku_size = $sku . '-' . strtolower(str_replace(' ', '-', $size));
                if ($i == 1) {
                    $apparels[] = array($variant_sku, $title, $description, $vendor, $shopify_type, $tags, 'true', "Size", $size, null, null, null, null, $variant_sku, $weight, null, 1, 'deny', 'manual', $price, null, 'true', 'true', null, $image, $alt);
                } else {
                    $apparels[] = array($variant_sku, null, null, null, null, null, null, 'Size', $size, null, null, null, null, $sku_size, $weight, null, 1, 'deny', 'manual', $saved_price, null, 'true', 'true', null, null, null);
                }
            }
        }
    }
    return $apparels;
}
示例#21
0
 /**
  * Translate system field back to label
  * @static
  * @param string $field_name
  * @param string $module_name
  * @param mixed|bool $moduleToLabel
  * @return string
  */
 public static function translateField($field_name, $module_name = '', $moduleToLabel = null)
 {
     global $beanList, $current_language;
     if (strpos($field_name, '.') !== false) {
         $field_name = explode('.', $field_name, 2);
         $module_name = $field_name[0];
         $field_name = $field_name[1];
         if ($moduleToLabel === null) {
             $moduleToLabel = true;
         }
     }
     if (isset($beanList[$module_name])) {
         $seed = new $beanList[$module_name]();
         $module_strings = return_module_language($current_language, $seed->module_dir);
         foreach ($seed->field_defs as $value_array) {
             if (!in_array($value_array['type'], self::$exclude_var_types)) {
                 if ($value_array['name'] == $field_name) {
                     if (!empty($value_array['vname'])) {
                         $label_tag = $value_array['vname'];
                     } else {
                         $label_tag = $value_array['name'];
                     }
                     $label = get_label($label_tag, $module_strings);
                     $label = trim($label, ':');
                     if ($moduleToLabel) {
                         $label = $module_name . '::' . $label;
                     }
                     return $label;
                 }
             }
         }
     }
     if ($moduleToLabel) {
         $label = $module_name . '::' . $label;
     }
     return $field_name;
 }
示例#22
0
function translate_label($label_tag)
{
    global $mod_strings;
    return get_label($label_tag, $mod_strings);
}
<div class="row">
	<!-- Culture -->
	<div class="medium-6 columns">
		<?php 
get_label('culture');
?>
		<hr>
		<?php 
get_culture_latest_posts();
?>
	</div>

	<!-- Sports -->
	<div class="medium-6 columns">
		<?php 
get_label('sports');
?>
		<hr>
		<?php 
get_sports_latest_posts();
?>
	</div>
</div>

<!-- Four latest posts without thumbnails -->
<div class="row">
	<!-- Culture -->
	<div class="medium-6 columns">
		<?php 
get_culture_list();
?>
示例#24
0
        urna_nombre,
        urna_id
    from 
        urna 
    where
        urna_id = ?
END;
$sql_params = array($record_id);
include 'header.php';
unset($params_cont);
$params_cont['record_id'] = $record_id;
$params_cont = params_encode($params_cont);
$action1 = "?action={$this_table}" . '_update&params=' . $params_cont;
$action2 = "?action={$this_table}" . '_delete&params=' . $params_cont;
echo '<div>';
echo '<h1>' . $this_icon . ' Datos de la ' . get_label($this_table) . ' <i><span class="alert alert-warning">' . $record_id . '</i></span></h1>';
echo '<br>';
//echo '<a href="?action=user_change_pass" class="btn btn-default" role="button">Agregar Usuario</a>';
echo '<a href="' . $action1 . '" class="btn btn-primary" role="button">Editar ' . $this_table . '</a> ';
echo '<a href="' . $action2 . '" class="btn btn-warning" role="button">Eliminar ' . $this_table . '</a> ';
echo '<br>';
echo '<br>';
echo '</div>';
$db = new PDO($db_dsn, $db_user, $db_pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
$st = $db->prepare($sql);
$st->execute($sql_params);
unset($params);
$params['data'] = $st->fetch(PDO::FETCH_ASSOC);
if (empty($params['data'])) {
示例#25
0
                                <table>
                                    <thead>

                                    </thead>

                                    <?php 
        $start_date = get_field('start_date');
        //                                    $start_date_formatted = date("d/m/Y", strtotime($start_date));
        $start_date_formatted = str_replace('-', '/', $start_date);
        $end_date = get_field('end_date');
        if (get_field('ongoing')) {
            $implementation_period = $start_date_formatted . '<br> ' . get_label('ongoing');
        } elseif ($end_date) {
            //                                        $end_date_formatted = date("d/m/Y", strtotime($end_date));
            $end_date_formatted = str_replace('-', '/', $end_date);
            $implementation_period = $start_date_formatted . ' ' . get_label('till') . ' ' . $end_date_formatted;
        }
        ?>
                                    <tbody>
                                        <tr>
                                            <td><p><?php 
        the_label('implementation period');
        ?>
</p></td>
                                            <td><p><?php 
        echo $implementation_period;
        ?>
</p> </td>
                                        </tr>
                                        <tr>
                                            <td><p><?php 
示例#26
0
} elseif ($focus->user_type == "trig_user_custom") {
    $target_module = BeanFactory::getBean($focus->base_module);
    //$target_module = get_rel_trace_results($focus->base_module, $focus->rel_module1, $focus->rel_module2);
    $target_module_name = $target_module->module_dir;
    $current_module_strings = return_module_language($current_language, $target_module_name);
    $form->assign("TARGET_MODULE", $target_module_name);
    $form->assign("FIELD_VALUE", $focus->field_value);
    $form->assign("REL_EMAIL_VALUE", $focus->rel_email_value);
    if ($focus->id != "") {
        $form->assign("ADDRESS_TYPE", $focus->address_type);
        $form->assign("RELATE_TYPE", "Self");
        $form->assign("ARRAY_TYPE", "future");
        $target_email_field_lbl = $target_module->field_defs[$focus->rel_email_value]['vname'];
        $target_name_field_lbl = $target_module->field_defs[$focus->field_value]['vname'];
        $form->assign("REL_CUSTOM1_TEXT2", get_label($target_email_field_lbl, $current_module_strings));
        $form->assign("REL_CUSTOM1_TEXT3", get_label($target_name_field_lbl, $current_module_strings));
        $form->assign("REL_CUSTOM1_CHECKED", "checked");
        $form->assign("ADDRESS_TYPE_TARGET", $app_list_strings[$address_type_dom][$focus->address_type]);
    } else {
        $form->assign("REL_CUSTOM1_TEXT2", $mod_strings['LBL_REL_CUSTOM2']);
        $form->assign("REL_CUSTOM1_TEXT3", $mod_strings['LBL_REL_CUSTOM3']);
        $form->assign("ADDRESS_TYPE_TARGET", $mod_strings['LBL_ADDRESS_TYPE_TARGET']);
    }
    $form->assign("REL_CUSTOM1_TEXT1", $mod_strings['LBL_REL_CUSTOM']);
    $form->parse("main.trig_custom_frame_top");
    $form->parse("main.trig_custom_frame_bottom");
    $start_jscript = "togglefield_select('rel_custom1'); \n";
    $form->assign("REL_USER_CUSTOM_START_JSCRIPT", $start_jscript);
    //end if user_type is trig_user_custom
} else {
    global $alert_meta_user_array;
示例#27
0
<?php

!function_exists('html') && exit('ERR');
if ($action == 'mod') {
    $div_db[div_w] = $div_w;
    $div_db[div_h] = $div_h;
    $div_db[div_bgcolor] = $div_bgcolor;
    $div = addslashes(serialize($div_db));
    $typesystem = 0;
    //插入或更新标签库
    do_post();
}
$rsdb = get_label();
$rsdb[hide] ? $hide_1 = 'checked' : ($hide_0 = 'checked');
if ($rsdb[js_time]) {
    $js_time = 'checked';
}
@extract(unserialize($rsdb[divcode]));
$div_width && ($div_w = $div_width);
$div_height && ($div_h = $div_height);
$rsdb[code] = "<iframe src='http://weather.265.com/weather.htm' width='168' height='54' frameborder='no' border='0' marginwidth='0' marginheight='0' scrolling='no'></iframe>";
require "head.php";
require "template/label/hack_code.htm";
require "foot.php";
示例#28
0
<!-- // Culture // -->

<!-- Category label -->
<?php 
get_label('culture');
?>
<hr>

<!-- Two latest posts with thumbnails -->
<?php 
get_culture_latest_posts();
?>

<!-- Four latest posts without thumbnails -->
<?php 
get_culture_mobile();
?>

<!-- Get more posts -->
<?php 
get_more_posts('culture');
?>
<br/>
示例#29
0
 function get_vardef_array($use_singular = false, $remove_dups = false, $use_field_name = false, $use_field_label = false)
 {
     global $dictionary;
     global $current_language;
     global $app_strings;
     global $app_list_strings;
     $temp_module_strings = return_module_language($current_language, $this->module_object->module_dir);
     $base_array = $this->module_object->field_defs;
     //$base_array = $dictionary[$this->module_object->object_name]['fields'];
     ///Inclue empty none set or not
     if ($this->start_none == true) {
         if (!empty($this->start_none_lbl)) {
             $this->options_array[''] = $this->start_none_lbl;
         } else {
             $this->options_array[''] = $app_strings['LBL_NONE'];
         }
     }
     ///used for special one off items added to filter array	 ex. would be href link for alert templates
     if (!empty($this->extra_array)) {
         foreach ($this->extra_array as $key => $value) {
             $this->options_array[$key] = $value;
         }
     }
     /////////end special one off//////////////////////////////////
     foreach ($base_array as $key => $value_array) {
         $compare_results = $this->compare_type($value_array);
         if ($compare_results == true) {
             $label_name = '';
             if ($value_array['type'] == 'link' && !$use_field_label) {
                 $this->module_object->load_relationship($value_array['name']);
                 if (!empty($app_list_strings['moduleList'][$this->module_object->{$value_array}['name']->getRelatedModuleName()])) {
                     $label_name = $app_list_strings['moduleList'][$this->module_object->{$value_array}['name']->getRelatedModuleName()];
                 } else {
                     $label_name = $this->module_object->{$value_array}['name']->getRelatedModuleName();
                 }
             } else {
                 if (!empty($value_array['vname'])) {
                     $label_name = $value_array['vname'];
                 } else {
                     $label_name = $value_array['name'];
                 }
             }
             $label_name = get_label($label_name, $temp_module_strings);
             if (!empty($value_array['table'])) {
                 //Custom Field
                 $column_table = $value_array['table'];
             } else {
                 //Non-Custom Field
                 $column_table = $this->module_object->table_name;
             }
             if ($value_array['type'] == 'link') {
                 if ($use_field_name) {
                     $index = $value_array['name'];
                 } else {
                     $index = $this->module_object->{$key}->getRelatedModuleName();
                 }
             } else {
                 $index = $key;
             }
             $value = trim($label_name, ':');
             if ($remove_dups) {
                 if (!in_array($value, $this->options_array)) {
                     $this->options_array[$index] = $value;
                 }
             } else {
                 $this->options_array[$index] = $value;
             }
             //end if field is included
         }
         //end foreach
     }
     if ($use_singular == true) {
         return convert_module_to_singular($this->options_array);
     } else {
         return $this->options_array;
     }
     //end get_vardef_array
 }
示例#30
0
<!-- // News // -->

<!-- Category label -->
<?php 
get_label('news');
?>
<hr>
<!-- Latest post thumbnail and title -->
<?php 
get_news_thumbnail();
get_news_title();
?>
<!-- Single sentence excerpt -->
<?php 
get_news_excerpt();
?>
<!-- Post list -->
<?php 
get_news_list_mobile();
?>
<!-- Get more posts -->
<?php 
get_more_posts('news');
?>
<br/>