예제 #1
0
파일: home.php 프로젝트: sgh1986915/php-crm
                echo 'col-lg-12';
                break;
        }
        ?>
 connectedSortable">
			    <?php 
        uasort($column_widgets, function ($a, $b) {
            return $a['page_order'] > $b['page_order'];
        });
        foreach ($column_widgets as $column_widget) {
            if (isset($column_widget['raw']) && $column_widget['raw']) {
                $widget_html = $column_widget['content'];
            } else {
                // wrap it in a widget block:
                $fieldset_data = array('id' => 'widg_' . $column_widget['sort_id'], 'heading' => array('type' => 'h3', 'title' => $column_widget['title']), 'class' => 'tableclass tableclass_form tableclass_full', 'elements_before' => $column_widget['content']);
                $widget_html = module_form::generate_fieldset($fieldset_data);
                unset($fieldset_data);
            }
            $widget_html = preg_replace('#^\\s+<\\w+\\s#imsU', '$0 data-sort-id="' . $column_widget['sort_id'] . '"', $widget_html, 1);
            echo '<!-- asdf -->' . $widget_html;
        }
        ?>
		    </section>
		<?php 
    }
    ?>
	</div>
	<?php 
}
?>
예제 #2
0
        echo '<strong>{' . htmlspecialchars($key) . '}</strong>';
        if ($val && !is_array($val)) {
            echo ' ' . htmlspecialchars($val);
        }
        echo '</li>';
    }
} else {
}
?>

	        </ul>
            <br/><br/>

        </td>
    </tr>


    </tbody>
</table>

    <?php 
$fieldset_data = array('heading' => array('type' => 'h2', 'main' => true, 'title' => 'Edit Template'), 'elements_before' => ob_get_clean());
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
$form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('ignore' => !(module_template::can_i('delete', 'Templates') && (int) $template_id > 0), 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link('template', array('template_id' => false)) . "';")));
echo module_form::generate_form_actions($form_actions);
?>


</form>
예제 #3
0
    public static function display_groups($options)
    {
        //if(!self::can_i('view','Group','Groups'))return '';
        $owner_id = isset($options['owner_id']) && $options['owner_id'] ? (int) $options['owner_id'] : false;
        $owner_table = isset($options['owner_table']) && $options['owner_table'] ? $options['owner_table'] : false;
        //default to true.
        $can_create = $can_edit = $can_view = $can_delete = true;
        if ($options && isset($options['bypass_security'])) {
            // do nothing?
        } else {
            if (isset($options) && isset($options['owner_table']) && $options['owner_table'] && isset($options['title']) && $options['title']) {
                global $plugins;
                if (isset($plugins[$options['owner_table']])) {
                    $can_create = $can_edit = $can_view = $can_delete = false;
                    // default to false if permissions exist.
                    $can_view = $plugins[$options['owner_table']]->can_i('view', $options['title']);
                    $can_edit = $plugins[$options['owner_table']]->can_i('edit', $options['title']);
                    $can_create = $plugins[$options['owner_table']]->can_i('create', $options['title']);
                    $can_delete = $plugins[$options['owner_table']]->can_i('delete', $options['title']);
                }
            }
        }
        if (!$can_view) {
            return;
        }
        //$html = '';
        if ($owner_id && $owner_table) {
            // we have all that we need to display some groups!! yey!!
            // get a list of all groups.
            $fieldset_data = array();
            $responsive_summary = array();
            $group_items = self::get_groups($owner_table);
            foreach ($group_items as $key => $group_item) {
                $group_id = $group_item['group_id'];
                $sql = "SELECT * FROM `" . _DB_PREFIX . "group_member` gm WHERE `group_id` = {$group_id} AND `owner_id` = '" . mysql_real_escape_string($owner_id) . "' AND owner_table = '" . mysql_real_escape_string($owner_table) . "'";
                $res = query($sql);
                if (mysql_num_rows($res)) {
                    $group_items[$key]['checked'] = true;
                    $responsive_summary[] = htmlspecialchars($group_item['name']);
                }
                mysql_free_result($res);
            }
            if (isset($options['title']) && $options['title']) {
                $fieldset_data['heading'] = array('title' => $options['title'], 'type' => 'h3', 'responsive' => array('summary' => implode(', ', $responsive_summary)));
            }
            ob_start();
            //<div class="content_box_wheader">
            ?>

            <table class="tableclass tableclass_full tableclass_form">
                <tbody>
                    <?php 
            if (isset($options['description']) && $options['description']) {
                ?>

                        <tr>
                            <td colspan="2">
                                <?php 
                echo $options['description'];
                ?>

                            </td>
                        </tr>
                    <?php 
            }
            foreach ($group_items as $group_item) {
                $group_id = $group_item['group_id'];
                ?>

                        <tr id="group_<?php 
                echo $group_id;
                ?>
">
                            <th class="width1"<?php 
                if (self::can_i('edit', 'Groups')) {
                    ?>
 data-settings-url="<?php 
                    echo module_group::link_open($group_id, false);
                    ?>
" <?php 
                }
                ?>
>
                                <?php 
                if ($can_edit) {
                    ?>

                                <input type="hidden" name="group_module[<?php 
                    echo $owner_table;
                    ?>
][<?php 
                    echo $group_id;
                    ?>
]" value="<?php 
                    echo htmlspecialchars($owner_id);
                    ?>
">
                                <input type="checkbox" name="used_group_module[<?php 
                    echo $owner_table;
                    ?>
][<?php 
                    echo $group_id;
                    ?>
]" id="groupchk<?php 
                    echo $owner_table . $group_id;
                    ?>
" value="<?php 
                    echo htmlspecialchars($owner_id);
                    ?>
" <?php 
                    echo isset($group_item['checked']) && $group_item['checked'] ? ' checked' : '';
                    ?>
>
                                <?php 
                } else {
                    ?>

                                    <input type="checkbox" name="group" value="<?php 
                    echo htmlspecialchars($owner_id);
                    ?>
" <?php 
                    echo isset($group_item['checked']) && $group_item['checked'] ? ' checked' : '';
                    ?>
 disabled="">
                                <?php 
                }
                ?>

                            </th>
                            <td>
                                <label for="groupchk<?php 
                echo $owner_table . $group_id;
                ?>
"><?php 
                echo htmlspecialchars($group_item['name']);
                ?>
</label>
                            </td>
                        </tr>
                        <?php 
            }
            if ($can_create && module_security::is_page_editable() && get_display_mode() != 'mobile') {
                $group_id = 'new';
                ?>

                    <tr id="group_<?php 
                echo $group_id;
                ?>
">
                        <th class="width1">
                            <input type="hidden" name="group_module[<?php 
                echo $owner_table;
                ?>
][<?php 
                echo $group_id;
                ?>
]" value="<?php 
                echo htmlspecialchars($owner_id);
                ?>
">
                            <input type="checkbox" name="used_group_module[<?php 
                echo $owner_table;
                ?>
][<?php 
                echo $group_id;
                ?>
]" id="groupchk<?php 
                echo $owner_table . $group_id;
                ?>
" value="<?php 
                echo htmlspecialchars($owner_id);
                ?>
">
                        </th>
                        <td>
                            <label for="groupchk<?php 
                echo $owner_table . $group_id;
                ?>
"></label>
                            <input type="text" name="group_module_name[<?php 
                echo $owner_table;
                ?>
][<?php 
                echo $group_id;
                ?>
]" autocomplete="off">
                        </td>
                    </tr>
                    <?php 
            }
            ?>

                </tbody>
            </table>
            <?php 
            //</div>
            $fieldset_data['elements_before'] = ob_get_clean();
            echo module_form::generate_fieldset($fieldset_data);
        }
        //print $html;
    }